---
title: "How to set a variable notification delay"
description: "Setting a variable notification delay in OP5 adjusts the time before notifications are sent for hosts and services. This can be done using the HTTP API for templates or an older shell script, affecting new hosts and services added afterward."
url: "https://docs.itrsgroup.com/docs/faq/op5/360020055334-op5-monitor-how-to-set-a-variable-notification-delay/index.html"
---
## Using the HTTP API

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

The script available here [change\_delay.sh](/faq/downloads/op5/360020055334-inline-attachment-1-change_delay_1_.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/>

## Related downloads

- [change_delay_1_.sh](/faq/downloads/op5/360020055334-360030421893-change_delay_1_.sh)


