HTTP OK: HTTP/1.1 303 See Other

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
vy3734
Posts: 109
Joined: Tue Sep 29, 2015 4:48 pm

HTTP OK: HTTP/1.1 303 See Other

Post 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?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: HTTP OK: HTTP/1.1 303 See Other

Post 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.
Former Nagios Employee
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: HTTP OK: HTTP/1.1 303 See Other

Post by avandemore »

please see

Code: Select all

# ./check_http -h
for detailed information on usage and check states.
Previous Nagios employee
vy3734
Posts: 109
Joined: Tue Sep 29, 2015 4:48 pm

Re: HTTP OK: HTTP/1.1 303 See Other

Post 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
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: HTTP OK: HTTP/1.1 303 See Other

Post 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.
Previous Nagios employee
Locked