# Alarm Event getCount()

**URL:** <https://forum.inductiveautomation.com/t/alarm-event-getcount/14076>\
**Category:** Ignition\
**Created:** [April 18, 2017, 10:02pm UTC](https://forum.inductiveautomation.com/t/alarm-event-getcount/14076 "2017-04-18T22:02:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cgele](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cgele/32/3453_2.png) [@cgele](https://forum.inductiveautomation.com/u/cgele)\
**Post date:** [April 18, 2017, 10:02pm UTC](https://forum.inductiveautomation.com/t/alarm-event-getcount/14076/1 "2017-04-18T22:02:08Z")

</div>

Trying to use the Alarm Events in some scripts for a client. Can’t seem to find any info on how or where to use them.

Any suggestion?

Thanks

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 20, 2017, 8:26pm UTC](https://forum.inductiveautomation.com/t/alarm-event-getcount/14076/2 "2017-04-20T20:26:07Z")

</div>

I can’t tell which alarm events you’re talking about… 😕

---

<div class="post-metadata">

**Author:** ![cgele](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cgele/32/3453_2.png) [@cgele](https://forum.inductiveautomation.com/u/cgele)\
**Post date:** [April 20, 2017, 9:00pm UTC](https://forum.inductiveautomation.com/t/alarm-event-getcount/14076/3 "2017-04-20T21:00:49Z")

</div>

Sorry, it was a long day.

I’m trying to count the number of active alarms returned from the system.alarm.queryStatus function. I can display the results from the query in a table, but haven’t been able to figure out how to count them yet.

Hope this helps.

Thanks

---

<div class="post-metadata">

**Author:** ![Caleb\_Bohon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/caleb_bohon/32/3293_2.png) [@Caleb\_Bohon](https://forum.inductiveautomation.com/u/Caleb_Bohon)\
**Post date:** [April 21, 2017, 12:53am UTC](https://forum.inductiveautomation.com/t/alarm-event-getcount/14076/4 "2017-04-21T00:53:17Z")

</div>

If you are simply trying to get the number of alarms on a gateway, you could look at the system tags for alarm counts:

System/Gateway/Alarming/…  
Active and Acked  
Active and Unacked  
Clear and Acked  
Clear and Unacked

Adding the first two will give you all the active alarms on the gateway.

---

<div class="post-metadata">

**Author:** ![Paul.Scott](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul.scott/32/4578_2.png) [@Paul.Scott](https://forum.inductiveautomation.com/u/Paul.Scott)\
**Post date:** [April 21, 2017, 6:45am UTC](https://forum.inductiveautomation.com/t/alarm-event-getcount/14076/5 "2017-04-21T06:45:23Z")

</div>

> [@cgele](#):
>
> I'm trying to count the number of active alarms returned from the system.alarm.queryStatus function. I can display the results from the query in a table, but haven't been able to figure out how to count them yet.

I'm thinking the various methods on the AlarmEvent object need to be better documented. I'll make a note of this.

In the mean time, assuming a source/display path filter is easy enough to construct, if you're just looking for a count of active alarms, you could len() on the list returned by queryStatus() :

```auto
alarms = system.alarm.queryStatus(state = ["ActiveAcked", "ActiveUnacked"])

print len(alarms)

```

---

<div class="post-metadata">

**Author:** ![cgele](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cgele/32/3453_2.png) [@cgele](https://forum.inductiveautomation.com/u/cgele)\
**Post date:** [April 21, 2017, 3:45pm UTC](https://forum.inductiveautomation.com/t/alarm-event-getcount/14076/6 "2017-04-21T15:45:39Z")

</div>

Thanks for all the help!

I’ve got it working now.
