# Get the list of all the tag with alarms Configured

**URL:** <https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360>\
**Category:** Ignition\
**Created:** [March 14, 2018, 11:51am UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360 "2018-03-14T11:51:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![prevostb](https://avatars.discourse-cdn.com/v4/letter/p/45deac/32.png) [@prevostb](https://forum.inductiveautomation.com/u/prevostb)\
**Post date:** [March 14, 2018, 11:51am UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/1 "2018-03-14T11:51:07Z")

</div>

Hello.

I am trying to get the list of all alarms configured on my Ignition project, instead of manually checking tag by tag the Alarms names. Is There any fast solution for It? I want to be able to change an alarm pipeline of any alarms throught the Scada.

---

<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:** [March 14, 2018, 12:31pm UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/2 "2018-03-14T12:31:13Z")

</div>

A combination of [system.tag.browseTags()](https://docs.inductiveautomation.com/display/DOC79/system.tag.browseTags) and [system.tag.getAlarmStates()](https://docs.inductiveautomation.com/display/DOC79/system.tag.getAlarmStates) should give you what you need in a script.

---

<div class="post-metadata">

**Author:** ![prevostb](https://avatars.discourse-cdn.com/v4/letter/p/45deac/32.png) [@prevostb](https://forum.inductiveautomation.com/u/prevostb)\
**Post date:** [March 14, 2018, 1:56pm UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/3 "2018-03-14T13:56:02Z")

</div>

Yes thank you, that is exactly the kind of Functions I was looking for

---

<div class="post-metadata">

**Author:** ![prevostb](https://avatars.discourse-cdn.com/v4/letter/p/45deac/32.png) [@prevostb](https://forum.inductiveautomation.com/u/prevostb)\
**Post date:** [May 30, 2018, 12:09pm UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/4 "2018-05-30T12:09:17Z")

</div>

For the next ones:

Heere is the code to get the list of all the alarms:

```auto
        today = system.date.now()
        Author = system.tag.read("[System]Client/User/OSUsername").value
	tags = system.tag.browseTagsSimple("", "ASC")
	"""Name the column of the Dataset"""
	headers = ["Alarm_Name", "Tag_Path", "Active_Pipeline","Creation Date", "author"]
	data = []
	"""-------------------------------------------------------------------------------------------------------"""
	"""Browse tags"""
	for tag in tags:
		"""------- Verify tag currently checked contain alarm. Else, move on to the next tag ----------- """
		try:
			"""----- Get all alarm information on the tag. Can be one or many alarms condition for 1 tag ------- """
			tagDefs = system.tag.getAlarmStates(tag.fullPath)

			"""Keep only tags with alarm configured"""
			for tagDef in tagDefs:
				priority = 0
				for prop in tagDef.getAlarmProperties():
					"""Look only for alarm with medium and High severity"""
					if (prop.property == "priority" and not str(prop.value) == "Diagnostic" ):
						priority = 1
				if priority == 1:
					tagPaths = [tag.fullPath]
					""" Then Write the result in a dataset"""						
					data.append([tagDef.alarm, tag.fullPath, pipeline, system.date.format(today, "YYYY-MM-d"), Author])
		except:
			pass

```

---

<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, 4:13pm UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/5 "2021-06-22T16:13:35Z")

</div>

Unfortunately, this script isn’t easily converted to v8 ☹ 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 values as well. Also, getConfiguration eats up all available memory and subsequently kills the script for large numbers of tags…

I really don’t know the best way to approach this anymore… I can think of really dumb ways that will probably take hours to run (for a lot of tags). E.g. using `system.tag.browse` to find the tags, then `system.tag.getConfiguration` to get the configuration for each tag individually, check if it has an alarm, get the alarm names, then use `system.tag.readBlocking` to read the values of the alarm properties (of course I would collate a list of all tags and all properties to read, and then bulk read them)… very cumbersome to write the code and very dumb and inefficient in terms of structure… Who knows how long that will take for 350k tags. A rough estimate based on a quick simulation is \>9hrs

---

<div class="post-metadata">

**Author:** ![chaoliang](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chaoliang](https://forum.inductiveautomation.com/u/chaoliang)\
**Post date:** [May 25, 2022, 6:29am UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/7 "2022-05-25T06:29:40Z")

</div>

My client wants to get a list of alarms configured. Facing the same issue now.

Is there any better ways after 3 years?

---

<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 25, 2022, 6:41am UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/8 "2022-05-25T06:41:45Z")

</div>

Use `system.tag.browse` recursively over your entire tag provider and then filter out tags from the result that have an alarms `attribute` key… hmm… although i’m missing how to get the alarm info from the attribute. The attributes will tell you if there _is_ an alarm associated with the tag, but won’t tell you the details of the alarm

e.g.

```auto
tags = system.tag.browse(path='[default]', filter={'recursive':True, 'tagType': 'AtomicTag'}) # this will include UDT Types, not sure how to filter these out through this filter...
alarmed_tags = [tag['fullPath'] for tag in tags if 'attributes' in tag and any('alarm' in atr.id for atr in tag['attributes']]

```

Maybe @paul-griffith or @ggross or @kcollins can assist in best way to pull the alarm details? (also how to filter out tags from within UDT definitions within the `filter` arg (doesn’t appear possible)? - can always filter them out in the results…)

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [May 25, 2022, 11:46am UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/9 "2022-05-25T11:46:24Z")

</div>

You could loop through your alarmed\_tags and do something like

```auto
def getAlarmTagInfo(tag):
	tagPath = str(tag)
	tagDefs = system.tag.getAlarmStates(tagPath)
	if len(tagDefs) > 0:
		print tagPath
		for tagDef in tagDefs:
			for prop in tagDef.getAlarmProperties():
				print prop.property,':',prop.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 25, 2022, 12:24pm UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/10 "2022-05-25T12:24:54Z")

</div>

ahem 🙂

> [@nminchin](#):
>
> Unfortunately, this script isn’t easily converted to v8 ☹ The function `system.tag.getAlarmStates` was deprecated.

---

<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:** [May 25, 2022, 12:28pm UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/11 "2022-05-25T12:28:57Z")

</div>

> [@How to Generate a List of all Configured Alarms](https://forum.inductiveautomation.com/t/how-to-generate-a-list-of-all-configured-alarms/36651/6):
>
> Here is what we use. Put this in a project script or on a button, and call getAlarms(rootPath). It will return a list. You will want to run this from the gateway, as it is a recursive browse. Invoke with sendRequest or sendRequestAsync. def getAlarms(tagPath): from com.inductiveautomation.ignition.common.tags.paths.parser import TagPathParser alarms = [] def iterTagConfig(dictIn, folderIn = ''): keys = dictIn.keys() #Move tags and alarms to end of list. I do not recall why, but it…

---

<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 25, 2022, 1:31pm UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/12 "2022-05-25T13:31:30Z")

</div>

Ah yes, there are so many of these forum questions 😆

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [May 25, 2022, 1:31pm UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/13 "2022-05-25T13:31:35Z")

</div>

deprecated != removed. 😉

---

<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 25, 2022, 1:32pm UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/14 "2022-05-25T13:32:58Z")

</div>

`deprecated = will-be-removed-soon` 🙃

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [May 25, 2022, 2:42pm UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/15 "2022-05-25T14:42:17Z")

</div>

Will it? I feel like IA keeps deprecated stuff around forever for backwards compatibility reasons lol.

---

<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:** [May 25, 2022, 2:43pm UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/16 "2022-05-25T14:43:13Z")

</div>

> [@nminchin](#):
>
> deprecated = will-be-removed- ~~soon~~ **-maybe-someday**

FIFY

---

<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 25, 2022, 2:55pm UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/17 "2022-05-25T14:55:41Z")

</div>

Haha, you’re all probably right. It’s hard to remove things that people might still be using 😕 Documentation for it might disappear though. I don’t see any documentation for Ignition version 7.7 as an example, unless the online manuals only started in 7.8…  
Looks like there’s a PDF of it on scribd, so I guess that answers that

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [May 25, 2022, 3:06pm UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/18 "2022-05-25T15:06:17Z")

</div>

How about

```auto
def isAlmTag(path):
	nodes = system.tag.getConfiguration(path, False)
	for item in nodes:
		if item.has_key('alarms'):
			return True
		else:
			return False

```

Just grab a list of tags and then loop and call isAlmTag?

---

<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 25, 2022, 10:26pm UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/19 "2022-05-25T22:26:08Z")

</div>

~~I imagine this would be pretty darn slow for 30k alarmed tags calling `getConfiguration` individually on each one. Calling getConfiguration to return the entire tag tree though is also slow and requires a very large amount of memory - I crashed my designer last time even with the memory boosted (might have been set to 1.5GB? or 2GB?)~~

Actually I just read what you’re doing in the function and it’s just checking to see if there are any alarms at all. If you just want to get a list of all tags with alarms, then system.tag.browse is by far the most efficient/fastest way to go. getConfiguration is far slower

---

<div class="post-metadata">

**Author:** ![ggross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ggross/32/12668_2.png) [@ggross](https://forum.inductiveautomation.com/u/ggross)\
**Post date:** [May 25, 2022, 11:15pm UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/20 "2022-05-25T23:15:09Z")

</div>

I don’t have a good solution at this point in time other than to refer to the other post mentioned earlier. I will tease you with the fact that this will become a lot easier in the near future with a feature we are finishing up.

Garth

---

<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:** [May 26, 2022, 2:03am UTC](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360/21 "2022-05-26T02:03:46Z")

</div>

@ggross how near is the future? 🙂

[Next page](https://forum.inductiveautomation.com/t/get-the-list-of-all-the-tag-with-alarms-configured/17360.md?page=2)
