Process type Event Handler

Configuring a Process type Event Handler to fire based on several different Event Detectors

May 16th, 2022


Basic

This handler will execute a local process, or shell command, optionally when an event is raised or deactivated. The respective commands can be any shell command appropriate to the host. Commands should be specified as they would be from a terminal command prompt. For very complex commands, you may find it convenient to write a shell script, and then call the script from Mango.

If a process fails to initiate for any reason, a system event will be raised providing the failure description. Also, processes will be terminated if they run for longer than 15 seconds. Non-empty standard output from the process will be written to the Mango log at an "information" level. Non-empty error output will be written to the Mango log at an "error" level.

Configuring Process type Event Handler

Use Active process command;

echo ${event.id} ${event.eventType.eventType} ${event.eventType.eventSubtype}

Event Handler Screenshot

Under the Event Types select event(s) you want Event Handler to process.

Event Handler Selection

You will also be able to simply echo ${event} to see all possible options, your process output will look something like this.

Process output: 'EventInstance [id=112, eventType=SystemEventType(subtype=USER_LOGIN), activeTimestamp=1652727951202, rtnApplicable=false, rtnTimestamp=null, rtnCause=null, alarmLevel=INFORMATION, message=com.serotonin.m2m2.i18n.TranslatableMessage@d2ca928b, eventComments=[], handlers=[com.serotonin.m2m2.rt.event.handlers.ProcessHandlerRT@4546087a], acknowledgedTimestamp=null, acknowledgedByUserId=null, acknowledgedByUsername=null, alternateAckSource=null, hasComments=false, idsToNotify=null, context={}]

Copyright © 2024 Radix IoT, LLC.