How can an event handler prevent notifications?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
bazmonkey
Posts: 2
Joined: Mon Jan 16, 2017 10:59 pm

How can an event handler prevent notifications?

Post by bazmonkey »

I am trying to write an event handler that runs on one of two services on a host. If the second of the services already has an acknowledgement, the handler will acknowledge the first service with the same comment.

However, even if the handler acknowledges the service immediately, I still get the problem notification. I'd like to prevent this. Is there a way?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: How can an event handler prevent notifications?

Post by rkennedy »

Please post your object definitions for us to review. If you have your notification_interval set to 0, then there isn't any time for it to react and suppress notifications.
Former Nagios Employee
bazmonkey
Posts: 2
Joined: Mon Jan 16, 2017 10:59 pm

Re: How can an event handler prevent notifications?

Post by bazmonkey »

notification_interval is 120... but I'm unsure if that is relevant here. That is the re-notification interval; it still generates a notification immediately upon a HARD problem state. Setting this to zero would suppress re-notifications altogether. Neither affects the initial notification trigger.

The handler sends an ack command immediately, and what we get is a problem notification and an acknowledgement notification. I'd like it if there was a way to suppress the problem notification, but my suspicion is that the problem->handler->notification process can't be stopped by the time it gets to the handler. Commands to--say--disable notifications don't take effect soon enough.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: How can an event handler prevent notifications?

Post by rkennedy »

Odd it's acting that way. We'll definetly need to see your object definitions, as well as your nagios.log from a specific day where this occured. (/usr/local/nagios/var/archives/nagios-########.log is where they're located)

This will allow us to compare everything at play. If it's triggering right away, when it's not supposed to, it could be an event handler executing.
Former Nagios Employee
Locked