Host Down - Mark Services Unknown??

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
delboy1966
Posts: 98
Joined: Thu Oct 22, 2015 5:26 am

Host Down - Mark Services Unknown??

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Host Down - Mark Services Unknown??

Post 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
Former Nagios employee
delboy1966
Posts: 98
Joined: Thu Oct 22, 2015 5:26 am

Re: Host Down - Mark Services Unknown??

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Host Down - Mark Services Unknown??

Post 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.
Former Nagios employee
delboy1966
Posts: 98
Joined: Thu Oct 22, 2015 5:26 am

Re: Host Down - Mark Services Unknown??

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Host Down - Mark Services Unknown??

Post 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?
Former Nagios employee
delboy1966
Posts: 98
Joined: Thu Oct 22, 2015 5:26 am

Re: Host Down - Mark Services Unknown??

Post by delboy1966 »

Yep go for it.

Cheers
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Host Down - Mark Services Unknown??

Post by dwhitfield »

Locked