URL monitor - anything but 200 send notification

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

URL monitor - anything but 200 send notification

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

Re: URL monitor - anything but 200 send notification

Post 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)
Former Nagios Employee
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: URL monitor - anything but 200 send notification

Post by jkinning »

Doh!

Thanks you can lock this up.
Locked