I found a post regarding using echoping to monitor page response time - however the script didn't allow you to specify pages to monitor, so I set off to create http_ping.pl that will take as input the domain and page to monitor - however Cacti simply gives partial result errors. The perl script and snippets from the log file are below. It seems there is simply no result - but running the script from command line all works fine. Any help would be greatly appreciated.
Cacti version 0.86g - CENT OS 4
http_ping.pl:
#!/usr/bin/perl
@ARGV == 2 or die "Syntax : http_ping.pl <HOST> <URI>\n";
$HOST = $ARGV[0];
$URI = $ARGV[1];
($Min,$Max,$Average) = (`echoping -n 2 -h $URI $HOST` =~ m/Min.*(\d+\.\d+).*\nMax.*(\d+\.\d+).*\nAverage.*(\d+\.\d+)/);
print $Average;
cacti.log:
11/29/2005 12:29:02 PM - CMDPHP: Poller[0] Host[9] DS[137] WARNING: Result from CMD not valid. Partial Result:
11/29/2005 12:29:02 PM - CMDPHP: Poller[0] Host[9] DS[137] CMD: perl /var/www/html/cacti/scripts/http_ping.pl www.google.com /advanced_search?hl=en, output: U
Monitor specific HTTP page response times
Moderators: Developers, Moderators
Follow up
Although there were a couple of issues - the main problem ended up being that the perl script when executed did not have the full path to echoping - for some reason when the poller ran from crontab, no path seems to be setup to /usr/local/bin - updating the echoping executable to include the full path finally resolved the issue.
- Attachments
-
- Example graph now being generated.
- http-response-time.png (23.66 KiB) Viewed 6157 times
Who is online
Users browsing this forum: No registered users and 1 guest