check_http returning success full results on a urlwhich is down

Darren McMillan duffy290 at yahoo.co.uk
Thu Jan 24 18:12:40 CET 2008


Hi Mark, All,

First thanks for the quick response I appreciate your help.

The test harness is run by a simple batch script on each client machine, if I execute it the harness is on & I can verify that with the following command from command line, using the -s that you suggested.

 ./check_http  -I 10.77.40.123 -p 2000 -s "QA-testHarness"

HTTP OK HTTP/1.1 200 OK - 0.340 second response time |time=0.339870s;;;0.000000 size=5505B;;;0

If i close the harness I correctly get the following response with the same command

Connection refused
HTTP CRITICAL - Unable to open TCP socket

I've edited my commands.cfg to include the -s 

command_line    $USER1$/check_http -H $HOSTADDRESS$ -p $ARG1$ -u $ARG2$ -s $ARG3$

Within my windows.cfg I have altered check command for check_http to include the -s.

check_command            check_http!2000!/test/results!QA-testHarness

Please correct me if I am wrong with either of these two, I'm still getting to grips with the proper syntax to use here.

So I do a pre-flight check & reboot nagios, then via the web interface I force a service check on check_http with the harness down so I should get an error, however it still passes successfully.

My apache logs show no errors, and the following for the checks.

127.0.0.1 - nagiosadmin [24/Jan/2008:16:56:01 +0000] "GET /nagios/cgi-bin/extinfo.cgi?type=2&host=PONGO&service=HTTP HTTP/1.1" 200 9709 "http://localhost/nagios/cgi-bin/status.cgi?host=all" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) Gecko/20070417 Fedora/2.0.0.3-4.fc7 Firefox/2.0.0.3"
127.0.0.1 - nagiosadmin [24/Jan/2008:16:56:06 +0000] "GET /nagios/cgi-bin/cmd.cgi?cmd_typ=7&host=PONGO&service=HTTP&force_check HTTP/1.1" 200 3067 "http://localhost/nagios/cgi-bin/extinfo.cgi?type=2&host=PONGO&service=HTTP" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) Gecko/20070417 Fedora/2.0.0.3-4.fc7 Firefox/2.0.0.3"
127.0.0.1 - nagiosadmin [24/Jan/2008:16:56:08 +0000] "POST /nagios/cgi-bin/cmd.cgi HTTP/1.1" 200 1230 "http://localhost/nagios/cgi-bin/cmd.cgi?cmd_typ=7&host=PONGO&service=HTTP&force_check" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) Gecko/20070417 Fedora/2.0.0.3-4.fc7 Firefox/2.0.0.3"
127.0.0.1 - nagiosadmin [24/Jan/2008:16:56:11 +0000] "GET /nagios/cgi-bin/extinfo.cgi?type=2&host=PONGO&service=HTTP HTTP/1.1" 200 9709 "http://localhost/nagios/cgi-bin/status.cgi?host=all" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) Gecko/20070417 Fedora/2.0.0.3-4.fc7 Firefox/2.0.0.3"
127.0.0.1 - nagiosadmin [24/Jan/2008:16:56:16 +0000] "GET /nagios/cgi-bin/status.cgi?host=all HTTP/1.1" 200 100331 "http://localhost/nagios/side.html" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) Gecko/20070417 Fedora/2.0.0.3-4.fc7 Firefox/2.0.0.3"

Thanks for your time & patience,

Darren.


Marc Powell <marc at ena.com> wrote: 

> -----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  -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


       
---------------------------------
 Sent from Yahoo! - a smarter inbox.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20080124/f1d8a1a2/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
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/
-------------- next part --------------
_______________________________________________
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