diff --git a/etc/icinga2/conf.d/downtimes.conf b/etc/icinga2/conf.d/downtimes.conf index ed1e1e0ed..0bed6475f 100644 --- a/etc/icinga2/conf.d/downtimes.conf +++ b/etc/icinga2/conf.d/downtimes.conf @@ -3,7 +3,18 @@ */ apply ScheduledDowntime "backup-downtime" to Service { - import "backup-downtime" + author = "icingaadmin" + comment = "Scheduled downtime for backup" - assign where host.name == "localhost" && service.name == "load" + ranges = { + monday = service.vars.backup_downtime + tuesday = service.vars.backup_downtime + wednesday = service.vars.backup_downtime + thursday = service.vars.backup_downtime + friday = service.vars.backup_downtime + saturday = service.vars.backup_downtime + sunday = service.vars.backup_downtime + } + + assign where service.vars.backup_downtime != "" } diff --git a/etc/icinga2/conf.d/hosts/localhost/load.conf b/etc/icinga2/conf.d/hosts/localhost/load.conf index 64f38f285..0919678bd 100644 --- a/etc/icinga2/conf.d/hosts/localhost/load.conf +++ b/etc/icinga2/conf.d/hosts/localhost/load.conf @@ -9,4 +9,6 @@ object Service "load" { host_name = "localhost" check_command = "load" vars.sla = "24x7" + + vars.backup_downtime = "02:00-03:00" } diff --git a/etc/icinga2/conf.d/templates.conf b/etc/icinga2/conf.d/templates.conf index f98b4eb63..a3607f476 100644 --- a/etc/icinga2/conf.d/templates.conf +++ b/etc/icinga2/conf.d/templates.conf @@ -70,21 +70,3 @@ template Notification "mail-service-notification" { period = "24x7" } -/** - * Provides default settings for recurring backup downtime - */ - -template ScheduledDowntime "backup-downtime" { - author = "icingaadmin" - comment = "Scheduled downtime for backup" - - ranges = { - monday = "02:00-03:00" - tuesday = "02:00-03:00" - wednesday = "02:00-03:00" - thursday = "02:00-03:00" - friday = "02:00-03:00" - saturday = "02:00-03:00" - sunday = "02:00-03:00" - } -}