Files
cacti/scripts/ping.pl
T
Ian Berry 87de6aa496 making scripts compliment with 0.8 output structure
git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/trunk/cacti@535 860744bd-22fc-0310-8c96-e9fe5004b5ca
2003-02-17 08:39:38 +00:00

8 lines
232 B
Perl

#!/usr/bin/perl
$ping = `/bin/ping -c $ARGV[0] -w 300 -n -q $ARGV[1]`;
($packet_loss) = ($ping =~ /received, (\d+)% loss/);
($round_trip) = ($ping =~ /rtt min\/avg\/max\/mdev = \d+\.\d+\/(\d+\.\d+)\/.* ms/);
print "$round_trip";