# Checks on servers that arent aive

**URL:** <https://community.icinga.com/t/checks-on-servers-that-arent-aive/12469>\
**Category:** Icinga 2\
**Created:** [August 21, 2023, 12:00pm UTC](https://community.icinga.com/t/checks-on-servers-that-arent-aive/12469 "2023-08-21T12:00:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattgrwillis](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/ebca7d/32.png) [@mattgrwillis](https://community.icinga.com/u/mattgrwillis)\
**Post date:** [August 21, 2023, 12:00pm UTC](https://community.icinga.com/t/checks-on-servers-that-arent-aive/12469/1 "2023-08-21T12:00:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rsx](https://community.icinga.com/user_avatar/community.icinga.com/rsx/32/2094_2.png) [@rsx](https://community.icinga.com/u/rsx)\
**Post date:** [August 21, 2023, 12:40pm UTC](https://community.icinga.com/t/checks-on-servers-that-arent-aive/12469/2 "2023-08-21T12:40:34Z")

</div>

This cannot be achieved with assign rules. You need to configure additional [dependency](https://icinga.com/docs/icinga-2/latest/doc/09-object-types/#dependency) objects. With them you can disable checks with `disable_checks = true`.

---

<div class="post-metadata">

**Author:** ![mattgrwillis](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/ebca7d/32.png) [@mattgrwillis](https://community.icinga.com/u/mattgrwillis)\
**Post date:** [August 21, 2023, 12:50pm UTC](https://community.icinga.com/t/checks-on-servers-that-arent-aive/12469/3 "2023-08-21T12:50:15Z")

</div>

thank you. will investigate.

---

<div class="post-metadata">

**Author:** ![rivad](https://community.icinga.com/user_avatar/community.icinga.com/rivad/32/5852_2.png) [@rivad](https://community.icinga.com/u/rivad)\
**Post date:** [August 22, 2023, 9:15am UTC](https://community.icinga.com/t/checks-on-servers-that-arent-aive/12469/4 "2023-08-22T09:15:48Z")

</div>

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.
