Configuring Custom Payload

Typically, the details of an eG alert are sent as a JSON file to the configured URL. Every piece of information contained within an eG alert - eg., priority, component name, component type etc. - is represented in the JSON file as a $key:$value pair, where 'key' denotes the alert field, and 'value' denotes the actual value of that field at run time.

If you want eG incidents routed to ServiceNow to include additional information, then you can define a Custom Payload for that information as a $key:$value pair. This 'custom' information can be static information that does not change, or dynamic information, the value of which changes at runtime.

Using Custom Payload to Include Static Information

Say, you want incidents to indicate 'static' information, such as the FQDN of the eG manager that generated the incidents. Say that the FQDN of your eG manager is egmanager.innovations.com. To include this information in ServiceNow incidents, do the following:

  • First, check whether the ServiceNow REST API supports a 'key' that can be used for capturing the 'source' of alerts/incidents. If no such key exists, then you cannot proceed with the Custom Payload configuration. On the other hand, if such a key is available, then proceed to replace the $key in your Custom Payload specification, with that key value. For the purpose of our example, let us assume that the REST API supports the key named 'source'. In this case therefore, substitute '$key' with 'source'.
  • Then, proceed to explicitly specify the FQDN of your eG manager in the place of $value. Since FQDN is static information that will never change, you will have to explicitly hard-set $value as egmanager.innovations.com.
  • The complete Custom Payload specification will now be: source:egmanager.innovations.com

Using Custom Payload to Include Dynamic Information

Besides 'static' information, you can also use Custom Payload to add 'dynamic' information to the JSON payload.

The default alert payload that the eG manager sends to ServiceNow will typically include the following 'dynamic' values:

Dynamic Value

Description

$cname

Will display the name of the problem component

$ctype

Will display the component type to which the problem component belongs

$layer

Will display the layer affected by the problem

$pdesc

Will display a brief problem description

$prior

Will display the problem priority

$startTime

Will display the date/time at which the problem occurred

You can, if needed, additionally include any of the following 'dynamic' information to the alert payload, using the Custom Payload option:

Dynamic Value

Description

$service

Will display the name of the problem service

$zone

Will display the name of the zone to which the problem element belongs

$compNickName

Will display the nick name of the problem component

$TEST

Will display the problem test

$MEASURE

Will display the problem measure

$INFO

Will display the problematic descriptor

$LASTMEASURE

Will display the value reported by the problem measure

$DD

Will display the detailed diagnostics of the problem measure

$ALERTID

Will display the alarm ID of the eG alert

$priority

Will display the custom priority (instead of the default, Critical / Major / Minor / Normal priorities) defined in the eg_services.ini file. To know more, refer to Defining Custom Priority.

Like static information, dynamic values should also be configured in the Custom Payload text area, as $key:$value pairs. Any meaningful text string that clearly defines the value that follows can be configured as $key. However, the $value can only be one of the Dynamic Values listed in the table above.

For instance, if you want the alert payload to include the alarm ID that eG Enterprise automatically generates and assigns to each eG alert, then your Custom Payload specification can be as follows:

AlertID:$ALERTID

Here, AlertID is the 'key' that denotes what 'value' follows. You can change the 'key' to any meaningful text string you choose. However, the 'value' in this case, can only be $ALERTID.

Defining Custom Priority

When using the Custom Payload field to include 'dynamic' information in the alert payload, you have the option of including a 'Dynamic Value' named $priority.

This dynamic variable ensures that the eG alarm priorities, such as Critical, Major, Minor, and Normal, are additionally represented in the alert payload using custom priority values that you configure.

To configure these custom priority values, do the following:

  1. Login to the system that hosts the eG manager.

  2. Edit the eg_services.ini file in the <EG_MANAGER_INSTALL_DIR>\manager\config\ directory (on Windows; on Unix, this will be the /opt/egurkha/manager/config/ directory).

  3. In the [TT_INTEGRATION_SERVICE NOW] section of this file, you will find the following parameters:

    customPriorityValueForCritical=

    customPriorityValueForMajor=

    customPriorityValueForMinor=

    customPriorityValueForNormal=

  4. Set each of these parameters to a value that represents the corresponding priority. This can be a numeric value or a text string. Ideally, the custom value you set should match how alarm priorities are represented in ServiceNow. This way, ServiceNow users will be able to easily understand and interpret the severity of eG alerts displayed in the ServiceNow console.

    For instance, say that ServiceNow represents alarm priorities as numerals, as shown below:

    eG Alarm Priority

    Priority in TT System

    Critical

    1

    Major

    2

    Minor

    3

    Normal

    0

    In this case, you should configure the parameters in the [TT_INTEGRATION_SERVICE NOW] section, as shown below:

    customPriorityValueForCritical=1

    customPriorityValueForMajor=2

    customPriorityValueForMinor=3

    customPriorityValueForNormal=0

    Now, assume that in ServiceNow, alarm priorities are represented as shown below:

    eG Alarm Priority

    Priority in TT System

    Critical

    High

    Major

    Medium

    Minor

    Low

    Normal

    Closed

    In this case, the custom priority settings in the [TT_INTEGRATION_SERVICE NOW] section will be:

    customPriorityValueForCritical=High

    customPriorityValueForMajor=Medium

    customPriorityValueForMinor=Normal

    customPriorityValueForNormal=Closed

  5. Once the custom values are set, save the file, and then restart the eG manager.

After configuring the custom priority values, you should proceed to make sure that these custom values are included in the alert payload. For that, you need to configure the Custom Payload specification as follows:

custom_priority:$priority

Here, custom_priority is the 'key' that qualifies the 'value' that follows. Note that the key can be any meaningful text string that you choose. However, the dynamic 'value' in this case, should only be $priority.

If $priority is included in the alert payload, then, at runtime, this variable will be replaced by one of the custom values that you have set in the [TT_INTEGRATION_SERVICE NOW] section, depending upon the actual priority of the eG alert:

Including Additional Information in the Payload of Normal Alerts

If required, you can also include additional 'static information' in the payload of Normal alerts alone.

To configure such information, do the following:

  1. Login to the system that hosts the eG manager.

  2. Edit the eg_services.ini file in the <EG_MANAGER_INSTALL_DIR>\manager\config\ directory (on Windows; on Unix, this will be the /opt/egurkha/manager/config/ directory).

  3. In the [TT_INTEGRATION_SERVICE NOW] section of this file, you will find the following parameter:

    additionalFieldsForTicketClosure=

  4. You can set this parameter to a key:value pair that represents the 'static information' that you want to add to the payload of Normal alerts.

    For instance, say you want Normal alerts sent to ServiceNow to be accompanied by the statement, Ticket is closed.

    For that, your specification will be:

    additionalFieldsForTicketClosure=close_code:Ticket is closed

    Here, close_code is the key that briefly describes the 'static string' that follows. As always, you can change the 'key' to suit your taste and needs. The string Ticket is closed is the actual 'value' that will be passed to the alert payload, at the time of ticket closure.

  5. You can also add multiple 'static strings' to your Normal alert payload, if needed. For that, you should provide all the static information you require as a comma-separated list of key:value pairs, as shown below:

    additionalFieldsForTicketClosure=close_code:Ticket is closed,close_notes:Resolved by Caller

  6. Once the required static values are set, save the file, and then restart the eG manager.