check_http - ok status for http errors

Phil Costelloe philc at foundation-it.com
Thu Mar 13 13:21:56 CET 2003


> From: Matthieu Parisot [mailto:mat at avedya.com] 
> 
> Xfer wrote:
> 
> >I want to be able to use the plugin check_http to return an 
> ok status 
> >if the http server returns error status like 404 or 401,
> >
> >Does anyone know if there are some weard switches that can be used?
> >
> >Or has anyone developed a script to do this?
> >
> I suggest that you write a shell plugin using curl, which 
> allows you to display only the http_code that you want:
[snip example]

Or you could use the -e switch to check_http to specify the string back
you expect.

# 'check_http_noauth' command definition
# This can be used against servers expecting NTLM  or other
authentication we can't supply
# A "401 Access Denied" message counts as OK
define command{
        command_name    check_http_noauth
        command_line    $USER1$/check_http -H $HOSTADDRESS$ -e "HTTP/1.1
401"
        }

You might need to amend the string to suit the server you're checking
and/or
make it general enough to use against any server.

Phil


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
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