# Massive alarm acknoledgement

**URL:** <https://forum.inductiveautomation.com/t/massive-alarm-acknoledgement/22096>\
**Category:** Ignition\
**Created:** [January 24, 2019, 2:33pm UTC](https://forum.inductiveautomation.com/t/massive-alarm-acknoledgement/22096 "2019-01-24T14:33:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lettierf](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lettierf/32/7431_2.png) [@lettierf](https://forum.inductiveautomation.com/u/lettierf)\
**Post date:** [January 24, 2019, 2:33pm UTC](https://forum.inductiveautomation.com/t/massive-alarm-acknoledgement/22096/1 "2019-01-24T14:33:02Z")

</div>

Hi all  
I am using a function to ack all the unack alarms all at once by clicking a button. It works fine most of time but when there is a huge number of un-ack alarms it crashes. This is my code:

```auto
	alarmEvents = system.alarm.queryStatus(state=["ActiveUnacked"])
	alarmIds = [str(event.getId()) for event in alarmEvents]
	system.alarm.acknowledge(alarmIds, "acked all from script")

```

Is there a better / more efficient way to ack all alarms?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 24, 2019, 2:40pm UTC](https://forum.inductiveautomation.com/t/massive-alarm-acknoledgement/22096/2 "2019-01-24T14:40:26Z")

</div>

Wrap that in a function and run it using system.util.invokeAsynchronous().

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 24, 2019, 2:41pm UTC](https://forum.inductiveautomation.com/t/massive-alarm-acknoledgement/22096/3 "2019-01-24T14:41:37Z")

</div>

Event better would be to place it in a gateway message handler and use sendMessage() to trigger it – that way the alarms to ack don’t have to make a round trip.

---

<div class="post-metadata">

**Author:** ![lettierf](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lettierf/32/7431_2.png) [@lettierf](https://forum.inductiveautomation.com/u/lettierf)\
**Post date:** [January 24, 2019, 3:08pm UTC](https://forum.inductiveautomation.com/t/massive-alarm-acknoledgement/22096/4 "2019-01-24T15:08:28Z")

</div>

Thank you Phil  
will try
