check_http confusion / problem
Jon Angliss
jon at netdork.net
Sat Aug 29 01:18:35 CEST 2009
On Fri, 28 Aug 2009 14:01:44 -0500, "David Dyer-Bennet"
<dd-b at dd-b.net> wrote:
>Thanks to various list members for pointing me at various bits of
>documentation that I hadn't been able to find, which explain that commands
>can in fact take arguments, and that those and other useful things are
>called "macros". (I've been using macros since 1401 Autocoder, and mostly
>think of them as compile time code-generating tools.)
>
>So, what's with the check_http plugin? The parameters it accepts don't
>match the parameters its help says it accepts. But beyond that, the -e
>switch doesn't seem to do what it says it should.
>
>I'm not getting invalid results because I'm running from the command line,
>am I? This seems much the easiest way to test things, and it rather
>sounds like this is an intended use. But thought I'd ask just to be sure.
>
>In this case, the expected result of the test is a 400 Bad Request error
>(because I'm hitting a web services port and requesting root; this test is
>intended to do a minimal check and see that the service director is up,
>but not test the individual services yet). So the "400 Bad Request"
>response is correct and valid.
>
>Now, the -e switch seems to be intended to check just this status line,
>and to nicely short-circuit later processing, and seems in all ways
>optimized for exactly what I'm doing. Except for the minor fact that it
>doesn't seem to work. See below, run in verbose mode. I've tried a bunch
>of variants on the value I pass to -e, including the whole line given, and
>they all give the same result, an exit code of 2 and the "invalid HTTP
>response code" message. So what's up? And is there more documentation
>on the plugins hidden somewhere, particularly this one?
--help usually gives a whole bunch of extra information...
>[ddb at prcapp00 dev]$ /usr/lib/nagios/plugins/check_http
>--IP-address=192.168.5.3 -p 8075 --no-body -f critical -v -v -v -e="Bad
>Request"
>GET / HTTP/1.0
>User-Agent: check_http/1.99 (nagios-plugins 1.4.6)
>
>
>http://192.168.5.3:8075/ is 168 characters
>STATUS: HTTP/1.1 400 Bad Request
>**** HEADER ****
>Content-Type: text/html
>Date: Fri, 28 Aug 2009 18:33:44 GMT
>Connection: close
>Content-Length: 39
>**** CONTENT ****
> [[ skipped ]]
>Invalid HTTP response received from host on port 8075
>[ddb at prcapp00 dev]$ echo $?
>2
Command syntax is incorrect.
# ./check_http -I 192.168.5.3 -p 8075 --no-body -f critical -vvv -e \
"Bad Request"
I tried against one of my servers without any issues. Albeit I got a
critical failure because my server didn't return bad request.
I do notice you're using an old version of the plugins package. 1.4.13
is the current version, can you download and compile in a different
directory and see if you still end upw with the same issue?
--
Jonathan Angliss
<jon at netdork.net>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
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