Made ADSL latency graph a little neater

This commit is contained in:
Matthew Connelly 2015-12-13 18:03:57 +00:00
parent 707a21c97c
commit 39dc58dfb6
1 changed files with 8 additions and 5 deletions

View File

@ -2,21 +2,24 @@
# This plugin requires the opkg package perl to be installed. # This plugin requires the opkg package perl to be installed.
host="maff.scot" # Sky's primary DNS recursor, should be as close as possible to latency from the home to the packet network
host="90.207.238.97"
timeout=1
count=5
if [ "$1" == "config" ];then if [ "$1" == "config" ];then
echo "multigraph ping_lat echo "multigraph ping_lat
graph_title ADSL latency to $host graph_title ADSL latency
graph_scale no graph_scale no
graph_args --base 1000 -l 0 graph_args --base 1000 -l 0
graph_vlabel latency (ms) graph_vlabel latency (ms)
graph_category network graph_category network
graph_info This graph shows latency statistics to $host graph_info This graph shows connection latency, testing against $host
ping.label $host ping.label $host
ping.min 0 ping.min 0
multigraph ping_loss multigraph ping_loss
graph_title Packet loss to $host graph_title Packet loss
graph_scale no graph_scale no
graph_args --base 1000 -l 0 graph_args --base 1000 -l 0
graph_vlabel loss (%) graph_vlabel loss (%)
@ -27,4 +30,4 @@ loss.colour COLOUR15"
exit 0 exit 0
fi fi
/bin/ping -c 2 $host|/usr/bin/perl -ne '/^round.*=.*?\/([0-9\.]+)\// and print "multigraph ping_lat\nping.value $1\n";/ ([0-9]+)% packet loss/ and print "multigraph ping_loss\nloss.value $1\n"' /bin/ping -c $count -W $timeout $host|/usr/bin/perl -ne '/^round.*=.*?\/([0-9\.]+)\// and print "multigraph ping_lat\nping.value $1\n";/ ([0-9]+)% packet loss/ and print "multigraph ping_loss\nloss.value $1\n"'