# Active Alarm count by priority

**URL:** <https://forum.inductiveautomation.com/t/active-alarm-count-by-priority/91853>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [June 14, 2024, 7:19am UTC](https://forum.inductiveautomation.com/t/active-alarm-count-by-priority/91853 "2024-06-14T07:19:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![celo\_Tu](https://avatars.discourse-cdn.com/v4/letter/c/e9bcb4/32.png) [@celo\_Tu](https://forum.inductiveautomation.com/u/celo_Tu)\
**Post date:** [June 14, 2024, 7:19am UTC](https://forum.inductiveautomation.com/t/active-alarm-count-by-priority/91853/1 "2024-06-14T07:19:32Z")

</div>

How can I count the active alarm amount by tag?  
If I use the Gateway Event Scripts to count it but all the tagwrite history will be record in audit log.  
Is there any other way to count it ?

This is my code

```python
tagProvider = "default"
unackactiveTags = []
unackactiveCounts = []

Name = 'Alarm'
unackactiveCounts.append(len(system.alarm.queryStatus(state=["ActiveUnacked"], priority=["Medium"], Name = Name)))

#system.tag.writeBlocking(unackactiveTags, unackactiveCounts)
system.tag.writeBlocking("[PUB]SCADA/Alarm/ALM_COUNT_UNACKACTIVE_MAINTENANCE", unackactiveCounts)

```

---

<div class="post-metadata">

**Author:** ![Hayden\_Watson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hayden_watson/32/48792_2.png) [@Hayden\_Watson](https://forum.inductiveautomation.com/u/Hayden_Watson)\
**Post date:** [June 14, 2024, 7:26am UTC](https://forum.inductiveautomation.com/t/active-alarm-count-by-priority/91853/2 "2024-06-14T07:26:06Z")

</div>

You could set up an alarm journal, and use SQL queries to get the data you need.

To be honest I use the Ignition Exchange page:

> **[Ignition Exchange](https://inductiveautomation.com/exchange/57/overview)**
>
> Discover, share, and download community made Ignition resources in collaboration with your organization or the Ignition community.

And just modified the perspective pages to make it more like what we need with extra statistics.

---

<div class="post-metadata">

**Author:** ![celo\_Tu](https://avatars.discourse-cdn.com/v4/letter/c/e9bcb4/32.png) [@celo\_Tu](https://forum.inductiveautomation.com/u/celo_Tu)\
**Post date:** [June 14, 2024, 9:42am UTC](https://forum.inductiveautomation.com/t/active-alarm-count-by-priority/91853/3 "2024-06-14T09:42:24Z")

</div>

Thank you for your reply!

What are the script need to change?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/9/99c921214933c598dac42fa54b102842f64d3fee.png)
