If you're performing maintenance on a host and need to pause the alerts for a device / service temporarily, you can use the prepared script below. This will disable all alerts, and move the device / service out of the group it may be in otherwise group alerts will be disabled, affecting other servers / web checks not going down for maintenance.
Disable Example:./toggleSubjectAlerts.py -s 520dee51cbda5de279000013 -t device -a b97da80a41c4f61bff05975ee51eb1aa -e False
The above will pause alerts for subject ID 520dee51cbda5de279000013, using token b97da80a41c4f61bff05975ee51eb1aa
Enable Example:
Then to re-enable ensure you pass a group name if applicable:./toggleSubjectAlerts.py -s 520dee51cbda5de279000013 -t device -a b97da80a41c4f61bff05975ee51eb1aa -e True -g Apache
Which will re-enable alerts for subject ID 520dee51cbda5de279000013 and move the device back into the Apache group to re-enable the group alerts.
You could, for example, have this running as a cron job if you run weekly backups between 4-6AM and wish to suppress alerts during those times.
Script:
The script is available at our API documentation
Comments