# Servername in Alarm\_Events table?

**URL:** <https://forum.inductiveautomation.com/t/servername-in-alarm-events-table/92125>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [June 19, 2024, 8:01pm UTC](https://forum.inductiveautomation.com/t/servername-in-alarm-events-table/92125 "2024-06-19T20:01:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![harold.bruulsema](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@harold.bruulsema](https://forum.inductiveautomation.com/u/harold.bruulsema)\
**Post date:** [June 19, 2024, 8:01pm UTC](https://forum.inductiveautomation.com/t/servername-in-alarm-events-table/92125/1 "2024-06-19T20:01:55Z")

</div>

We have multiple Ignition servers, each with multiple Projects. Some of the projects overlap, so there are many tags that exist on more than one server.  
All servers connect to the same SQL server, so all servers write their alarms into the same alarm\_events table.  
This results in apparent duplication of alarms in the alarm\_events table. Is there a way I can determine which server flagged the alarm, so I can filter the alarms by gateway in my alarms management tool?

Is my approach wrong? I want to have all alarms going into the same table to simplify my overall alarm management system.  
I suppose I could have each Gateway write into their own alarm\_events and alarm\_event\_data tables, and a View to combine them into one, but to me it seems simpler to have them all write to one table.

Is this a good candidate for a feature request "Add Gateway\_name column to alarm\_events table"?

---

<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:** [June 19, 2024, 8:10pm UTC](https://forum.inductiveautomation.com/t/servername-in-alarm-events-table/92125/2 "2024-06-19T20:10:15Z")

</div>

> [@harold.bruulsema](#):
>
> Is my approach wrong?

Yes. Use the setting in your alarm journal configuration to set custom table names.

If necessary, make the names a view that pulls from a common table by gateway name. Then have an insert trigger on each view that alters the insert to include the table name.

---

<div class="post-metadata">

**Author:** ![harold.bruulsema](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@harold.bruulsema](https://forum.inductiveautomation.com/u/harold.bruulsema)\
**Post date:** [June 20, 2024, 5:48pm UTC](https://forum.inductiveautomation.com/t/servername-in-alarm-events-table/92125/3 "2024-06-20T17:48:35Z")

</div>

Ah, I see.  
Create a pair of Views on my SQL Server for each gateway. Have each gateway write to it's own Views. And have all the pairs of Views connected to my pair of master tables, adding their View name to the records written through them.  
I've only ever used Views as one-way read-only, so this is new to me, but it sounds workable enough.

Thanks, I'll give it a try.

I still think it would be far simpler if Ignition could just include the gateway name in the records it writes......

---

<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:** [June 20, 2024, 6:27pm UTC](https://forum.inductiveautomation.com/t/servername-in-alarm-events-table/92125/4 "2024-06-20T18:27:48Z")

</div>

Should only need one view per gateway, with an insert trigger for each.

---

<div class="post-metadata">

**Author:** ![harold.bruulsema](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@harold.bruulsema](https://forum.inductiveautomation.com/u/harold.bruulsema)\
**Post date:** [June 20, 2024, 6:32pm UTC](https://forum.inductiveautomation.com/t/servername-in-alarm-events-table/92125/5 "2024-06-20T18:32:25Z")

</div>

Wouldn't I need one for alarm\_events plus one for alarm\_event\_data?

---

<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:** [June 20, 2024, 8:00pm UTC](https://forum.inductiveautomation.com/t/servername-in-alarm-events-table/92125/6 "2024-06-20T20:00:59Z")

</div>

Hmm. I thought the latter was tied with a UUID.

---

<div class="post-metadata">

**Author:** ![harold.bruulsema](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@harold.bruulsema](https://forum.inductiveautomation.com/u/harold.bruulsema)\
**Post date:** [June 21, 2024, 12:29pm UTC](https://forum.inductiveautomation.com/t/servername-in-alarm-events-table/92125/7 "2024-06-21T12:29:29Z")

</div>

When I get some time I'll mess with it and see what I come up with.  
I'll probably start with creating table(s) for each gateway (because I don't know how to create bidirectional Views with update triggers, and I have limited time to work on this), and create a view to combine the tables for my alarm manager - I know how to do that.  
It may be a week or so before I can get to it, I'll try to remember to update here when I learn more.  
Thanks.
