Back to OP5 Monitor FAQ

How to set a variable notification delay

Using the HTTP API Copied

You can change the notification delay using the web services HTTP API. This would be the recommended method. Some examples are shown below.

It should be noted that these commands will only change the value for the template and thus will affect host/services added after the fact, not for any hosts/services that are already added.

Set the notification delay to 15 minutes for default host and services template:

curl -k -X PATCH -H 'content-type: application/json' -d '{"first_notification_delay": "15"}' -u 'user:password' https://monitor.host/api/config/host_template/default-host-templatecurl -k -X PATCH -H 'content-type: application/json' -d '{"first_notification_delay": "15"}' -u 'user:password' https://monitor.host/api/config/service_template/default-service

Set the notification delay back to nothing:

curl -k -X PATCH -H 'content-type: application/json' -d '{"first_notification_delay": "0"}' -u 'user:password' https://monitor.host/api/config/host_template/default-host-templatecurl -k -X PATCH -H 'content-type: application/json' -d '{"first_notification_delay": "0"}' -u 'user:password' https://monitor.host/api/config/service_template/default-service

Get a list of done changes and commit these:

curl -k -X GET -u 'user:password' https://monitor.host/api/config/changecurl -k -X POST -u 'user:password' https://monitor.host/api/config/change

Using the older OP5 API from the shell Copied

The script available here change_delay.sh can be used to set and reset the notification delay.

The script would need to be edited to set the service and host notification delay or to make them variable.

This script is called with the extend parameter or reset.

change_delay.sh extend
change_delay.sh reset

You can create a cron file in /etc/cron.d to run the attached check_delay shell script with the relevant cron time entires. For more information on cron entries, refer to “More about /etc/crontab file and /etc/cron.d/* directories” in https://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/

["Geneos"] ["FAQ"]

Was this topic helpful?