Monitor specific HTTP page response times

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

Moderators: Moderators, Developers

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

Monitor specific HTTP page response times

#1 Post by jcoppedge » Tue Nov 29, 2005 1:32 pm

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

#2 Post by jcoppedge » Wed Nov 30, 2005 12:24 pm

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
http-response-time.png
Example graph now being generated.
http-response-time.png (23.66 KiB) Viewed 5641 times

remy74
Posts: 6
Joined: Wed Nov 09, 2005 9:28 am

#3 Post by remy74 » Thu Dec 01, 2005 10:15 am

Great graph.. :lol:
Can you give all files for doing monitor web page ?
thanks

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#4 Post by gandalf » Thu Dec 01, 2005 2:38 pm

Moved to Scripts and Templates

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

Reinhard

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

#5 Post by akai » Mon Dec 12, 2005 7:59 am

Can you post the files?

Thanks. :wink:

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

#6 Post by macindy » Sat Feb 11, 2006 11:52 am

Please can you post this script/template
Thanks

Post Reply