The current ping.pl script for pinging hosts only does one ping. Here is an updated ping.pl script that takes the average ping times over 7 pings. This was tested on Cacti 0.8.6j on FreeBSD 6.0, so milage may vary with other OS's. this is in the cacti/scripts/ping.pl file.
Forgive me if there is a better way to do this in Perl -- I pretty much hacked this as best i could.
open(PROCESS, "/sbin/ping -c 7 $ARGV | grep round-trip |");
$ping = <PROCESS>;
$ping =~ m/(.* = .*\/)(.*)(\/.*\/.*)/;
Templates, scripts for templates, scripts and requests for templates.
1 post • Page 1 of 1