Re-Enable Checks or Alerting Automatically

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Re-Enable Checks or Alerting Automatically

Postby mmccaugh » Wed Jun 26, 2019 5:11 pm

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

Re: Re-Enable Checks or Alerting Automatically

Postby mcapra » Thu Jun 27, 2019 2:31 pm

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
http://www.mcapra.com/
User avatar
mcapra
 
Posts: 3587
Joined: Thu May 05, 2016 3:54 pm

Re: Re-Enable Checks or Alerting Automatically

Postby jomann » Fri Jun 28, 2019 10:20 am

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.
User avatar
jomann
Development Lead
 
Posts: 596
Joined: Mon Apr 22, 2013 10:06 am
Location: Nagios Enterprises


Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 12 guests