# Detecting active alarms via DB

**URL:** <https://forum.inductiveautomation.com/t/detecting-active-alarms-via-db/7649>\
**Category:** Ignition\
**Created:** [December 2, 2013, 1:56pm UTC](https://forum.inductiveautomation.com/t/detecting-active-alarms-via-db/7649 "2013-12-02T13:56:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marioquark](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@marioquark](https://forum.inductiveautomation.com/u/marioquark)\
**Post date:** [December 2, 2013, 1:56pm UTC](https://forum.inductiveautomation.com/t/detecting-active-alarms-via-db/7649/1 "2013-12-02T13:56:10Z")

</div>

I’m trying to detect the active alarms looking in the DB.

I have the Alarm Status component showing 3 alarms.

In the DB i have joined the alarm\_events and alarm\_event\_data tables, so i have these columns:

```auto
id,eventid,source,displaypath,priority,eventtype,eventflags,eventtime,id,propname,dtype,intvalue,floatvalue,strvalue
```

Querying this table and filtering the active ones i get many alarms, not only the 3 ones…  
I managed to have the activated and then cleared ones filtered, but i still have more than 3 alarms.  
What’s the way to do this?  
Thank you!

---

<div class="post-metadata">

**Author:** ![marioquark](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@marioquark](https://forum.inductiveautomation.com/u/marioquark)\
**Post date:** [December 3, 2013, 2:34pm UTC](https://forum.inductiveautomation.com/t/detecting-active-alarms-via-db/7649/2 "2013-12-03T14:34:57Z")

</div>

still seems a die hard design issue ![8)](https://us1.discourse-cdn.com/inductiveautomation/original/1X/587d7fe0d6822f36e81815ab06aa7164e9d2e057.gif "Cool")

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [December 27, 2013, 9:50pm UTC](https://forum.inductiveautomation.com/t/detecting-active-alarms-via-db/7649/3 "2013-12-27T21:50:44Z")

</div>

The alarm tables in the database are historical events (active, clear, ack, etc…) and not meant to keep track of current status. It’s much easier to use the system.alarm.queryStatus() function to get the details you want. More info about this function in the [user manual](http://www.inductiveautomation.com/support/usermanuals/ignition/system_alarm_querystatus.htm).
