Page 1 of 1

HTTP OK: HTTP/1.1 303 See Other

Posted: Tue Nov 08, 2016 4:29 pm
by vy3734
./check_http -H macyds999 -p 8080
HTTP OK: HTTP/1.1 303 See Other - 482 bytes in 0.023 second response time |time=0.023210s;;;0.000000 size=482B;;;0

why status is ok when for 303?

Re: HTTP OK: HTTP/1.1 303 See Other

Posted: Tue Nov 08, 2016 4:34 pm
by rkennedy
Because it still came back with a response, it's going to be in an OK state. If you'd like to specifically only expect say a 200, you could use -e to expect 200.

Code: Select all

 -e, --expect=STRING
    Comma-delimited list of strings, at least one of them is expected in
    the first (status) line of the server response (default: HTTP/1.)
    If specified skips all other status line logic (ex: 3xx, 4xx, 5xx processing)
Are you expecting a different result? What happens if you run it with -v appended? This will be more of a verbose output.

Re: HTTP OK: HTTP/1.1 303 See Other

Posted: Tue Nov 08, 2016 4:41 pm
by avandemore
please see

Code: Select all

# ./check_http -h
for detailed information on usage and check states.

Re: HTTP OK: HTTP/1.1 303 See Other

Posted: Tue Nov 08, 2016 7:47 pm
by vy3734
i'm checking below url for redirection.

[nagios@MA100DLVMON libexec]$ ./check_http -H ma100mlvprt00 -p 8080 -u /mass
HTTP OK: HTTP/1.1 302 Moved Temporarily - 161 bytes in 0.002 second response time |time=0.001578s;;;0.000000 size=161B;;;0

302 is not good so using -f flag to check for redirect.

[nagios@MA100DLVMON libexec]$ ./check_http -H ma100mlvprt00 -p 8080 -u /mass -f follow
HTTP OK: HTTP/1.1 200 OK - 7056 bytes in 0.010 second response time |time=0.010458s;;;0.000000 size=7056B;;;0

get 200 response which is good but when looking for 200 is critical. what else can be done?
[nagios@MA100DLVMON libexec]$ ./check_http -H ma100mlvprt00 -p 8080 -u /mass -f follow -e "200"
HTTP CRITICAL - Invalid HTTP response received from host on port 8080: HTTP/1.1 302 Moved Temporarily

Re: HTTP OK: HTTP/1.1 303 See Other

Posted: Wed Nov 09, 2016 10:05 am
by avandemore
-e, --expect=STRING
Comma-delimited list of strings, at least one of them is expected in
the first (status) line of the server response (default: HTTP/1.)
If specified skips all other status line logic (ex: 3xx, 4xx, 5xx processing)
If you are trying to monitor the redirect target, why don't you setup your service to monitor the target instead of a redirect to it? Or expect a 302?

If you want both you can create a service for both and create a BPI from them or write a custom plugin which does exactly what you want.