Need help with check_http

Marc Powell marc at ena.com
Fri Jul 27 18:27:39 CEST 2007



> -----Original Message-----
> From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-
> bounces at lists.sourceforge.net] On Behalf Of Rob Hamilton
> Sent: Friday, July 27, 2007 10:58 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Need help with check_http
> 
> 
> 
> The check_http plugin doesn't seem to be catching critical events and
> connection refused events:


> When apache is off, I get a "Connection refused"  in the status
> information, but the nagios status for the defined service is "OK"
> 
> 
> 
> When apache is up and the app server is down, I get "HTTP CRITICAL -
> Invalid HTTP response received from host " in the status information,
but
> the nagios status for the defined service is "OK"
> 
> 
> 
> When I run check_http from the command line manually, I can confirm
that
> I'm receiving correct status information back and the expect string of
> "OK" isn't in the response.
> 
> 
> 
> What am I missing?

The nagios status is not derived from the text output but rather the
exit code of the plugin. When testing from the command line, use 'echo
$?' to verify the exit code of the plugin. 0 = OK, 1 = Warning, 2 =
Critical. The symptoms you are reporting indicate that the exit code
isn't being set properly or isn't being seen by nagios properly.

I've confirmed that it should work as specified by you, at least with a
slightly older version of check_http. Are you seeing the proper exit
code from the plugin? --

$ ./check_http -e OK -H www.somehost.com -I myip.address -u /foo
Invalid HTTP response received from host
$ echo $?
2

$ ./check_http -e OK -H www.somehost.com -I myip.address -u /foo
Connection refused
Unable to open TCP socket
$ echo $?
2

$ ./check_http -V
check_http (nagios-plugins 1.4.3) 1.89

If nagios isn't seeing the exit code properly, that would be a rather
unique situation. I can't recall seeing that before.

--
Marc

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
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