enable / disable an alert on a schedule?
-
polarbear1
- Posts: 73
- Joined: Mon Apr 13, 2015 4:26 pm
Re: enable / disable an alert on a schedule?
I put in a feature request along these lines (TASK ID 6108) many moons ago, still waiting on that. We use NLS as a stand-alone product (no XI) so some sort of scheduling would be very useful to us.
Re: enable / disable an alert on a schedule?
I asked our developers about the time periods, and your feature request specifically @polarbear1. It is still on the roadmap - hopefully they will make their way into the next major release!
Former Nagios Employee
Re: enable / disable an alert on a schedule?
So I tried the XI settings but looks like its still alerting on weekends. Let me know where I'm going wrong with this. See the settings below.hsmith wrote:I like that idea.
You do not have the required permissions to view the files attached to this post.
Re: enable / disable an alert on a schedule?
Not to ask the obvious question, but sometimes you have to.. The alerts were all coming from XI, correct? Not from NLS?
Former Nagios Employee.
me.
me.
Re: enable / disable an alert on a schedule?
To do what I think you want to do, you need to make a passive check in XI, set up your notifications to only notify on the week days (or weekends, I can't remember now), and then tell NLS to send its alerts through Nagios XI via NRDP.
Personally, I would skip all this and have NLS send alerts to user@localhost on the NLS box, then install procmail and set up a procmail script in /home/user/.procmail that does this:
There. Now it will take the message, parse the From header, look for the day name string, and if it's Mon-Fri, send it on to [email protected]. If it's a weekend, it will just drop it into /dev/null and never be seen again.
Personally, I would skip all this and have NLS send alerts to user@localhost on the NLS box, then install procmail and set up a procmail script in /home/user/.procmail that does this:
Code: Select all
:0
* ^From [^ ]+ +\/(Sun|Mon|Tue|Wed|Thu|Fri|Sat)
{ WEEKDAY=$MATCH }
:0
* WEEKDAY ?? Mon|Tue|Wed|Thu|Fri
! [email protected]
:0E
/dev/null
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Re: enable / disable an alert on a schedule?
These are coming from nagios logserver via NDRP to nagios XI.hsmith wrote:Not to ask the obvious question, but sometimes you have to.. The alerts were all coming from XI, correct? Not from NLS?
Re: enable / disable an alert on a schedule?
I also would like to avoid the obvious, but I assume you did in fact apply the settings after saving them in XI?
Another way this could be done which avoids procmail is to simply schedule recurring downtime for the hosts/services in question:
https://www.youtube.com/watch?v=AypC2REMKLQ
Another way this could be done which avoids procmail is to simply schedule recurring downtime for the hosts/services in question:
https://www.youtube.com/watch?v=AypC2REMKLQ
Former Nagios employee
Re: enable / disable an alert on a schedule?
Yah, but the problem is that OP has to use XI simply as a mail delivery vector to determine if mail should be sent, since LS doesn't have a "quiet hours" setting. Procmail is so much more low impact than anything else. 
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Re: enable / disable an alert on a schedule?
We arn't using email is the thing. We are just sending these alerts to a check_mk dashboard. At least for the NDRP stuff. We have some other alerts going via e-mail but we try to avoid that as much as possible.eloyd wrote:Yah, but the problem is that OP has to use XI simply as a mail delivery vector to determine if mail should be sent, since LS doesn't have a "quiet hours" setting. Procmail is so much more low impact than anything else.