check_http and other response codes

Morty morty+nagios at frakir.org
Thu Oct 13 09:18:08 CEST 2011


On Wed, Oct 12, 2011 at 11:16:17PM -0500, Frank Bulk wrote:
> Isn't there some regex matching?

There is.  But it didn't help me in either case.  check_http
apparently does an implicit test to make sure it gets a valid response
code such as 200.  And the regex checking is in content, not headers
or response code.  So check_http -H $host -S -r 401 still returns a
warning with a server that requires auth, and check_http -H $host -S
-j TRACE -r 405 still returns a warning on a server with TRACE
disabled.

While reading a different thread on this mailing list, I found Mark
Thomas's mention of "negate".  That actually did workaround my HTTP
TRACE problem -- TRACE will cause check_http to return a warning when
it's disabled and ok when it's enabled, so the following command
definition will test for HTTP TRACE:

define command{
        command_name    check_http_trace
        command_line    $USER1$/negate -sw OK -o CRITICAL -c OK -- $USER1$/check_http -j TRACE -f sticky -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
        }

But IMHO, that's something of a hack.  And it doesn't deal with the 401 issue.

- Morty

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
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