Page 1 of 1
Disabling Notifications & Event Handlers
Posted: Mon May 12, 2014 9:26 pm
by Fred Kroeger
I have a Test instance of Nagios that I refesh from a Prod Backup via the XI Restore script. This is all working correctly.
As I don't want any Notifications or events to be sent out, I have a script that edits the nagios.cfg file and updates the relevant entries.
These are the values in the cfg file when the script completes.
Code: Select all
enable_event_handlers=0
enable_notifications=0
I restart the nagios service ( service nagios restart ) to use the updated cfg file.
However, if I check the Nagios Monitoring Engine Status , it shows that both the Notifications & Event Handlers are Enabled (Green Dot). I actually have to manually click on each one to disable them.
Is there something else I need to update/change so that I can automate the Disable process?
Running NagiosXI 2012R2.8c
regards... Fred Kroeger
Re: Disabling Notifications & Event Handlers
Posted: Tue May 13, 2014 9:45 am
by lmiltchev
Fred, this *should* work at least it works for me.

Are you sure you don't have any other issues on the system - multiple instances of nagios running, etc. I followed the same steps, and after restarting the nagios service, I can see that notifications and event handlers are disabled globally on my test box.
Re: Disabling Notifications & Event Handlers
Posted: Sun May 18, 2014 10:16 pm
by Fred Kroeger
I'll go through the DR process again & check what is running during the import , nagios.cfg edit & restart phases.
There is another function that I need to disable that is running on the Prod instance that I need to disable on the DR instance after the import.
However I can't find an entry in the nagios.cfg file for them?
I need to Disable Outbound Transfers (or Disable NRDP output & Disable NSCA Output)
regards.... Fred
Re: Disabling Notifications & Event Handlers
Posted: Sun May 18, 2014 11:06 pm
by Fred Kroeger
Ok - went throught the import of the Prod instance to the DR Server. The config file is updated correctly, Nagios is restarted and there is only one Nagios process running.
The nagios.cfg definitely shows that enable_event_handlers & enable_notifications are set to 0 .
Other parameters that I edit - Enable Active Service Checks & Enable Active Host Checks are both set to 0 and display correctly on the Status screen.
I have attached the Monitoring Engine Status screen & it definitely shows that despite what is configured they are Enabled and email notifications are getting sent out.
The only way I can stop the notications & event handler is to click on the corresponding tick, whereupon they then go to disabled.
Note also that a restart of Nagios is not required for these to be disabled - which is why I was wondering if there is somwewhere else that these get enabled/disabled or there is a lookup to a database entry instead of the values in the cfg file?
monitor-engine-status.png
regards... Fred
Re: Disabling Notifications & Event Handlers
Posted: Sun May 18, 2014 11:15 pm
by Fred Kroeger
Another curious observation is that even though Active checks are disabled, the Scheduled events graph show that they are still being scheduled ?
Fred
monitor-engine-status-2.png
Re: Disabling Notifications & Event Handlers
Posted: Mon May 19, 2014 12:38 pm
by abrist
They may continue to be scheduled, but should not actually run. I presume this is done to maintain the check separation and timing.
Re: Disabling Notifications & Event Handlers
Posted: Thu May 29, 2014 1:38 am
by Fred Kroeger
I've upgraded to NagiosXI 2014 and am still having the same issue with not being able to disable Notification & Event Handlers.
The process I use is:
1) Import the Nagios Backup from the Prod server
2) Stop Nagios
3) Update the nagios.cfg file and set enable_event_handlers & enable_notifications to 0
4) Start Nagios
This is what is in the nagios.cfg file
Code: Select all
enable_event_handlers=0
enable_notifications=0
And this is what the Monitoring Engine Status screen shows.
screenshot019.jpg
The only way I can disable event handlers & notifications is to click on the X next to each Process Setting.
When I disable the notifications this way, the Green tick in the top right of screen chnages to a Blue i
regards.... Fred
Re: Disabling Notifications & Event Handlers
Posted: Thu May 29, 2014 12:02 pm
by scottwilkerson
Once you have clicked any of these, they will take precedsence over your nagios.cfg if you have the following in your nagios.cfg
From the
Core Documentation
This option determines whether or not Nagios will send out notifications when it initially (re)starts. If this option is disabled, Nagios will not send out notifications for any host or service.
Note: If you have state retention enabled, Nagios will ignore this setting when it (re)starts and use the last known setting for this option (as stored in the state retention file), unless you disable the use_retained_program_state option. If you want to change this option when state retention is active (and the use_retained_program_state is enabled), you'll have to use the appropriate external command or change it via the web interface.
Re: Disabling Notifications & Event Handlers
Posted: Fri May 30, 2014 1:36 am
by Fred Kroeger
Thank Scott - that makes sense now that I know what that parameter does!
I've set that value to 0 and will try the restore again.
Fred
Re: Disabling Notifications & Event Handlers
Posted: Fri May 30, 2014 10:47 am
by lmiltchev
Let us know if this worked out for you.