./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?
HTTP OK: HTTP/1.1 303 See Other
Re: HTTP OK: HTTP/1.1 303 See Other
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.
Are you expecting a different result? What happens if you run it with -v appended? This will be more of a verbose output.
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)
Former Nagios Employee
-
avandemore
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: HTTP OK: HTTP/1.1 303 See Other
please see
for detailed information on usage and check states.
Code: Select all
# ./check_http -hPrevious Nagios employee
Re: HTTP OK: HTTP/1.1 303 See Other
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
[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
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?-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 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