# Full site maintenance / downtime

**URL:** <https://community.icinga.com/t/full-site-maintenance-downtime/3006>\
**Category:** Automation & Infrastructure\
**Created:** [December 11, 2019, 3:34pm UTC](https://community.icinga.com/t/full-site-maintenance-downtime/3006 "2019-12-11T15:34:45Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![10RUPTiV](https://community.icinga.com/user_avatar/community.icinga.com/10ruptiv/32/6724_2.png) [@10RUPTiV](https://community.icinga.com/u/10RUPTiV)\
**Post date:** [December 11, 2019, 3:34pm UTC](https://community.icinga.com/t/full-site-maintenance-downtime/3006/1 "2019-12-11T15:34:45Z")

</div>

another question about downtime 😉

How do you managed in real life a full “site” maintenance ? are you doing a downtime one by one on each host ?

---

<div class="post-metadata">

**Author:** ![hamester\_citti](https://community.icinga.com/letter_avatar_proxy/v4/letter/h/ba8739/32.png) [@hamester\_citti](https://community.icinga.com/u/hamester_citti)\
**Post date:** [December 12, 2019, 6:01am UTC](https://community.icinga.com/t/full-site-maintenance-downtime/3006/2 "2019-12-12T06:01:03Z")

</div>

What do you mean with “site” maintenance?

```
### Windows PatchDay ###

apply ScheduledDowntime "windows-patch-day" to Host {
        author = "icingaadmin"
        comment = "PatchDay"

  ranges = {
    tuesday = "00:01-04:00"
    wednesday = "00:01-04:00"
    thursday = "00:01-04:00"
    friday = "00:01-04:00"
  }
    assign where host.vars.os == "windows"
	ignore where match ("*omni-esx*", host.name)
}

apply ScheduledDowntime "windows-patch-day" to Service {
        author = "icingaadmin"
        comment = "PatchDay"

  ranges = {
    tuesday = "00:01-04:00"
    wednesday = "00:01-04:00"
    thursday = "00:01-04:00"
    friday = "00:01-04:00"
  }
    assign where host.vars.os == "windows"
	ignore where match ("*omni-esx*", host.name)
}
```

---

<div class="post-metadata">

**Author:** ![rsturm](https://community.icinga.com/user_avatar/community.icinga.com/rsturm/32/1560_2.png) [@rsturm](https://community.icinga.com/u/rsturm)\
**Post date:** [December 12, 2019, 6:05am UTC](https://community.icinga.com/t/full-site-maintenance-downtime/3006/3 "2019-12-12T06:05:41Z")

</div>

for a full-site downtime, which occurs only once, I would place a scheduled downtime which triggers only one time, applied to all Hosts and services:

```auto
apply ScheduledDowntime "rip datacenter" to Host{
  autor = "bofh"
  comment = "the big shutdown"
  ranges = { "2038-01-19" = "00:00-23:59" }
  assign where host.name
}
apply ScheduledDowntime "rip datacenter" to Service {
  autor = "bofh"
  comment = "the big shutdown"
  ranges = { "2038-01-19" = "00:00-23:59" }
  assign where host.name
}

```

---

<div class="post-metadata">

**Author:** ![hamester\_citti](https://community.icinga.com/letter_avatar_proxy/v4/letter/h/ba8739/32.png) [@hamester\_citti](https://community.icinga.com/u/hamester_citti)\
**Post date:** [December 12, 2019, 6:10am UTC](https://community.icinga.com/t/full-site-maintenance-downtime/3006/4 "2019-12-12T06:10:01Z")

</div>

If you dont know the end of maintenance you can disable the notifications via icingacli

---

<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:** [December 13, 2019, 7:57am UTC](https://community.icinga.com/t/full-site-maintenance-downtime/3006/5 "2019-12-13T07:57:46Z")

</div>

I’d simple stop icinga2.service.

---

<div class="post-metadata">

**Author:** ![blakehartshorn](https://community.icinga.com/user_avatar/community.icinga.com/blakehartshorn/32/599_2.png) [@blakehartshorn](https://community.icinga.com/u/blakehartshorn)\
**Post date:** [December 13, 2019, 12:06pm UTC](https://community.icinga.com/t/full-site-maintenance-downtime/3006/6 "2019-12-13T12:06:57Z")

</div>

I use the API to quickly downtime hostgroups (hey I think I just found a feature request). Are we talking like a multi-datacenter environment where you’re working specifically on one?

If it’s a small infrastructure that you can keep your eye on, you can toggle off notifications globally until you’re done so it doesn’t blow up your email/pager, but I definitely discourage that with large infrastructure so you’re not missing anything important.

---

<div class="post-metadata">

**Author:** ![10RUPTiV](https://community.icinga.com/user_avatar/community.icinga.com/10ruptiv/32/6724_2.png) [@10RUPTiV](https://community.icinga.com/u/10RUPTiV)\
**Post date:** [December 13, 2019, 12:20pm UTC](https://community.icinga.com/t/full-site-maintenance-downtime/3006/7 "2019-12-13T12:20:43Z")

</div>

yeah we are tallking about a multi “datacenter” environment.  
We are having 11 remote “site” that we monitored, so stop icinga2 service as @rsx said, it’s not possible, and turning off notification globally it’s not also possible 😉

I think we will check to use an apply ScheduleDowntime

---

<div class="post-metadata">

**Author:** ![blakehartshorn](https://community.icinga.com/user_avatar/community.icinga.com/blakehartshorn/32/599_2.png) [@blakehartshorn](https://community.icinga.com/u/blakehartshorn)\
**Post date:** [December 13, 2019, 12:25pm UTC](https://community.icinga.com/t/full-site-maintenance-downtime/3006/8 "2019-12-13T12:25:13Z")

</div>

Something to be aware of, although loading a one time downtime object in Icinga and reloading is totally fine, if you’ve got like a scheduled weekly maintenance and think to set it on a recurring schedule in there, it can go kaboom when you have a ton of stuff.

Robert Sturm’s example is safe apart from the author typo.

---

<div class="post-metadata">

**Author:** ![anon66228339](https://community.icinga.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@anon66228339](https://community.icinga.com/u/anon66228339)\
**Post date:** [December 13, 2019, 12:48pm UTC](https://community.icinga.com/t/full-site-maintenance-downtime/3006/9 "2019-12-13T12:48:36Z")

</div>

Just some ideas i did in the past.

- a non active check on the satellite and put a dependancy for all host/services in that zone which will disable notifications. then you can manualy disable notifications for that zone by setting the service to critical.

- Use a script/webpage wich will set a (scheduled) downtime for all hosts/services in a zone via api.

- use scheduled downtimes

- remove the zone temporarily from both masters (comment it out only).

---

<div class="post-metadata">

**Author:** ![10RUPTiV](https://community.icinga.com/user_avatar/community.icinga.com/10ruptiv/32/6724_2.png) [@10RUPTiV](https://community.icinga.com/u/10RUPTiV)\
**Post date:** [December 13, 2019, 1:33pm UTC](https://community.icinga.com/t/full-site-maintenance-downtime/3006/10 "2019-12-13T13:33:59Z")

</div>

@anon66228339

I really like the idea of the non-active check… as we are having ONE satellite that we managed PER physical site, it will be a nice idea to have a passive check called “Site Maintenance” for example…

Can you elaborate a little bit more about dependancy/notification for this case ?

---

<div class="post-metadata">

**Author:** ![blakehartshorn](https://community.icinga.com/user_avatar/community.icinga.com/blakehartshorn/32/599_2.png) [@blakehartshorn](https://community.icinga.com/u/blakehartshorn)\
**Post date:** [December 13, 2019, 4:11pm UTC](https://community.icinga.com/t/full-site-maintenance-downtime/3006/11 "2019-12-13T16:11:34Z")

</div>

I haven’t played with it yet, but the details are here:  
[https://icinga.com/docs/icinga2/latest/doc/09-object-types/#dependency](https://icinga.com/docs/icinga2/latest/doc/09-object-types/#dependency)

it’s basically the same thing as when all services are downtimed when a host object goes down. I keep meaning to do this associating my vms with their host servers, but I’d need a clean way to keep track it.

---

<div class="post-metadata">

**Author:** ![anon66228339](https://community.icinga.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@anon66228339](https://community.icinga.com/u/anon66228339)\
**Post date:** [December 16, 2019, 9:26am UTC](https://community.icinga.com/t/full-site-maintenance-downtime/3006/12 "2019-12-16T09:26:53Z")

</div>

Its simple, create a virtual host in icinga per zone with ‘dummy’ as host check and then apply 2 dependancies to all hosts/services in that zone to the virtual host (lets name it “thebutton-zonename”)

```auto
apply Dependency "disablenotifications" to Service {
  parent_host_name = "thebutton-zonename"
  disable_notifications = true

  assign where host.name != "thebutton-zonename" && host.zone == "zonename"
}

apply Dependency "disablenotifications" to Host {
  parent_host_name = "thebutton-zonename"
  disable_notifications = true

  assign where host.name != "thebutton-zonename" && host.zone == "zonename"
}

```

The virtual host could look like:

```auto
object Host "thebutton-zonename" {
  import "generic-host"

  check_command = "dummy"
  interval = 0
  retry_interval = 0
  max_check_attempts = 1
  enable_active_checks = false
  enable_passive_checks = true
  enable_perfdata = false

  dummy_text = "Notifications for " + zone + " are enabled."
                                                                                                                                                                                                                   
  address = "127.0.0.1"
                                                                                                                                                                                                                   
}

```

If you now set the host manualy to down, no host/service should send a message from that zone anymore.
