Page 1 of 1

check_http - respond Critical if the website loads?

Posted: Tue Feb 24, 2026 12:17 pm
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.

Re: check_http - respond Critical if the website loads?

Posted: Wed Feb 25, 2026 10:15 am
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.

Re: check_http - respond Critical if the website loads?

Posted: Wed Feb 25, 2026 2:09 pm
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