Page 1 of 1

Parent/Child "Recovery" Notifications

Posted: Wed Oct 10, 2018 5:02 pm
by jkeith
Hi. This may belong in NagiosCore but since I have XI....

1) What is the macro/variable name to call a host's parent host?
2) What's the best way to get Nagios to run a check (event handler? script?) before sending "RECOVERY" emails for a child and if the host's $LASTHOSTSTATE$ == "UNREACHABLE" [and it's parent's $LASTHOSTSTATE$ == "DOWN"], to skip sending the "RECOVERY" notification and retry the check again at the next check interval. otherwise, it can send the "RECOVERY" email.


Background:
I inherited a chatty Nagios system and I'm working to clean it up. I assigned parents to my hosts which took care of the unwanted "DOWN" notifications for the child hosts. However, the "RECOVERY" emails are not working as needed.

When a child host goes "UNREACHABLE" because it's parent is "DOWN", I do not need or want 25+ "RECOVERY" emails from the child hosts when the parent comes back up. I need 1 "RECOVERY" email. From the parent host. Otherwise it's confusing to the system owners.

However, disabling all the "RECOVERY" emails for the child is not a viable option. If the child goes "DOWN" on it's own, I most certainly want a "RECOVERY" alert for that.

What I can do to fix this?


Here's the requested system info:
Linux Distro CentOS 6.3
32 or 64bit? 64-bit
VMware or Manual? VMware XI Appliance
Is Gnome installed? No
Are you using a proxy? Yes
Are you using SSL? Yes
Nagios XI Version 5.5.2


Thanks for your help!
Allison

Re: Parent/Child "Recovery" Notifications

Posted: Thu Oct 11, 2018 11:02 am
by scottwilkerson
Actually there was an issue in 5.5.2 that prematurely sent recovery notifications. This was resolved in 5.5.4

Re: Parent/Child "Recovery" Notifications

Posted: Thu Oct 11, 2018 11:32 am
by lmiltchev
As far as I know, you would be still receiving recoveries (from the "UNREACHABLE" state) for the children hosts. Unfortunately, it is not possible to change the logic as there is no "parent" macro available.

Re: Parent/Child "Recovery" Notifications

Posted: Tue Oct 16, 2018 11:44 am
by jkeith
I understand that there is no built-in logic to address this issue, but there must be someway to script it, right?

Re: Parent/Child "Recovery" Notifications

Posted: Tue Oct 16, 2018 12:50 pm
by lmiltchev
Most probably, this is something that can be scripted, however it is out of scope for Nagios support.

Re: Parent/Child "Recovery" Notifications

Posted: Thu Oct 18, 2018 12:42 pm
by jkeith
Why would Event Handlers be out of scope?

Re: Parent/Child "Recovery" Notifications

Posted: Thu Oct 18, 2018 2:47 pm
by lmiltchev
I am sorry I was not clear enough. Event Handlers are not out of scope, however writing a custom event handler for users is. It is up to you to write the code and make it work. We will do our best to help you out in case you get stuck on something (have a specific question), while trying to implement it.