Re-Enable Checks or Alerting Automatically

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.
Locked
mmccaugh
Posts: 8
Joined: Fri Sep 28, 2018 11:49 am

Re-Enable Checks or Alerting Automatically

Post by mmccaugh »

OK if this has been asked before I apologize, I have to believe it has been but I cannot seem to find it.

But is there a way to automate a period after which host checks, or notifications will automatically be re-enabled? The issue I am trying to solve is notifications get silenced due to work, or an outage but then they are simply forgotten and left disabled.. Or invalid service checks are defined, and rather than raise this so the checks themselves can be corrected they are just turned off.

I am looking at how I can make this impossible, by defining a period after which any disabled alert will be re-enabled.. Note I believe I could do this with a cron job and some creativity, but what I want would be a rolling window.. Say after 48 hours re-enable, not "At 4am sunday re-enable everything disabled"

I want people to be able to disable alerts for maintenance, but not just forget about them and never re-enable..
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Re-Enable Checks or Alerting Automatically

Post by mcapra »

mmccaugh wrote:The issue I am trying to solve is notifications get silenced due to work, or an outage but then they are simply forgotten and left disabled
It's better to put the particular problem into a downtime state if you want to temporarily silence notifications, IMO.
downtime.PNG
mmccaugh wrote:Say after 48 hours re-enable, not "At 4am sunday re-enable everything disabled"
I think you'd need a Cron job and some custom scripting for this.

Nagios Core has an external commands file that acts as an "API" of sorts, allowing you to execute Nagios commands available on the GUI (like notification enable/disable) via the command line. Here's a list of the available commands:
https://assets.nagios.com/downloads/nag ... ernalcmds/

In terms of assessing a particular object's state, the JSON CGIs are pretty accessible -- these should already be installed with a modern Nagios Core installation. The notifications_enabled flag is what you're looking for when determining whether or not a particular host/service object has had notifications enabled/disabled. =1 is enabled I believe.

I can't think of a reliable way to check the "time when notifications were disabled" bit off the top of my head.
Former Nagios employee
https://www.mcapra.com/
jomann
Development Lead
Posts: 611
Joined: Mon Apr 22, 2013 10:06 am
Location: Nagios Enterprises

Re: Re-Enable Checks or Alerting Automatically

Post by jomann »

mcapra is correct in the ways to do this, I am also not sure of a way to check when the notifications were disabled, but you could certainly record when they were disabled via the script somewhere that could then be read later for enabling.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked