# Change color of states according to disconnection time

**URL:** <https://community.icinga.com/t/change-color-of-states-according-to-disconnection-time/8425>\
**Category:** Icinga 2\
**Tags:** icingaweb2, icinga2\
**Created:** [October 13, 2021, 2:01pm UTC](https://community.icinga.com/t/change-color-of-states-according-to-disconnection-time/8425 "2021-10-13T14:01:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maurox521](https://community.icinga.com/user_avatar/community.icinga.com/maurox521/32/4313_2.png) [@maurox521](https://community.icinga.com/u/maurox521)\
**Post date:** [October 13, 2021, 2:01pm UTC](https://community.icinga.com/t/change-color-of-states-according-to-disconnection-time/8425/1 "2021-10-13T14:01:44Z")

</div>

Hello, I would like to change the color of the states (red and green) for other colors depending on the disconnection time that each host has had. I understand that the color is changed in the .less file, but I don’t know how to do that, for example when a host spends more than 30 minutes without connection has its status in yellow and when more than 1 hour has passed its status in red. I have configured the ckeck\_interval = 10 minutes, max\_check\_attemps = 3, and the retry interval = 1 minute.  
Does anyone know how to do this? Greetings

---

<div class="post-metadata">

**Author:** ![theFeu](https://community.icinga.com/user_avatar/community.icinga.com/thefeu/32/7277_2.png) [@theFeu](https://community.icinga.com/u/theFeu)\
**Post date:** [October 14, 2021, 8:51am UTC](https://community.icinga.com/t/change-color-of-states-according-to-disconnection-time/8425/2 "2021-10-14T08:51:45Z")

</div>

I moved your question out of the category tutorials and guides, as it hardly seems like one 😉

I do not think that you could/should change your state colours with the CSS (as it is only visual) and instead think more in the direction of having a check for them that goes CRITICAL when they are down.

---

<div class="post-metadata">

**Author:** ![maurox521](https://community.icinga.com/user_avatar/community.icinga.com/maurox521/32/4313_2.png) [@maurox521](https://community.icinga.com/u/maurox521)\
**Post date:** [October 14, 2021, 12:51pm UTC](https://community.icinga.com/t/change-color-of-states-according-to-disconnection-time/8425/3 "2021-10-14T12:51:29Z")

</div>

I understand the issue of verification but how could I call or implement the css code in the icinga configuration file (hosts.conf) to change the color after doing the verification?  
I insist with the change of colors because it is something that I must comply with and I cannot think of another way to do it.
