Scheduled job to enable all notifications
Scheduled job to enable all notifications
I would like to provide more of our Nagios XI users access to acknowledge alerts, but with that access comes the ability to disable notifications. Rather than implement a custom Javascript to remove that option entirely, I'd like to allow them to use that feature for short-term use with the understanding that all notifications will be enabled again at a specified time each night. What would be the best way to schedule a job to enable all disabled notifications for every host and service every night? Thanks!
Last edited by gmackey on Fri Sep 13, 2019 10:17 am, edited 1 time in total.
=================================================
Nagios XI 5.6.5 Enterprise
CentOS 6.10 (64-bit) VMware image
SSL implemented and forced, with exception for localhost
Nagios XI 5.6.5 Enterprise
CentOS 6.10 (64-bit) VMware image
SSL implemented and forced, with exception for localhost
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Scheduled job to enable all notifications
Hell @gmackey,
This could be accomplished by using the Nagios Core external commands. You would need to schedule these as a cron job running every night at a specified time.
Example: Disable Notifications
Example: Enable Notifications
This could be accomplished by using the Nagios Core external commands. You would need to schedule these as a cron job running every night at a specified time.
Example: Disable Notifications
Code: Select all
#!/bin/sh
# This is a sample shell script showing how you can submit the DISABLE_NOTIFICATIONS command
# to Nagios. Adjust variables to fit your environment as necessary.
now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'
/bin/printf "[%lu] DISABLE_NOTIFICATIONS\n" $now > $commandfile
Code: Select all
#!/bin/sh
# This is a sample shell script showing how you can submit the ENABLE_NOTIFICATIONS command
# to Nagios. Adjust variables to fit your environment as necessary.
now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'
/bin/printf "[%lu] ENABLE_NOTIFICATIONS\n" $now > $commandfile
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Scheduled job to enable all notifications
Thank you, Benjamin! I will set this up when I get a chance to work on it. Please feel free to lock the thread.
=================================================
Nagios XI 5.6.5 Enterprise
CentOS 6.10 (64-bit) VMware image
SSL implemented and forced, with exception for localhost
Nagios XI 5.6.5 Enterprise
CentOS 6.10 (64-bit) VMware image
SSL implemented and forced, with exception for localhost
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Scheduled job to enable all notifications
Great!gmackey wrote:Thank you, Benjamin! I will set this up when I get a chance to work on it. Please feel free to lock the thread.
Locking