Monitor specific HTTP page response times

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
jcoppedge
Posts: 2
Joined: Tue Nov 29, 2005 1:21 pm

Monitor specific HTTP page response times

Post by jcoppedge »

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
jcoppedge
Posts: 2
Joined: Tue Nov 29, 2005 1:21 pm

Follow up

Post by jcoppedge »

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.
Example graph now being generated.
http-response-time.png (23.66 KiB) Viewed 6157 times
remy74
Posts: 6
Joined: Wed Nov 09, 2005 9:28 am

Post by remy74 »

Great graph.. :lol:
Can you give all files for doing monitor web page ?
thanks
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Moved to Scripts and Templates

There have already been scripts for this. Please search/google for them

Reinhard
akai
Posts: 13
Joined: Tue Feb 01, 2005 3:59 am

Post by akai »

Can you post the files?

Thanks. :wink:
macindy
Posts: 8
Joined: Sat Feb 11, 2006 11:50 am

Post by macindy »

Please can you post this script/template
Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest