enable / disable an alert on a schedule?

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: enable / disable an alert on a schedule?

Post by hsmith »

I like that idea.
Former Nagios Employee.
me.
polarbear1
Posts: 73
Joined: Mon Apr 13, 2015 4:26 pm

Re: enable / disable an alert on a schedule?

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: enable / disable an alert on a schedule?

Post 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!
Former Nagios Employee
Jklre
Posts: 163
Joined: Wed May 28, 2014 1:56 pm

Re: enable / disable an alert on a schedule?

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: enable / disable an alert on a schedule?

Post by hsmith »

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.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: enable / disable an alert on a schedule?

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Jklre
Posts: 163
Joined: Wed May 28, 2014 1:56 pm

Re: enable / disable an alert on a schedule?

Post 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: enable / disable an alert on a schedule?

Post 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
Former Nagios employee
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: enable / disable an alert on a schedule?

Post 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. :)
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Jklre
Posts: 163
Joined: Wed May 28, 2014 1:56 pm

Re: enable / disable an alert on a schedule?

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