X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fscripts%2Fmakegraphs;h=4e22159457f2f10ef222e06a65a3bb74f7249dc1;hb=a28fdc01dab591eb15e3fd3020d4efe45b05db30;hp=ed3bbeac250ba317041dc5bf4209c1c4b92e059a;hpb=b0c66429c4f84bb4923bfb4be3d3f4a72f5d3fa2;p=ipfire-2.x.git diff --git a/src/scripts/makegraphs b/src/scripts/makegraphs index ed3bbeac25..4e22159457 100644 --- a/src/scripts/makegraphs +++ b/src/scripts/makegraphs @@ -379,11 +379,22 @@ sub updatelq { my $LQ_GATEWAY=`cat /var/ipfire/red/remote-ipaddress`; chomp($LQ_GATEWAY); my $NUMPINGS=5; - my $pingoutput = `ping -c $NUMPINGS -q $LQ_GATEWAY`; - chomp; + my $pingoutput = `/usr/bin/ping -w 10 -c $NUMPINGS -q $LQ_GATEWAY | tail -2`; my @temp = split (/\/|\%|\s/, $pingoutput); - $packetloss = $temp[17]; - $roundtrip = $temp[28]; + $packetloss = $temp[5]; + $roundtrip = $temp[17]; + + print "Paketlos->".$packetloss."<-Roundtrip->".$roundtrip."<-\n"; + + if ( $packetloss eq "100" ){ + my $pingoutput = `/usr/bin/ping -w 10 -c $NUMPINGS -q ping.ipfire.org | tail -2`; + my @temp = split (/\/|\%|\s/, $pingoutput); + $packetloss = $temp[5]; + $roundtrip = $temp[17]; + + print "Paketlos->".$packetloss."<-Roundtrip->".$roundtrip."<-\n"; + } + RRDs::update ("$rrdlog/lq.rrd", "N:$packetloss:$roundtrip"); $ERROR = RRDs::error; print "Error in RRD::update for line quality: $ERROR\n" if $ERROR;