Page 1 of 1
Howto - Server down = OK ?
Posted: Fri Mar 25, 2016 3:10 pm
by ThomasJohansen
Is there a way (tips or trick) to have a reverse server monitoring.
We have some servers there normally should be shutdown, and only online on request. Is there a way to have a reverse server monitoring, where OK is equal Shutdown, and CRITICAL equal Online?
Re: Howto - Server down = OK ?
Posted: Sat Mar 26, 2016 7:57 am
by rhassing
You can use negate.
The script negate negates the status of a plugin (returns OK for CRITICAL and vice-versa).
Additional switches can be used to control which state becomes what.
Re: Howto - Server down = OK ?
Posted: Sat Mar 26, 2016 3:43 pm
by ThomasJohansen
Thank you, I haven't figured out how that one works, it's a bit tricky too figure out. Need to try several settings
Any surgestion how command.cfg, and define host{ looks like when using negate?
negate location: /use/local/nagios/libexec/
lets say server is called beta007 and is FQDN on mylan.dk (beta007.mylan.dk)
Re: Howto - Server down = OK ?
Posted: Mon Mar 28, 2016 3:06 pm
by rhassing
Code: Select all
define command {
command_name negate_host_status
command_line $USER1$/negate $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
register 1
}
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Re: Howto - Server down = OK ?
Posted: Tue Mar 29, 2016 7:00 pm
by ThomasJohansen
rhassing that did the trick... Thank you very much.

Re: Howto - Server down = OK ?
Posted: Wed Mar 30, 2016 8:52 am
by ThomasJohansen
I'm trying to work with negate, and the alerts now working. but is it possible to change the Status text to be correct. in my case it say up when it is down and equal OK, but what I would like to is
text 'Down' equal OK (green)
text 'UP' equal CRITICAL (red)
Re: Howto - Server down = OK ?
Posted: Wed Mar 30, 2016 10:53 am
by rhassing