Custom Alarm Assign Command

Include a custom command 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:

Assign an alarm by clicking the Assign button at the right hand side:

image-20240530-072818.png

Custom assign commands have 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:

Parameter

Used Variable

Description

ALARM_ID

$1

Alarm ID in the SKOOR Engine

ALARM_OPEN

$2

UTC Timestamp when the alarm was opened

STATE

$3

Alarm severity

ASSIGNED_TEXT

$4

Comment field from the assign action

OBJ_TYPE

$5

Source Object Type (Alarm from)

OBJ_NAME

$6

Source Object Name (Alarm from)

ORIGIN_TYPE

$7

Origin Object Type (Alarm Cause)

ORIGIN_NAME

$8

Origin Object Name (Alarm Cause)

REASON

$9

Alarm 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

ALARM_FILE

${14}

Path to alarm file

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