check_website_speed

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Melingo
Posts: 8
Joined: Tue Jul 17, 2012 9:53 am

check_website_speed

Post by Melingo »

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 ?
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_website_speed

Post by lmiltchev »

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:

Code: Select all

ls -l /usr/local/nagios/libexec/
Be sure to check out our Knowledgebase for helpful articles and solutions!
Melingo
Posts: 8
Joined: Tue Jul 17, 2012 9:53 am

Re: check_website_speed

Post by Melingo »

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 ?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_website_speed

Post by scottwilkerson »

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
check_website_speed.zip
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Melingo
Posts: 8
Joined: Tue Jul 17, 2012 9:53 am

Re: check_website_speed

Post by Melingo »

thank you very much it's working :D
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: check_website_speed

Post by gshergill »

Hi everyone,

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$
}
And the service;

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
        }
Web interface shows OK, but status information;

Code: Select all

<?
Left clicking, the service shows the following;

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
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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_website_speed

Post by scottwilkerson »

try updating the first line of /usr/local/nagios/libexec/check_website_speed.php
to
<?php
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: check_website_speed

Post by gshergill »

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
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_website_speed

Post by lmiltchev »

That's to be expected - this script is only "based on time".
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: check_website_speed

Post by gshergill »

Hi lmiltchev,

Thank you for the reply.

Kind Regards,

Gary Shergill
Locked