NagiosEnterprises / nagioscore

Nagios Core
GNU General Public License v2.0
1.53k stars 445 forks source link

notification after service return from unknown to OK #603

Open PetrMa opened 5 years ago

PetrMa commented 5 years ago

Hello, we´re running on Nagios Core 4.4.2 and our generic-service template is set to sent notifications only for Warning, Critical and Recovery states. Not for Unknown. But the Nagios sends notification every time when the service returns from Unknown state to Recovery and the admins receives notification about OK states but they don´t know anything about the previous Unknown state. We disabled the Uknown state notifications because some SNMP checks get Unknown state some times. How can I disable the notification when the service return from U to R? I can´t to find any relevant settings in Nagios Core.

Thanks, Petr

ericloyd commented 5 years ago

Great question. You're seeing what you asked for, but not what you want. I'd be curious to see a solution to this, for the same reason you would. If one didn't get the U, they shouldn't get the R.

jomann09 commented 5 years ago

You're right, this is a bit odd. I will look into it and see if there is something we can do about it. From the way I think the logic works, we should be able to find out the last state and see if the last state is one of the allowed notification options before we send a recovery. However, since this would fundamentally change how Core works, we may need to add an option to enable/disable this.

I will have to get some other people's opinions on this to see what the consensus is.

dennison-williams-stjames commented 2 years ago

I think this would still be a useful feature, I don't think there should be an UP notification after Unknown if Unknown is not in the notification options list. I confirmed that nagios-core 4.3.4 still performs this way.

agibson2 commented 4 months ago

Any know if this might still be implemented? Some contacts don't get unknowns. If we don't notify on UNKNOWN state then not bothering those contacts with recoveries would be ideal. They wouldn't know what the alert was recovering from.

agibson2 commented 4 months ago

I just set it up so that UNKNOWNS are not to be sent for a contact and I did not receive the recovery OK (which is good). It sounds like this was implemented. I am not sure if that is true or I am overlooking something with my quick test. I will keep monitoring the behavior and set more contacts up like this.