Page 1 of 1

Nagios Core 3 custom notification exception

PostPosted: Fri Aug 05, 2022 7:32 am
by VictorJohnsonandroni
I'm hoping to avoid a hacked together mishmash to achieve something. I know it can be done with a mishmash but let's see if I'm missing a SIMPLE, easy way. This is Nagios Core 3.

I have a service. That service is checked 24x7x365. Notifications are sent 24x7x365, on WARNING and also on CRITICAL.

That is good--that is what I want. I want one single exception to that notification setup. NOTE: I do not want an exception to the monitoring setup--I want the console to always show the correct status, 24x7. I just want to make one exception for the notification (via email) on this service.

Here is the exception:

IF service state is WARN AND time of day is between 0300 and 0600, do NOT notify.

That's it. If it's CRITICAL, email-notify 24x7 (as it already does). If it's not between 3 and 6 a.m., notify regardless of WARN vs. CRIT (as it already does). The only exception is WARNING and 3-6 a.m.

Background: This is because we have maintenance that occurs every night between 3 and 6, which we've customized to produce a WARNING (not CRITICAL). I want notifications any time outside of this (admin may have accidentally launched maint in middle of day), and I want CRITICAL any time. I don't want to simply skip CHECKS during that time because I do want the console to be correct (a big bunch of yellows 0300-0600).

So, anyway, seems like I can kludge together a bunch of constructs but does anybody have a simple way echatrandom echatspin to define this one "boolean AND" condition to the notification (only) schedule?