# Scripting in Alarm Notification

**URL:** <https://forum.inductiveautomation.com/t/scripting-in-alarm-notification/9991>\
**Category:** Ignition\
**Created:** [May 7, 2015, 3:52pm UTC](https://forum.inductiveautomation.com/t/scripting-in-alarm-notification/9991 "2015-05-07T15:52:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Serhii](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@Serhii](https://forum.inductiveautomation.com/u/Serhii)\
**Post date:** [May 7, 2015, 3:52pm UTC](https://forum.inductiveautomation.com/t/scripting-in-alarm-notification/9991/1 "2015-05-07T15:52:01Z")

</div>

Hi all!  
I tried to use Script block in Alarm Pipeline with easy scripts like:

`def handleAlarm(event):
     print 10`

or

`def handleAlarm(event):
     system.tag.write("TestTag", 3)`

It does not work. No one message in Console and no one errors. And tag still have old value…  
When I use Notification block instead Script block I receive a SMS.

Maybe I’m doing something wrong?

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [May 7, 2015, 4:36pm UTC](https://forum.inductiveautomation.com/t/scripting-in-alarm-notification/9991/2 "2015-05-07T16:36:54Z")

</div>

Hello,

A couple thoughts on this.

Maybe using the print Python statement is outputing to your wrapper.log file, not your console. If you want it to go to your Gateway console, try using a logger. For example:

```auto
logger = system.util.getLogger("mylogger")
logger.info(str(10))
```

Maybe writing to the tag is not working because you are not specifying the SQLTags provider in your tag path. Try this:

```auto
system.tag.write("[default]TestTag", 3)
```

You will notice that Alarm Notification Pipelines are under “Global” in the Project Browser in the designer. This means that Alarm Notification Pipelines do not run in a project and so do not have access to the default properties of projects, and so cannot use the default tag provider on the project.

Also, Alarm Notifications Pipelines execute on the Ignition Gateway, not in the designer – so the scripts run in the Gateway, not in your designer, so print statements don’t run in the designer so you won’t see the results in the designer console. Perhaps you already knew this and were looking at the Gateway console, but print statements don’t output there either, they output to the wrapper.log file on the Ignition server.

Best,

---

<div class="post-metadata">

**Author:** ![Serhii](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@Serhii](https://forum.inductiveautomation.com/u/Serhii)\
**Post date:** [May 8, 2015, 6:17am UTC](https://forum.inductiveautomation.com/t/scripting-in-alarm-notification/9991/3 "2015-05-08T06:17:02Z")

</div>

Thanks, it works!
