# Building list of disabled alarms

**URL:** <https://forum.inductiveautomation.com/t/building-list-of-disabled-alarms/86386>\
**Category:** Ignition\
**Created:** [February 26, 2024, 8:01pm UTC](https://forum.inductiveautomation.com/t/building-list-of-disabled-alarms/86386 "2024-02-26T20:01:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Gratton](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Alex\_Gratton](https://forum.inductiveautomation.com/u/Alex_Gratton)\
**Post date:** [February 26, 2024, 8:01pm UTC](https://forum.inductiveautomation.com/t/building-list-of-disabled-alarms/86386/1 "2024-02-26T20:01:21Z")

</div>

I would like to get a list of disabled alarms so I can see which alarms are disabled and reenable them selectively. I've tried using

` system.alarm.queryStatus(any_properties=[("enabled", "!=", "TRUE")])`

but it doesn't return anything. What would be the best way to go about finding disabled alarms?

---

<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:** [February 26, 2024, 8:07pm UTC](https://forum.inductiveautomation.com/t/building-list-of-disabled-alarms/86386/2 "2024-02-26T20:07:19Z")

</div>

The `enabled` property isn't a string. Use jython's `True` instead of `"TRUE"`.

---

<div class="post-metadata">

**Author:** ![Alex\_Gratton](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Alex\_Gratton](https://forum.inductiveautomation.com/u/Alex_Gratton)\
**Post date:** [February 26, 2024, 8:16pm UTC](https://forum.inductiveautomation.com/t/building-list-of-disabled-alarms/86386/3 "2024-02-26T20:16:50Z")

</div>

Using `True` still returns nothing, running the inverse condition, `"FALSE"` or `False` does return all the enabled alarms.

---

<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:** [February 26, 2024, 8:21pm UTC](https://forum.inductiveautomation.com/t/building-list-of-disabled-alarms/86386/4 "2024-02-26T20:21:31Z")

</div>

> [@Alex\_Gratton](#):
>
> system.alarm.queryStatus(any\_properties=[("enabled", "!=", "TRUE")])

Hmmm.

Try:

```auto
system.alarm.queryStatus(any_properties=[("enabled", "=", False), ("enabled", "=", None)])

```

---

<div class="post-metadata">

**Author:** ![Alex\_Gratton](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Alex\_Gratton](https://forum.inductiveautomation.com/u/Alex_Gratton)\
**Post date:** [February 26, 2024, 9:03pm UTC](https://forum.inductiveautomation.com/t/building-list-of-disabled-alarms/86386/5 "2024-02-26T21:03:39Z")

</div>

That didn't seem to work either. Running with just ` system.alarm.queryStatus()` it only returned the enabled alarms.

Would using ` system.tag.query` perhaps be an alternative route to try?

---

<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:** [February 26, 2024, 9:20pm UTC](https://forum.inductiveautomation.com/t/building-list-of-disabled-alarms/86386/6 "2024-02-26T21:20:46Z")

</div>

Likely. If you use the Tag Report Tool to generate a working search, you can save as a jython script for further optimization.

---

<div class="post-metadata">

**Author:** ![justin.brzozoski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justin.brzozoski/32/13452_2.png) [@justin.brzozoski](https://forum.inductiveautomation.com/u/justin.brzozoski)\
**Post date:** [February 26, 2024, 9:47pm UTC](https://forum.inductiveautomation.com/t/building-list-of-disabled-alarms/86386/7 "2024-02-26T21:47:21Z")

</div>

I have had similar behavior in the past and sort of assumed at a certain point in the alarming module, that a tag with disabled alarms was ignored the same as a tag with no alarm.

If all the tags you are looking at happen to be in one not-too-big part of the tag tree, you can get the desired result with `system.tag.getConfiguration` like this:

```auto
from com.inductiveautomation.ignition.common.tags.config.types import TagObjectType

def has_disabled_alarms(tag_config):
	return any((alarm_config['enabled'] != True) for alarm_config in tag_config.get('alarms',[]))

def filter_tag_configs(tag_config, filter_test, path_to_tag=None):
	if path_to_tag is None:
		path_to_tag = str(tag_config.get('path',''))
	else:
		path_to_tag = path_to_tag + '/' + str(tag_config.get('path',''))
	tag_type = tag_config.get('tagType','')
	tag_paths = []
	if tag_type == TagObjectType.Folder:
		for subtag in tag_config.get('tags',[]):
			tag_paths.extend(filter_tag_configs(subtag, filter_test, path_to_tag))
	elif tag_type == TagObjectType.AtomicTag:
		if filter_test(tag_config):
			tag_paths.append(path_to_tag)
	return tag_paths

tag_config = system.tag.getConfiguration('[default]sandbox', True)[0]
paths_to_tags_with_disabled_alarms = filter_tag_configs(tag_config, has_disabled_alarms)

```
