Custom Alarm Assign Command

Since SKOOR Engine Version 5.2 it is possible to include a custom comand or custom shell script which will be executed when an alarm is assigned to a specific user.

Alarms can be assigned to a User in OPM interface or in the SKOOR Engine when selecting 'show alarms':

 


This has to be configured in the server configuration file:

/etc/opt/eranger/eranger-server.cfg


The configuration is done by user and command parameters. The user(s) must exist in the SKOOR Engine.

custom_assign_user       = user
custom_assign_command    = /path_to/command.sh

or for multiple users the configuration would be as below:

custom_assign_user1       = user1
custom_assign_command1    = /path_to/command1.sh
custom_assign_user2       = user2
custom_assign_command2    = /path_to/command2.sh

A default custom command can be configured that is run for all assignments except the ones configured with specific users:

custom_assign_default    = /path_to/default_script.sh


The script or command will get 10 parameters from the SKOOR Engine:

ParameterUsed VariableDescription
ALARM_ID$1Alarm ID in the SKOOR Engine
ALARM_OPEN$2UTC Timestamp when the alarm was opened
STATE$3Alarm severity
ASSIGNED_TEXT$4Comment field from the assign action
OBJ_TYPE$5Source Object Type (Alarm from)
OBJ_NAME$6Source Object Name (Alarm from)
ORIGIN_TYPE$7

Origin Object Type (Alarm Cause)

ORIGIN_NAME$8

Origin Object Name (Alarm Cause)

REASON$9Alarm Reason
DEVICE${10}Device Name (when origin is a job)
USER_ID${11}ID of the SKOOR user
USER_NAME${12}Login name of the SKOOR user
USER_FULLNAME${13}Full name of the SKOOR user


If the script generates:

  • no output to stderr, success is assumend and a success comment is added to the alarm
  • output to stderr, failure is assumed and a comment containing the output is added to the alarm


An example script can be found in /opt/eranger/server/example_custom_assign_command.sh