Create a self-health monitor to use custom health monitor script

  • Release version: Washingtondc
  • Updated February 1, 2024
  • 4 minutes to read
  • You can create a self-health monitor to use custom health monitor script to monitor specified Event Management components.

    Before you begin

    Role required: evt_mgmt_admin

    About this task

    To augment the self-health monitors that are provided with the base system, you can create a self-health monitor to monitor the components that you specify. The health monitor scripts that are provided with the base system are listed in the following table.
    Table 1. Health monitor scripts provided with the base system
    Health monitor script Used by a monitor to:
    Check delay in event processing Monitor the duration of events [in minutes] that remain in Ready state and are not processed.
    Connectors Monitor Monitor:
    • Whether the time that a connector in idle state surpassed the threshold [in minutes] configured.
    • The active status of connectors.
    Get Event Processing state Monitor the time that events are in Ready state. Alerts are sent when this time exceeds the threshold.
    MID Server Threshold Alerts Monitor MID Server health. Events are sent when changes in MID Server state are detected.
    You can create alert management rules to respond to and remediate the issues detected by self-health. Alerts are generated based on the specified severity and threshold. Navigate to Event Management > Administration > Self-Health Monitoring for the monitors that are provided with the base instance to monitor the issues detected by self-health, which are:
    Monitor Description
    Connector's idle state monitoring Monitor to verify whether any of the connectors were in idle state that surpassed the threshold [in minutes] that was configured.

    Health Monitor script selected: Connectors Monitor.

    Connectors Status Monitor to track the active status of the connectors. Select only one threshold to configure which severity to invoke using 1 to select the threshold field or 0 to ignore the threshold field. For more information, see Connector status example.

    Health Monitor script selected: Connectors Monitor.

    Delay in event processing Monitor to track the duration of events [in minutes] that remain in Ready state and were not processed. This duration period initiates an alert for the event processing CI with severity according to the configured thresholds [minutes].

    Health Monitor script selected: Check delay in event processing.

    Event Processing job Monitor the state of the event processing jobs. An alert is generated when the idle time of a job exceeds the configured threshold.

    Health Monitor script selected: Get Event Processing state.

    MID Server MID Server Threshold Alerts Monitor MID Server MID Server health. Events are sent when issues with MID Server availability and resource thresholds are detected.

    Health Monitor script selected: MID Server Threshold Alerts.

    Note:
    To prevent a self-health monitor from detecting the connector status, at any time you can clear the Active check box of the monitor and then click Update.

    Procedure

    1. Navigate to Event Management > Administration > Self-Health Monitoring, and click New.
    2. On the form, fill in the fields.
      Table 2. Monitoring Configuration form
      Field Description
      Name Descriptive and meaningful name for the monitor.
      Description Text narrative that describes the monitor.
      Active Check box to enable the monitor.
      Monitoring job frequency [seconds] Frequency that the monitoring job should run. Default: 120 seconds.
      Last Run Last run date and time. These values are automatically updated.
      Script Monitoring script. Click the search icon. The existing scripts are listed in the Health Monitor Scripts screen, or click New to create a custom health monitor script. For more information about creating a custom health monitor script, see step 3.
      Note:
      Regarding all the following threshold configuration fields: All monitored values are compared against the thresholds. If a monitored value exceeds a threshold, an alert with the appropriate severity is issued.
      Critical Threshold Any point above the value is considered a critical consequence.
      Major Threshold Any point above the value, but below the value of the Critical Threshold, is considered a major consequence.
      Minor Threshold If exceeded, the value is considered a minor consequence.
      Warning Threshold If the value is exceeded, a warning is issued.
      Additional information Further information about the monitor.
    3. To create a custom health monitor script, on the Monitoring Configuration form, next to the Script field, click the search icon to open the Health Monitor Scripts form, and click New.
    4. On the form, fill in the fields.
      Table 3. Health Monitor Script form
      Field Description
      Active Check box to enable the monitor.
      Description Text narrative that describes the custom script.
      Name Descriptive and meaningful name for the custom script.
      Script Custom script to run when called from a monitor. A script template is provided as a guide.

      You can use the Health monitor scripts provided with the base system as examples of how to author the script, and use the script editor tools.

      Ensure that the custom script includes:

      Run the monitor function, which is called according to the "monitoring job frequency” setting runUpdateHealthMonitorScripts(scriptId). Add this function to run the monitoring logic.

      Specify the configuration function that is called every hour runInsertHealthMonitorScripts(scriptId). Add the configuration logic and add a CI if needed. In the navigation pane search field, enter em_monitor_state.list. In the Monitoring States [em_monitor_state] table, specify the initialization of the monitor record in the required record.

      Use the helper functions defined in EvtMgmtHealthMonitorCommon and EvtMgmtEventAlertGenerator script includes:

      • EvtMgmtHealthMonitorCommon
      • healthMonitorCommon.shouldRun
      • healthMonitorCommon.calculateSeverity
      • EvtMgmtEventAlertGenerato
      • openAlert
      • closeAlert

      You can use the Monitoring Configurations [em_monitor_conf] table for self-health monitoring configuration, the Health Monitor Scripts [em_monitor_scripts] table for scripts, and Monitoring States [em_monitor_state] table for displaying the results of the monitor, as initialized inside runInsertHealthMonitorScripts.

      For more information about script includes and APIs, see:Script includes that are installed with Event Management

    5. Click Submit.

    Result

    To monitor the Event Management components that you specify, you can configure a self-health monitor that uses the custom health monitor script that you created.