check_http returning success full results on a urlwhich is down

Marc Powell marc at ena.com
Wed Jan 23 18:45:56 CET 2008



> -----Original Message-----
> From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-
> bounces at lists.sourceforge.net] On Behalf Of Darren McMillan
> Sent: Wednesday, January 23, 2008 10:51 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] check_http returning success full results on a
> urlwhich is down
> 
> Hi All,
> 
> I'm currently running Nagios 3.0 on a Fedora 7 box, with the latest
plug-
> in package.
> 
> I'm trying to configure the check_http plug-in to check a test harness
> running on a Windows box which can be accessed via a web interface.
The
> problem is that I have brought the test harness down, so that when you
> manually connect to it via a browser
(http://hostname:2000/test/results)
> it will return a page cannot be displayed error as expected.  However
the
> check_http is still responding with a success "HTTP OK HTTP/1.1 200 OK
-
> 5029 bytes in 0.004 seconds".
> 

> define command{
>     command_name    check_http
>     command_line    $USER1$/check_http -H $HOSTADDRESS$ -p $ARG1$ -u
> $ARG2$
>     }
> 
> I have set this as a service in the windows.cfg as follows
> 
> define service{
>     use                                     generic-service
>     host_name                          PONGO
>     service_description             HTTP
>     check_command
check_http!pongo!2000!/test/results
>     notifications_enabled              0
>     }

This should be failing loudly. It can't be what nagios is actually
using. The command being executed by nagios would be --

/path/to/plugins/check_http -H <someIP> -p pongo -u 2000

$ ./check_http -H 172.27.0.101 -p pongo -u 2000
check_http: Invalid port number - pongo


> Can anyone spot why this is not failing even though I've closed the
URL
> it's trying to access?

It's getting a 200 (successful) response code from your webserver.
You're not testing what you think you're testing.

Check your web server logs to see what nagios really is checking. You
might also be interested in the -s option to verify output from your
webserver.

--
Marc


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list