During Windows patching we have a check_period configured to ensure we don’t have any PagerDuty callouts during the maintenance window. This works fine for the services and we use the following code within our service checks:
However the host check (check_command = “ping4”) against the host will trigger an alert during this time:
PROBLEM - {hostname} is DOWN
Please can anyone advise the best method to disable this ping check during the maintenance window? I have attempted to configure a similar approach to what we do with the services but it produces an error:
critical/config: Error: Error while evaluating expression: Tried to access undefined script variable 'host'
Location: in /etc/icinga2/zones.d/master/templates.conf
I basically want to be able to disable the “ping4” against any hosts during this maintenance window. As you can see I attempted to use the same block of code as I used with the services but this fails with the error shown in my original message.
Any guidance would be greatly appreciated, thank you.
@Al2Klimov Thank you for the update. We’ve now put this in place so we’ll sit tight until our next round of Windows patching to see if this now behaves as expected.
I’ll go ahead and mark this as the solution and thanks once again for your assistance.