When I set a scheduled down time in Icinga, the program continues to perform checks on the remote system. How can I define a scheduled downtime in which the checks are disabled?
Asked
Active
Viewed 924 times
1
-
You can select host/service from icinga web console and stop checks against the scheduled downtime. There is provision for this. You need to explore the console carefully. – Shailesh Sutar Aug 02 '17 at 11:50
-
I tried it and Icinga did not stop the checks. – ceving Aug 02 '17 at 12:27
-
@ceving was your question answered, or is there anything unclear? – MacMartin Dec 09 '19 at 10:03
1 Answers
0
This should be possible with:
1.Create the downtimer specification in ./conf.d/downtimes.conf like:
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 != ""
}
2.refer to this configuration in your service definition, like:
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
}
![](../../users/profiles/290859.webp)
MacMartin
- 338
- 1
- 4
- 17