Page 1 of 1

URL monitor - anything but 200 send notification

Posted: Wed Feb 01, 2017 12:24 pm
by jkinning
I have a website I am monitoring using the check_http -H <host> -f ok -u "/" -S -p 443 check.

Is there a way to make Nagios send a notification for anything other than a 200 OK return code? I had this site show in a warning state when the return code was 403. I would like a notification to be sent out for this and anything else except a 200.

Re: URL monitor - anything but 200 send notification

Posted: Wed Feb 01, 2017 12:32 pm
by rkennedy
The easy answer is -e 200
-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)

Re: URL monitor - anything but 200 send notification

Posted: Wed Feb 01, 2017 1:47 pm
by jkinning
Doh!

Thanks you can lock this up.