Customizing alert messages

Cloverleaf can deliver alert notifications in a variety of formats with customized alert messages.

You can customize the alert notification message by selecting from a list of predefined data elements. After making a selection, define a delimiter for the csv string alert message.

These data elements are available for building the alert message:

  • Alert configuration
  • Alert name (%N)
  • Alert type
  • Comparing
  • Current repeat count (%R)
  • Current time

    This is the alert trigger time.

  • Current value
  • Duration
  • Duration type
  • Group name
  • Host name
  • Original alert message
  • Root directory
  • Site name
  • Source

    This is the thread name; not all sources.

  • Source count
  • Status
  • Version

These elements are not available for building the alert message:

  • Log-in user
  • Password
  • Port
  • SMTP server

The Alert Configurator saves the chosen custom alert data element and delimiter to the alert configuration file, or a user-defined alert file in the same folder. The configuration file is located at $HCISITEDIR/Alerts/default.alrt.

MonitorD runtime loads its definition and populates the alert message accordingly when the alert is fired from the runtime.

MonitorD populates the values for the data elements in the Custom Alert Message dialog box.

A CUSTOMMSG key/value pair are generated and added to the alert definition for custom messages. For example:

{ALERT 
    { NAME Alert_1 }
    { VALUE vmf }
    { SOURCE hostname }
    { MODE actual }
    { WITH -1 }
    { COMP {<= 30000} }
    { FOR once }
    { WINDOW {* * * * * *} }
    { ACTION 
      { notify {} {appended message for alert} }
    }
    { CUSTOMMSG { 
      {ITEM { AlertType AlertConf AlertName GroupName Source SourceCount Status Duration DurationType 
Comparing CurrentRepeatCount CurrentTime LastActiveTime SiteName Version RootDir Hostname CurrentValue 
OriginalAlertMessage }}
      {DELIMITER keyvalue}
    } }
}

GUI configuration

The Actions pane of the Alert Configurator has an Advanced button. Clicking this opens the Advanced Message dialog box, where you configure custom messages.

When you create an alert message, you can select individual fields to add or remove from the custom alert message.

Click Save to save the custom alert message.

This table lists the areas and functions of the dialog box:

Function Description
Alert Fields

Displays the predefined fields. No fields are selected by default.

Messages

Displays the selected items from Alert Fields.

  • Double-click an item in Messages to move it to Alert Fields.
  • Double-click an item in Alert Fields to move it to Messages.
←All

This is enabled when Messages has at least one item.

Click this button to move all items in Messages to Alert Fields.

This is enabled when there is a selected item in Messages.

Click this button to move the selected item in Messages to Alert Fields.

This is enabled when there is a selected item in Alert Fields.

Click this button to move the selected item in Alert Fields to Messages.

All→

This is enabled if Alert Fields has at least one item.

Click this button to move all items in Alert Fields to Messages.

Move Up

This is enabled when Messages has at least two items and the selected item is not the first one in Messages.

Click this button for the selected item to exchange location with the previous one.

Move Down

This is enabled when Messages has at least two items and the selected item is not the last one in Messages.

Click this button for the selected item to exchange location with latter one.

OK/Cancel

Click OK to save the customized alert message in Messages.

Click Cancel to close the dialog box without saving.

The customized message is listed on Site Documentation when an alert is generated.

Alert configuration file

Alert configurations are stored in $HCISITEDIR/Alerts/default.alrt, or a user-defined alert file in the same folder.

The custom alert message is appended to the alert message content.

For example:

{ALERT 
   {NAME Alert_1 }
   {VALUE vmf }
   {SOURCE hostname }
   {MODE actual }
   {WITH -1 }
   {COMP {<= 30000} }
   {FOR once }
   {WINDOW {* * * * * *} }
   {ACTION 
      { notify {} {appended message for alert} }
}
   {CUSTOMMSG { 
      {ITEM { AlertType AlertConf AlertName GroupName Source SourceCount Status 
              Duration DurationType Comparing CurrentRepeatCount CurrentTime LastActiveTime 
              SiteName Version RootDir Hostname CurrentValue OriginalAlertMessage }}
      {DELIMITER keyvalue}
   } }
}

This file contains the CUSTOMMSG key. This key has these sub-keys:

  • ITEM

    This lists all items that are defined for the custom alert message.

  • DELIMITER

    This has one fixed value and cannot be edited, and does not display in the Advanced Message dialog box. The fixed value is saved in the alert file.

    This defines the literal alert message content. This is keyvalue.