Hacker News new | ask | show | jobs
by falcolas 4124 days ago
It's not on a machine I have access to right now, but I'm fairly certain it went something like:

    while [ "true" ]
    do
        printf 'google_ping %f %s' $(ping -c1 www.google.com | awk '/ms/ {print $7};' | awk -F '=' '{print $2};') $(date +%s) | nc graphite_host 2003
        sleep 10
    done
2 comments

Awesome, thanks :)
fwiw I use

    ping -n www.google.com | awk '/ms/ {split($7,p,"="); print "ping.google " p[2] " " strftime("%s")}; fflush()' | nc -q0 127.0.0.1 2003 &
I bow before your awk-fu. :)