Checks on servers that arent aive

i have a hostalive check_command in place in the hosts file.
I am using ssh keys to run nagios plugins. so ssh’ing to all servers to run checks.
I would like to “NOT” run a check on a server if the hostalive doesnt work, ie a server is flagged as down or host state is down, or invalid hostname etc…
in the ssh check ive added a line
assign where host.state == “Up”
but this dosnt work. does anyone know how to stop a check from running if the server is down ? or unreachable.

am getting

check_by_ssh: Invalid hostname/address - lvap00006123

Give as much information as you can, e.g.

  • Version used r2.9.1-1
  • Operating System and version redhat Platform version: 7.9 (Maipo)
  • Enabled features Enabled features: api checker graphite ido-mysql mainlog notification
  • Icinga Web 2 version and modules 2.6.1

config is good.

This cannot be achieved with assign rules. You need to configure additional dependency objects. With them you can disable checks with disable_checks = true.

thank you. will investigate.

if the service is attached to the host it isn’t run or at least not alerting if the host is down per default - implicit dependency.

The frequency and number of retries need to be carefully crafted or some service alerts can get through.