check_http - respond Critical if the website loads?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Post Reply
ewolff
Posts: 2
Joined: Mon Oct 01, 2018 10:46 am

check_http - respond Critical if the website loads?

Post by ewolff »

Basically trying to do the opposite of what check_http is used for. Respond OK if the site does not load, but respond Critical if the site responds.

So basically if I get this using check_http
connect to address x.x.x.x and port 80: Connection refused
HTTP CRITICAL - Unable to open TCP socket
I want Nagios to return with OK

I've tried messing with -d -s -e -P -T and --invert-regerx but I think the socket timeout is getting in the way.

Basically I'm looking for a failsafe alert if my ACLs for restricting access to a website get wiped out or disabled.
User avatar
lgute
Posts: 411
Joined: Mon Apr 06, 2020 2:49 pm

Re: check_http - respond Critical if the website loads?

Post by lgute »

Hi @ewolff,

Thanks for reaching out.

Have you looked at the negate plugin? It calls another plugin and inverts the value.

Using the Negate Plugin.
Please let us know if you have any other questions or concerns.

-Laura
ewolff
Posts: 2
Joined: Mon Oct 01, 2018 10:46 am

Re: check_http - respond Critical if the website loads?

Post by ewolff »

Yeah it looks like that will do what I want it to do. I'm testing it from command line and it's throwing the proper codes so I should be able to create a customer check to reference this.

Thanks
Post Reply