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?
Howto - Server down = OK ?
Re: Howto - Server down = OK ?
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.
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.
Rob Hassing


-
ThomasJohansen
- Posts: 13
- Joined: Wed Dec 30, 2015 6:47 am
Re: Howto - Server down = OK ?
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)
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 ?
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
}Rob Hassing


-
ThomasJohansen
- Posts: 13
- Joined: Wed Dec 30, 2015 6:47 am
Re: Howto - Server down = OK ?
rhassing that did the trick... Thank you very much. 
-
ThomasJohansen
- Posts: 13
- Joined: Wed Dec 30, 2015 6:47 am
Re: Howto - Server down = OK ?
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)
text 'Down' equal OK (green)
text 'UP' equal CRITICAL (red)
Re: Howto - Server down = OK ?
There are some examples on: https://xteams.oit.ncsu.edu/iso/node/831
Rob Hassing

