# Alarm Notification Manager

**URL:** <https://forum.inductiveautomation.com/t/alarm-notification-manager/78259>\
**Category:** Ignition\
**Created:** [August 22, 2023, 9:54pm UTC](https://forum.inductiveautomation.com/t/alarm-notification-manager/78259 "2023-08-22T21:54:40Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Lopez](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@David\_Lopez](https://forum.inductiveautomation.com/u/David_Lopez)\
**Post date:** [August 22, 2023, 9:54pm UTC](https://forum.inductiveautomation.com/t/alarm-notification-manager/78259/1 "2023-08-22T21:54:40Z")

</div>

Hello !

I want to read available alarm notification profiles so Im using this script

```auto
from com.inductiveautomation.ignition.gateway import IgnitionGateway
context = IgnitionGateway.get()
notificationList= context.getAlarmNotificationManager().getProfileNames()

```

this script returns nothing. So, I have read most of topics on this section [Search results for 'import IgnitionGateway' - Inductive Automation Forum](https://forum.inductiveautomation.com/search?q=import%20IgnitionGateway) and I noticed that most of scripting uses all methods listed on this section [GatewayContext](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.16/com/inductiveautomation/ignition/gateway/model/GatewayContext.html). However I didn't find any method to read all alarm notification profiles.

Do you have any idea?

---

<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:** [August 22, 2023, 10:05pm UTC](https://forum.inductiveautomation.com/t/alarm-notification-manager/78259/2 "2023-08-22T22:05:54Z")

</div>

When you looked at the javadoc for the `GatewayContext` to find the `.getAlarmNotificationManager()` method, did you notice the return data type? Of `AlarmManager`? If you followed _ **that** _ link, it would show you what you would be able to use with the alarm manager object. (You were close.)

---

<div class="post-metadata">

**Author:** ![David\_Lopez](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@David\_Lopez](https://forum.inductiveautomation.com/u/David_Lopez)\
**Post date:** [August 22, 2023, 10:26pm UTC](https://forum.inductiveautomation.com/t/alarm-notification-manager/78259/3 "2023-08-22T22:26:46Z")

</div>

Hello pturmel, thank you your fast response

My dubt still there because on `GatewayContext` the `.getAlarmNotificationManager()` method is not listed. I only found `.getAlarmManager()` which doesn't have any method to get notification profile names.

But the method is on this package [com.inductiveautomation.ignition.alarming.notification](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.13/com/inductiveautomation/ignition/alarming/notification/package-summary.html)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/8/08bf2bed3114cbfffb3b42e47466ffda7ff6e6de.png)

How could I use this method that is not listed on `GatewayContext`?

---

<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:** [August 22, 2023, 10:39pm UTC](https://forum.inductiveautomation.com/t/alarm-notification-manager/78259/4 "2023-08-22T22:39:02Z")

</div>

Oh, I see. That's implemented by the alarm notification **module**. You'll have to get the module manager and request the alarm notification module by its ID string. Then examine the returned object (its gateway hook) to see what interfaces it exposes. (If you are lucky, the gateway hook **is** the alarm notification manager.)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 22, 2023, 10:43pm UTC](https://forum.inductiveautomation.com/t/alarm-notification-manager/78259/5 "2023-08-22T22:43:49Z")

</div>

The hook class for the alarm notification module implements [`AlarmNotificationContext`](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.31/com/inductiveautomation/ignition/alarming/AlarmNotificationContext.html). So not quite directly, but pretty close.

---

<div class="post-metadata">

**Author:** ![David\_Lopez](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@David\_Lopez](https://forum.inductiveautomation.com/u/David_Lopez)\
**Post date:** [August 23, 2023, 2:51am UTC](https://forum.inductiveautomation.com/t/alarm-notification-manager/78259/6 "2023-08-23T02:51:35Z")

</div>

Thank you for your feedback. Actually I'm not sure how to use a different context from `GatewayContext`

```auto
from com.inductiveautomation.ignition.alarming.notification import IgnitionGateway
context = IgnitionGateway.get()
notificationList= context.getProfileNames()

```

I belive I have to use a different class instead of `IgnitionGateway` but I couldn't find any ☹

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 23, 2023, 3:32am UTC](https://forum.inductiveautomation.com/t/alarm-notification-manager/78259/7 "2023-08-23T03:32:22Z")

</div>

IgnitionGateway is the instance class of GatewayContext. That interface defines a method `getModule(moduleId)` (or something like that, I'm on my phone). That method allows you reach "into" another module to ask it for it's hook class. If you provide the ID of the alarm notification module, you'll get an instance that has the methods listed on the Alarm notification context interface I linked above, which you could the use to get access to what you're looking for. Probably.

---

<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:** [August 23, 2023, 11:40am UTC](https://forum.inductiveautomation.com/t/alarm-notification-manager/78259/8 "2023-08-23T11:40:49Z")

</div>

> [@paul-griffith](#):
>
> That interface defines a method `getModule(moduleId)`

Not quite. It defines `getModuleManager()`, which I mentioned above. The module manager has `getModule()`.

David, when dealing with the SDK, you have to explore. The `GatewayContext` that `IgnitionGateway` implements is the core of the system, and mostly exposes tools to get **subsystems** , which then sometimes have their own nested components.

{ When exploring you will sometimes encounter a java `Interface` that doesn't seem to show all possibilities, and doesn't list any implementations. That means the implementation details aren't public. Beware of such cases. }

---

<div class="post-metadata">

**Author:** ![David\_Lopez](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@David\_Lopez](https://forum.inductiveautomation.com/u/David_Lopez)\
**Post date:** [August 23, 2023, 3:45pm UTC](https://forum.inductiveautomation.com/t/alarm-notification-manager/78259/9 "2023-08-23T15:45:46Z")

</div>

Thank you so much,

I have this script

```auto
stringID='com.inductiveautomation.alarm-notification'
from com.inductiveautomation.ignition.gateway import IgnitionGateway
context = IgnitionGateway.get()
newContext= context.getModuleManager().getModule(stringID)
notificationProfiles=newContext.getAlarmNotificationManager().getProfileNames()
	

```

newContext returns: `ModuleManagerImpl$LoadedModule[id="com.inductiveautomation.alarm-notification", state="RUNNING"]`

I got the error log that `org.python.core.PyException: AttributeError: 'com.inductiveautomation.ignition.gateway.modules.M' object has no attribute 'getAlarmNotificationManager'`

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 23, 2023, 3:53pm UTC](https://forum.inductiveautomation.com/t/alarm-notification-manager/78259/10 "2023-08-23T15:53:17Z")

</div>

> [@David\_Lopez](#):
>
> `newContext= context.getModuleManager().getModule(stringID)`

Try

```auto
newContext= context.getModuleManager().getModule(stringID).getHook()

```

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 23, 2023, 3:54pm UTC](https://forum.inductiveautomation.com/t/alarm-notification-manager/78259/11 "2023-08-23T15:54:58Z")

</div>

Or skip the module manager entirely; GatewayContext extends CommonContext so you can just use `context.getModule(moduleId)`:  
[https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.31/com/inductiveautomation/ignition/common/model/CommonContext.html#getModule(java.lang.String)](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.31/com/inductiveautomation/ignition/common/model/CommonContext.html#getModule(java.lang.String))

---

<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:** [August 23, 2023, 4:16pm UTC](https://forum.inductiveautomation.com/t/alarm-notification-manager/78259/12 "2023-08-23T16:16:31Z")

</div>

Ah! That's the one that returns the hook directly.
