Downtime for new Hosts

Hi all,

I use the director to automatically create new hosts imported from the Active Directory or vCenter.

But mostly the systems are not 100% ready to be monitored at that moment. So, messages from Icinga will be send to your mailbox and assigned to a colleague of mine. In many cases that colleague is not the one that is installing the system and so he is wasting time to figure out what’s the problem.

I already found the following topic…

…but I don’t see a real solution in it. Setting an infinitive downtime is probably the worst solution I can imaging, because we all humans who tend to forget things (removing the downtime in this case).

My idea was to create a database trigger (mariadb in my case) on recently added hosts in order to set a downtime. Is it enough to create the downtime it the database and trigger a redeploy afterwards?

Another idea is to configure the director database as an import source for the director. Assessing the table for logging the activities, will show me the recently created hosts. The director can then be used to add the downtime. But looping the whole process might lead to more problems.

Does anyone already have a solution for that or can help me to create the SQL trigger?

Kind Regads

Sebastian

Hey there!

I bumped this topic over to our internal icinga chat and the peeps there are having a heated discussion right now :slight_smile:

Maybe I can even motivate them to have their discussions over here in the future…

Anyway, I’ll give you a nice summary once they are done arguing :wink:

Greetings,
Feu

Hello @nexo1960!

If it’s not too hard to maintain the creation date of each Host, i.e.:

object Host "example.com" {
  vars.created_at = 1234567890
}

… you can use this one:

apply Downtime "pre-prod" to Host {
  assign where true
  start_time = host.vars.created_at
  end_time = start_time + 1h * 24 * 7
}

Best,
AK

Another approach we discussed internally was to go a completely different way of making sure not to forget about newly deployed hosts.

  • You could deploy new hosts always with notifications disabled (they would still be down without downtime so they might your Dashboards and your SLA calculation)
  • And add either a custom var vars.newly_deployed = true or deployed = timestamp
  • Use an Icinga Web 2 filter (maybe in a dashboard) to not forget about these hosts
  • When they reached production state you can remove the custom var or just the timestamp to sort them so you won’t forget about them

Hi @theFeu @twidhalm @Al2Klimov,
thanks for your replies. The solution from @Al2Klimov sounds very interesting, i only need to check if i can assign the creation date with the director.

Kind Regards
Sebastian

Hey @Al2Klimov
your idea seems to be very smart. I like the fact, that the downtime ends automatically and there is no manual process someone can forget to do. But sadly, I don’t find a possibility to add the creation date to the host object using the director (except the idea mention above to configure the director database a import source for the director).

Regards
Sebastian

1 Like

Could you please give some hints how to achieve this?

I meant just setting enable_notifications to false.

https://icinga.com/docs/icinga2/latest/doc/09-object-types/#host

You would have to redeploy when the host goes into production. AFAIK you can change to option via API but to have it persistent you’d need to change it in the configuration.

We/you could add a data type in director which provides the creation date. And we could implement this as attribute in Icinga 2.

1 Like