Page 1 of 1
Host Down - Mark Services Unknown??
Posted: Tue Sep 13, 2016 11:11 am
by delboy1966
Nagios is doing as it should be host/service relationships.
In that if a host is down it stops doing service checks until the host is up and we only get host notifications.
However upper management have noticed that if a host is down all the services are still OK and say it gives a false impression.
I have explained why this is so but to no avail.
What they want is for any services on a host that is down to go into an unknown state until the host comes back up and the services are checked.
Because we don't receive notifications for unknown state we wouldn't get flooded with emails.
I have a few ideas on how to do this but wondered if someone had done it before or if there was a simply way of doing this.
So I turn to this forum again.
Thanks in advance
Tony
Re: Host Down - Mark Services Unknown??
Posted: Tue Sep 13, 2016 3:47 pm
by tmcdonald
Sounds like you need the somewhat-obscure service parents feature:
https://assets.nagios.com/downloads/nag ... ml#service
This directive is used to define a comma-delimited list of short names of the "parent" services for this particular service. Parent services are typically other services that need to be available in order for a check of this service to occur. For example, if a service checks the status of a disk using SSH, the disk check service would have the SSH service as a parent. If the service has no parent services, simply omit the "parents" directive. More complex service dependencies may be specified with service dependency objects.
A general overview of parents can be found here:
https://assets.nagios.com/downloads/nag ... ility.html
Re: Host Down - Mark Services Unknown??
Posted: Thu Sep 15, 2016 5:07 am
by delboy1966
I looked at these options but I didn't see that it would mark services for a host that has gone Critical as UNKNOWN.
I was wondering if anyone else had done anything like what I wanted before I implemented my own solution.
I currently log all hosts hard state changes, so could mark all services as unknown by injected the command into Nagios if the host is down.
Tony
Re: Host Down - Mark Services Unknown??
Posted: Thu Sep 15, 2016 2:58 pm
by tmcdonald
So, did some digging and testing. Apparently the service parents and the host parents work differently. Hosts that have a down parent will be marked as Unreachable, but it looks like services with a parent will just not be checked. I'm going to file a request that they be set to Unknown, since I actually wrote the host_down_disable_service_checks functionality to do exactly what the current service parents do.
Unfortunately this means that at this time there is not a supported built-in way to do what you are looking for. Code modification and recompilation would need to be done.
Re: Host Down - Mark Services Unknown??
Posted: Fri Sep 16, 2016 9:43 am
by delboy1966
Thanks for replying and explaining.
I didn't think there would be an in built way.
I will proceed with my initial idea.
Thanks
Tony
Re: Host Down - Mark Services Unknown??
Posted: Fri Sep 16, 2016 9:56 am
by tmcdonald
Yea, sorry. I thought it would work that way but after speaking with the developer it was decided to go another route and just not check them. Still will be filing that request though.
On that note, mind if I close this up?
Re: Host Down - Mark Services Unknown??
Posted: Tue Sep 20, 2016 2:08 am
by delboy1966
Yep go for it.
Cheers
Re: Host Down - Mark Services Unknown??
Posted: Tue Oct 04, 2016 10:37 am
by dwhitfield