Created
July 20, 2018 10:09
-
-
Save ep4sh/ed260bb903d9e8c472a20afb9882b09e to your computer and use it in GitHub Desktop.
Icinga2 downtimes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply ScheduledDowntime "backup-downtime" to Service { | |
author = "icingaadmin" | |
comment = "Scheduled downtime for backup" | |
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 != "" | |
} | |
apply Service for (disk => config in host.vars.disks) { | |
import "generic-service" | |
/* Used by the ScheduledDowntime apply rule in `downtimes.conf`. */ | |
vars.backup_downtime = "03:00-04:30" | |
check_command = "by_ssh_disk" | |
vars += config | |
assign where host.vars.os == "Linux" | |
ignore where host.name == NodeName | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment