hello,
i add a service that use the check_website_speed command '
i check the command on the nagios server (from the libexec folder) and it work great ,
on the new service i get always a null response .
what could be the problem ?
check_website_speed
-
- Former Nagios Staff
- Posts: 13589
- Joined: Mon May 23, 2011 12:15 pm
Re: check_website_speed
Did you follow the steps outlined in this document while adding the service?
Run the command in the command line, logged in as nagios user, and show us the output.
Also, show the output of the following command:
Run the command in the command line, logged in as nagios user, and show us the output.
Also, show the output of the following command:
Code: Select all
ls -l /usr/local/nagios/libexec/
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 8
- Joined: Tue Jul 17, 2012 9:53 am
Re: check_website_speed
thank for the replay
i checked again the command and i need to add "php" word
to the command at first .
But now i have another issue ,
i can't get performance graph for this command
it is possible and what should i do ?
i checked again the command and i need to add "php" word
to the command at first .
But now i have another issue ,
i can't get performance graph for this command
it is possible and what should i do ?
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
Re: check_website_speed
Are you using this plugin?
http://exchange.nagios.org/directory/Pl ... ed/details
If so, I made a modified version I believe should work (untested)..
You will have to unzip to install it
http://exchange.nagios.org/directory/Pl ... ed/details
If so, I made a modified version I believe should work (untested)..
You will have to unzip to install it
You do not have the required permissions to view the files attached to this post.
-
- Posts: 8
- Joined: Tue Jul 17, 2012 9:53 am
Re: check_website_speed
thank you very much it's working 

-
- Posts: 231
- Joined: Tue Aug 07, 2012 5:08 am
Re: check_website_speed
Hi everyone,
Sorry to jump onto your thread like this, but this isn't working for me.
I added the command via web interface;
And the service;
Web interface shows OK, but status information;
Left clicking, the service shows the following;
This is, I believe, the check_website_speed.php plugin information.
Any idea what I'm doing wrong please?
Thank you.
Kind Regards,
Gary Shergill
EDIT: This shows website speed - Does it mean if the website is down it will come back with a critical error? Thanks
Sorry to jump onto your thread like this, but this isn't working for me.
I added the command via web interface;
Code: Select all
define command {
command_name check_website_speed
command_line php /usr/local/nagios/libexec/check_website_speed.php "$ARG1$" $ARG2$ $ARG3$
}
Code: Select all
define service {
host_name hostname
service_description Google Website
use generic-service
display_name Google Website
check_command check_website_speed!google.com!3!5!!!!!
notifications_enabled 0
register 1
}
Code: Select all
<?
Code: Select all
<?
/*
* (c) 2009 by Michael Bladowski (info@macropage.de)
* GPLv2, no warranty of any kind given.
*/
$url = $argv[1];
$warning = $argv[2];
$error = $argv[3];
$url = preg_replace('/\\s*/','',$url);
$warning = preg_replace('/\\s*/','',$warning);
$error = preg_replace('/\\s*/','',$error);
function microtime_float()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
$time_start = microtime_float();
$bla = file_get_contents($url);
$time_end = microtime_float();
$time = $time_end - $time_start;
print "Response Time: $time ";
if ($time<$warning) {
print "OK
Any idea what I'm doing wrong please?
Thank you.
Kind Regards,
Gary Shergill
EDIT: This shows website speed - Does it mean if the website is down it will come back with a critical error? Thanks
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
Re: check_website_speed
try updating the first line of /usr/local/nagios/libexec/check_website_speed.php
to
<?php
to
<?php
-
- Posts: 231
- Joined: Tue Aug 07, 2012 5:08 am
Re: check_website_speed
Hi scottwilkerson,
Thank you, that worked perfectly.
Was just wondering, if I enter a totally random website address, it still comes back with a positive result (even though the website doesn't exist).
Does this mean the plugin command hasn't been correctly entered by me? Or is this expected?
Thank you.
Kind Regards,
Gary Shergill
Thank you, that worked perfectly.
Was just wondering, if I enter a totally random website address, it still comes back with a positive result (even though the website doesn't exist).
Does this mean the plugin command hasn't been correctly entered by me? Or is this expected?
Thank you.
Kind Regards,
Gary Shergill
-
- Former Nagios Staff
- Posts: 13589
- Joined: Mon May 23, 2011 12:15 pm
Re: check_website_speed
That's to be expected - this script is only "based on time".
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 231
- Joined: Tue Aug 07, 2012 5:08 am
Re: check_website_speed
Hi lmiltchev,
Thank you for the reply.
Kind Regards,
Gary Shergill
Thank you for the reply.
Kind Regards,
Gary Shergill