Page 2 of 3

Re: enable / disable an alert on a schedule?

Posted: Tue Jun 21, 2016 12:49 pm
by hsmith
I like that idea.

Re: enable / disable an alert on a schedule?

Posted: Thu Jun 23, 2016 2:28 pm
by polarbear1
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?

Posted: Thu Jun 23, 2016 3:07 pm
by rkennedy
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!

Re: enable / disable an alert on a schedule?

Posted: Mon Jun 27, 2016 11:50 am
by Jklre
hsmith wrote:I like that idea.
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.
alertsettings.jpg

Re: enable / disable an alert on a schedule?

Posted: Mon Jun 27, 2016 1:40 pm
by hsmith
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?

Posted: Mon Jun 27, 2016 1:55 pm
by eloyd
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:

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
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.

Re: enable / disable an alert on a schedule?

Posted: Mon Jun 27, 2016 2:17 pm
by Jklre
hsmith wrote:Not to ask the obvious question, but sometimes you have to.. The alerts were all coming from XI, correct? Not from NLS?
These are coming from nagios logserver via NDRP to nagios XI.

Re: enable / disable an alert on a schedule?

Posted: Mon Jun 27, 2016 4:21 pm
by tmcdonald
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

Re: enable / disable an alert on a schedule?

Posted: Mon Jun 27, 2016 4:41 pm
by eloyd
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. :)

Re: enable / disable an alert on a schedule?

Posted: Mon Jun 27, 2016 5:47 pm
by Jklre
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. :)
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.