What if...
one of my Nagios users disables the notifications on one (or a few) service checks, and forgets to re-enable those notifications? Is there a command that I can run from a script to re-enable all host and service check notifications? Note that I am not talking about the global enable/disable notifications setting. I already know how to do that. I'm asking about a way to re-enable every individual host/svc check in a single command. I would like to run a script that runs this command every night (or maybe every other night) in cron, so our On-Call person actually receives notifications that something is wrong.
My Nagios Users Are Forgetful
Re: My Nagios Users Are Forgetful
The workflow I'd use:
- Parse status.dat to find all host/service objects with disabled notifications, or use the JSON CGIs to get that info in a slightly prettier format (yay JSON).
- Run ENABLE_HOST_NOTIFICATIONS / ENABLE_SVC_NOTIFICATIONS for each object
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: My Nagios Users Are Forgetful
Thanks for the assist, @mcapra! That's essentially what I would suggest, although we do not have a ready-made script to do specifically that.
Former Nagios employee
-
- Posts: 23
- Joined: Fri Nov 19, 2010 1:31 pm
Re: My Nagios Users Are Forgetful
While I was waiting on a reply, I was "googling" for anyone else who had done this, and came across this URL: https://exchange.nagios.org/directory/A ... er/details It is a bash file that uses awk to parse status.dat and list any disabled host or service notifications. I tweaked that a bit and added code to re-enable each disabled notification. That's working now.
I think I like the grep idea better than using awk. I'll dig into that and see if it results in a neater script.
I think I like the grep idea better than using awk. I'll dig into that and see if it results in a neater script.
-
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: My Nagios Users Are Forgetful
@Master_Chief_Jon, Sounds good. Thanks for sharing your solution with us!
Do you have any other questions for us so far?
Do you have any other questions for us so far?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
- Posts: 23
- Joined: Fri Nov 19, 2010 1:31 pm
Re: My Nagios Users Are Forgetful
OK, I used the grep method to gather a list of host and service checks that have their notifications disabled. Then parsed that list to run the external command to re-enable each disabled host and service check. I'm good now. Thanks for your help.
Re: My Nagios Users Are Forgetful
Glad to hear it! I'll be closing this up now, but feel free to open another thread if you need anything in the future!
Former Nagios employee