# Custom alarm only sending notification when event stays true for x time

**URL:** <https://community.netdata.cloud/t/custom-alarm-only-sending-notification-when-event-stays-true-for-x-time/1453>\
**Category:** Help\
**Tags:** cloud\
**Created:** [June 21, 2021, 9:04am UTC](https://community.netdata.cloud/t/custom-alarm-only-sending-notification-when-event-stays-true-for-x-time/1453 "2021-06-21T09:04:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gino\_Schreuders](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/gino_schreuders/32/827_2.png) [@Gino\_Schreuders](https://community.netdata.cloud/u/Gino_Schreuders)\
**Post date:** [June 21, 2021, 9:04am UTC](https://community.netdata.cloud/t/custom-alarm-only-sending-notification-when-event-stays-true-for-x-time/1453/1 "2021-06-21T09:04:33Z")

</div>

Dear,

I’m trying to get an alarm to send an notification only when the event stays true for 5min.  
To be more specific: I’m monitoring the temperature and usage of the CPU.  
It is not uncommon for the CPU to hit high temperatures for a pretty short time several times a day. This is fine because this doesn’t really cause any problem. If the CPU runs at a very high temperatue for a few minutes it can cause some problems tho.  
Now I’m getting alerts every time the CPU goes above 64 Celcius.  
Is there a way to make the alarm only activate when the temperature is above 64 for 5min?

> alarm: cpu\_temp  
> on: sensors.temp\_thermal\_zone0\_thermal\_thermal\_zone0  
> class: System  
> component: CPU  
> type: Utilization  
> os: linux  
> hosts: \*  
> lookup: max -1m  
> units: Celsius  
> every: 1m  
> delay: up 5m down 5m multiplier 1.5 max 1h  
> crit: $this \> (($status == $CRITICAL) ? (60) : (64))  
> info: CPU temperature monitoring.  
> to: sysadmin

---

<div class="post-metadata">

**Author:** ![ilyam8](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/ilyam8/32/134_2.png) [@ilyam8](https://community.netdata.cloud/u/ilyam8)\
**Post date:** [June 21, 2021, 9:56am UTC](https://community.netdata.cloud/t/custom-alarm-only-sending-notification-when-event-stays-true-for-x-time/1453/2 "2021-06-21T09:56:18Z")

</div>

> [@Gino\_Schreuders](#):
>
> Is there a way to make the alarm only activate when the temperature is above 64 for 5min?

Hey, try `lookup: average -5m`

---

<div class="post-metadata">

**Author:** ![Gino\_Schreuders](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/gino_schreuders/32/827_2.png) [@Gino\_Schreuders](https://community.netdata.cloud/u/Gino_Schreuders)\
**Post date:** [June 22, 2021, 7:25am UTC](https://community.netdata.cloud/t/custom-alarm-only-sending-notification-when-event-stays-true-for-x-time/1453/3 "2021-06-22T07:25:17Z")

</div>

For some reason doesn’t work
