Skip to content

Instantly share code, notes, and snippets.

archim@monitoring:/etc/smokeping$ cat watch.sh
#!/bin/bash
cd /etc/smokeping/config.d
while :; do
inotifywait -e CLOSE_WRITE /etc/smokeping/config.d/*
for f in *config.txt; do
python /etc/smokeping/convert.py $f > `basename $f .txt`_converted.txt
done
invoke-rc.d smokeping restart
done
(pprof) top10
13500ms of 18050ms total (74.79%)
Dropped 83 nodes (cum <= 90.25ms)
Showing top 10 nodes out of 47 (cum >= 230ms)
flat flat% sum% cum cum%
4550ms 25.21% 25.21% 5040ms 27.92% syscall.Syscall
4530ms 25.10% 50.30% 4530ms 25.10% runtime.epollwait
1010ms 5.60% 55.90% 1010ms 5.60% runtime.futex
870ms 4.82% 60.72% 1050ms 5.82% runtime.mallocgc
730ms 4.04% 64.76% 730ms 4.04% scanblock
package main
import (
"log"
"net"
"golang.org/x/net/ipv4"
)
func main() {
MacBook-Pro-Arthur:~ archim$ traceroute -I hromadske.dn.ua
traceroute to hromadske.dn.ua (188.226.143.35), 64 hops max, 72 byte packets
1 172.16.1.1 (172.16.1.1) 2.017 ms 1.977 ms 1.091 ms
2 78.26.216.1 (78.26.216.1) 6.618 ms 7.683 ms 3.907 ms
3 10.0.0.61 (10.0.0.61) 2.628 ms 2.025 ms 2.623 ms
4 78.26.128.145 (78.26.128.145) 2.646 ms 2.393 ms 2.613 ms
5 194.44.6.93 (194.44.6.93) 9.257 ms 10.328 ms 9.266 ms
6 194.44.212.254 (194.44.212.254) 17.004 ms 16.892 ms 16.954 ms
7 195.69.147.98 (195.69.147.98) 55.199 ms 54.785 ms 56.425 ms
8 95.85.0.242 (95.85.0.242) 56.531 ms 55.769 ms 61.620 ms
MacBook-Pro-Arthur:~ archim$ traceroute -v -a hromadske.dn.ua
traceroute to hromadske.dn.ua (188.226.143.35), 64 hops max, 52 byte packets
1 [AS0] 172.16.1.1 (172.16.1.1) 60 bytes to 172.16.1.4 2.502 ms 1.868 ms 1.315 ms
2 [AS34187] 78.26.216.1 (78.26.216.1) 36 bytes to 172.16.1.4 2.649 ms 3.647 ms 3.933 ms
3 [AS1] 10.0.0.61 (10.0.0.61) 60 bytes to 172.16.1.4 2.644 ms 2.299 ms 2.606 ms
4 [AS34187] 78.26.128.145 (78.26.128.145) 36 bytes to 172.16.1.4 2.638 ms 2.335 ms 2.618 ms
5 [AS3255] 194.44.6.93 (194.44.6.93) 36 bytes to 172.16.1.4 10.710 ms 10.266 ms 10.470 ms
6 [AS3255] 194.44.212.254 (194.44.212.254) 36 bytes to 172.16.1.4 17.082 ms 18.124 ms 17.024 ms
7 [AS1200] 195.69.147.98 (195.69.147.98) 36 bytes to 172.16.1.4 56.531 ms 49.581 ms 57.729 ms
8 [AS200130] 95.85.0.242 (95.85.0.242) 36 bytes to 172.16.1.4 56.418 ms 62.755 ms 61.661 ms
#!/usr/bin/env python
# -*- coding: utf-8
import curl
from datetime import datetime
connection = curl.Curl()
connection.set_timeout(20)
def get_document(url):