1

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?

ceving
  • 499
  • 4
  • 24

1 Answers1

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                                 
}                                                                          
MacMartin
  • 338
  • 1
  • 4
  • 17