External Alerts Fields and Templates

The following topics describe the fields in external alerts that are sent from Helix Control-M to external tools, such as an event management system, and how you can control these fields through the use of templates that you provide when you run the run alerts:stream:template::set command:

External Alerts Default Fields

The following table lists the default alert fields provided by Helix Control-M. It also includes the names of the corresponding fields in Control-M, for a migration from Control-M to Helix Control-M.

Helix Control-M Field Name

Control-M Field Name

Description

eventType

call_type

Determines the type of event that triggered the alert:

  • I: newly issued alert

  • U: update of an existing alert

id

alert_id

Indicates a numeric value that uniquely identifies the alert (also known as the key or index).

server

data_center

Indicates the name of the Control-M/Server associated with the job.

Example: IN01

fileName

memname

Indicates the filename of the job (previously known as the member name).

runId

order_id

Indicates a numeric value that uniquely identifies the job run.

severity

severity

Determines the severity of the alert:

  • V: Very urgent

  • U: Urgent

  • R: Regular

status

status

Determines the status of alert handling:

  • 0: Not_Noticed (New)

  • 1: Noticed (Reviewed)

  • 2: Handled (Closed)

time

send_time

Indicates the time and date that the alert was issued.

Format: yyyymmddhhmmss

user last_user

Indicates the name of the user who last modified the status or text of the alert.

updateTime

last_time

Indicates the time and date that the alert was last modified by the user.

Format: yyyymmddhhmmss

message

message

Indicates the full text of the alert.

runAs

run_as

Indicates the Run As user set as owner of the job.

subApplication

sub_application

Indicates the Sub Application of the job (previously known as group).

application

application

Indicates the Application of the job.

jobName

job_name

Indicates the name of the job.

host

host_id

Indicates the node or host where the job is run.

type

alert_type

Determines the Alert type:

  • R: Regular

  • B: SLA

Default: R

closedByControlM

closed_from_em

(Deprecated* in Helix Control-M) Determines whether a ticket was closed from Control-M/EM.

Values: Y (yes) or N (no)

ticketNumber

ticket_number

(Deprecated* in Helix Control-M) Indicates a ticket number associated with the alert.

runNo

run_counter

Indicates a numeric value that uniquely identifies the job execution instance.

This counter is relevant for jobs that run more than once on a scheduling day.

notes

notes

Indicates the note text associated with the alert.

* In the case of a migration from Control-M to Helix Control-M, backward compatibility for this field enables you to continue using the same scripts for external alert handling.

Setting Fields Using a Template

This procedure describes how to use a template to customize fields in external alerts and override the default combination of fields provided by Helix Control-M. In your template you control which fields to include in an alert (a subset of the default fields), the names of the fields, and the order of their appearance.

Begin

  1. Create a template in JSON format with your combination of fields for external alerts.

    The following sample template sets a group of five fields of alert details. Of these five fields, three fields are renamed and two fields remain with their original names.

    Copy
    {
        "alertFields":
        [
            {"id":"alertId"},
            {"application":"businessUnit"},
            {"message":"message"},
            {"time":"date_and_time"},
            {"jobName":"jobName"}
        ]
    }
  2. Run the run alerts:stream:template::set command to submit your template.

The following alert includes the fields defined in the submitted sample template, in the same order of appearance:

Copy
{
    "fields":
    [
        {"alertId":"650"},
        {"businessUnit":"ACCT"},
        {"message":"SHOUT TO Alertscript FAILED Shout to Destination Alertscript failed."},
        {"date_and_time":"20220120070014"},
        {"jobName":"J1"}
    ]
}

Changing Field Names After Migrating from Control-M

This procedure describes how to use a template to change the names of all fields in external alerts to their pre-migration names in Control-M. Use this template if you have migrated from Control-M to Helix Control-M and want to continue using your existing scripts to handle external alerts.

Begin

  1. Create a template in JSON format to rename all fields to their previous names in Control-M:

    Copy
    {
      "fields":
      [
        {"eventType":"call_type"},
        {"id":"alert_id"},
        {"server":"data_center"},
        {"fileName":"memname"},
        {"runId":"order_id"},
        {"severity":"severity"},
        {"status":"status"},
        {"time":"send_time"},
        {"user":"last_user"},
        {"updateTime":"last_time"},
        {"message":"message"},
        {"runAs":"run_as"},
        {"subApplication":"sub_application"},
        {"application":"application"},
        {"jobName":"job_name"},
        {"host":"host_id"},
        {"type":"alert_type"},
        {"closedByControlM":"closed_from_em"},
        {"ticketNumber":"ticket_number"},
        {"runNo":"run_counter"},
        {"notes":"notes"}
      ]
    }
  2. Run the run alerts:stream:template::set command to submit your template.

Restoring All Default Fields

This procedure describes how to use a template to revert to the default combination of fields in external alerts after you have customized the fields (as described in Setting Fields Using a Template).

Begin

  1. Create a template in JSON format to reset the default fields:

    {    
        "fields": [
            {"eventType": "eventType"},
            {"id": "id"},
            {"server": "server"},
            {"fileName": "fileName"},
            {"runId": "runId"},
            {"severity": "severity"},
            {"status": "status"},
            {"time": "time"},
            {"user": "user"},
            {"updateTime": "updateTime"},
            {"message": "message"},
            {"runAs": "runAs"},
            {"subApplication": "subApplication"},
            {"application": "application"},
            {"jobName": "jobName"},
            {"host": "host"},
            {"type": "type"},
            {"closedByControlM": "closedByControlM"},
            {"ticketNumber": "ticketNumber"},
            {"runNo": "runNo"},
            {"notes": "notes"}    
        ] 
    }
  2. Run the run alerts:stream:template::set command to submit your template.

    External alerts fields are restored to the default combination, as described in External Alerts Default Fields.