Disable host service checks when down

Hello there!
so i want to disable the checks if a host is down. i already tried it with a dependency.

that’s what i want to disable.

that’s what i tried.

apply Dependency “disable-host-service-checks” to Service {
disable_checks = true
disable_notifications = true
ignore_soft_states = true

assign where true
states = [ Down ]
}

iam using the director and just include this config but its not working. Is it possible to use this on all my hosts in my zone too?

Hi,

shouldn’t it be
states = [ Up ]?
So when the host sate is not Up, the depency fails and disables the checks?

Kind regards

Changed it but still there

I do not see a real difference between your example (after changing to UP) and the example from Monitoring Basics - Icinga 2 what claims to do this. So I would say it works like expected!

You will get some checks executed while the host is not “hard” down as you configured “ignore_soft_states” to true so it will result in Unknown. And your screenshot does not show if the checks are executed after the host is down, this would only be shown in the detail view, when the next check execution is not executing a check but instead the last check is longer ago then the check interval.

Checks stopped now. But is it possible to stop showing the “Unknown” informations? When the host is down i know that the services dont work so why they showing me all the unknown services ?

I would leave out ignore_soft_states for that. Otherwise the checks may still be executed while the host is down (soft) but not in hard state yet. In the future there should be no more “Unknown” service checks for a host that is down.
Also i think the checks that were “Unknown” prior to the change to states = [ Up ] will stay unknown (until the host is back up again ofc).

Hey there :slight_smile:
I would like to ask you to mark an answer as the solution, if it resolves your topic.