# V8 What is the most efficient way to extract a complete list of configured alarms?

**URL:** <https://forum.inductiveautomation.com/t/v8-what-is-the-most-efficient-way-to-extract-a-complete-list-of-configured-alarms/48071>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [June 22, 2021, 5:06pm UTC](https://forum.inductiveautomation.com/t/v8-what-is-the-most-efficient-way-to-extract-a-complete-list-of-configured-alarms/48071 "2021-06-22T17:06:18Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 22, 2021, 5:06pm UTC](https://forum.inductiveautomation.com/t/v8-what-is-the-most-efficient-way-to-extract-a-complete-list-of-configured-alarms/48071/1 "2021-06-22T17:06:18Z")

</div>

v8.1.5

Now that `system.tag.getAlarmStates` is gone, what is the most efficient way to get a complete list of alarms for a large number of tags (350k)?

My estimates using a combination of `system.tag.browse`, `system.tag.getConfiguration`, and `system.tag.readBlocking` puts it at ~9hrs of runtime. But I don't know if I have any other option ☹

> [@system.tag.getAlarmStates alternative?](http://forum.inductiveautomation.com/t/system-tag-getalarmstates-alternative/27803/10):
>
> Old post, but still relevant issue… the issue here is that getConfiguration returns only non-default property values of tags, nothing more. For example, if you leave the alarm Priority at the default of Low, then this configuration will not show if you run getConfiguration. Therefore you need to use getConfiguration to get the name of the alarm, then you can use readBlocking to read the properties of the alarms you need. The only way that I can see being able to use getConfiguration to help wit…

> [@Get the list of all the tag with alarms Configured](http://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/5):
>
> Unfortunately, this script isn’t easily converted to v8 frowning The function system.tag.getAlarmStates was deprecated. I assume that we now need to use system.tag.getConfiguration, however this only returns non-default values… so if the priority for example is set to Low, then you won’t be able to read this. I guess you could assume it’s Low if the key isn’t in the dictionary? This would require knowing the defaults of all properties though, assuming you wanted to bring back other property v…

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [June 22, 2021, 6:28pm UTC](https://forum.inductiveautomation.com/t/v8-what-is-the-most-efficient-way-to-extract-a-complete-list-of-configured-alarms/48071/2 "2021-06-22T18:28:05Z")

</div>

I suppose you execute your code in the gateway scope, not in the vision client scope ?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 22, 2021, 6:33pm UTC](https://forum.inductiveautomation.com/t/v8-what-is-the-most-efficient-way-to-extract-a-complete-list-of-configured-alarms/48071/3 "2021-06-22T18:33:18Z")

</div>

You’re right, I need to run it on the gateway instead. I’ll try it later on today and check the performance then. Cheers!

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [May 20, 2022, 7:55pm UTC](https://forum.inductiveautomation.com/t/v8-what-is-the-most-efficient-way-to-extract-a-complete-list-of-configured-alarms/48071/4 "2022-05-20T19:55:35Z")

</div>

I’ve found a way that worked for me. Alarm evaluation must be disabled for those tags that do not have alarms (which could be feasible to do for a large amount of tags if UDTs have been used).

```auto
tags = system.tag.browse("[default]SCP", {"recursive":True}).getResults()
 
for tag in tags:

    stringPath = str(tag['fullPath'])
    if system.tag.readBlocking(stringPath+".AlarmEvalEnabled")[0].value:
    	if system.tag.readBlocking(stringPath+".OpcItemPath")[0].value != "":
    		print system.tag.readBlocking(stringPath+".OpcItemPath")[0].value

```

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [May 21, 2022, 1:04am UTC](https://forum.inductiveautomation.com/t/v8-what-is-the-most-efficient-way-to-extract-a-complete-list-of-configured-alarms/48071/5 "2022-05-21T01:04:24Z")

</div>

Actually, you can just check the `attributes` key values for alarms directly from the browse results. You also don’t need to call getResult; you get the same results from the return ofthe browse function. Also reading one tag at a time will be extremely slow especially for large numbers of tags. You should always bulk read and write tags

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [May 23, 2022, 10:33am UTC](https://forum.inductiveautomation.com/t/v8-what-is-the-most-efficient-way-to-extract-a-complete-list-of-configured-alarms/48071/6 "2022-05-23T10:33:16Z")

</div>

Good to know. I was just using this as a one-time script in the console to get a list, so the run time is not a big deal in this case.

---

<div class="post-metadata">

**Author:** ![lachguerabdallah](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lachguerabdallah/32/25558_2.png) [@lachguerabdallah](https://forum.inductiveautomation.com/u/lachguerabdallah)\
**Post date:** [August 25, 2022, 8:43am UTC](https://forum.inductiveautomation.com/t/v8-what-is-the-most-efficient-way-to-extract-a-complete-list-of-configured-alarms/48071/8 "2022-08-25T08:43:45Z")

</div>

have you solved it?

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [August 25, 2022, 12:04pm UTC](https://forum.inductiveautomation.com/t/v8-what-is-the-most-efficient-way-to-extract-a-complete-list-of-configured-alarms/48071/9 "2022-08-25T12:04:42Z")

</div>

Use the tag report tool that was recently released, use traits, alarms configured. You can also use in a script as well.

[https://docs.inductiveautomation.com/display/DOC81/Tag+Report+Tool](https://docs.inductiveautomation.com/display/DOC81/Tag+Report+Tool)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/6/76d7072de30c92c49b5869670356659b7e5511a8.png)

---

<div class="post-metadata">

**Author:** ![lachguerabdallah](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lachguerabdallah/32/25558_2.png) [@lachguerabdallah](https://forum.inductiveautomation.com/u/lachguerabdallah)\
**Post date:** [August 30, 2022, 7:54am UTC](https://forum.inductiveautomation.com/t/v8-what-is-the-most-efficient-way-to-extract-a-complete-list-of-configured-alarms/48071/10 "2022-08-30T07:54:33Z")

</div>

I need to show the alarm configuration in a window for the user

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [August 30, 2022, 11:23am UTC](https://forum.inductiveautomation.com/t/v8-what-is-the-most-efficient-way-to-extract-a-complete-list-of-configured-alarms/48071/11 "2022-08-30T11:23:31Z")

</div>

Save as script then and run in a window,  
[https://docs.inductiveautomation.com/display/DOC81/system.tag.query](https://docs.inductiveautomation.com/display/DOC81/system.tag.query)
