Create monitor

Create a monitor, using a custom Health Monitor script, to monitor the specified components using the self-health monitor.

Before you begin

Role required: evt_mgmt_admin

About this task

To augment the monitors provided with the base system, create a monitor to use custom Health Monitor scripts. The Health Monitor scripts provided with the base system are:
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 was in idle state surpassed the threshold [in minutes] that was configured.
  • The active status of connectors.
Get Event Processing state Monitors the time that events were in Ready state and send alerts 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.

Procedure

  1. Navigate to Event Management > Settings > Self-Health configuration.
    The Monitoring Configurations table displays.
  2. Click New.
    Monitor configuration - create new
  3. Fill in the fields, as required.
    Table 2. Fields in the Monitoring Configurations form
    Field Description
    Name Enter a meaningful name for the monitor.
    Description Text narrative that describes the monitor.
    Active When selected, the monitor is active.
    Monitoring job frequency [seconds] Specify the frequency that the monitoring job should run.
    Last Run The last run date and time values are automatically updated.
    Health Monitor Script for the monitor. The monitoring script. You can select an existing script, or create a new one (custom script). For more information about creating custom Health Monitor Script, see step 4.
    Additional information Further information about the monitor.
    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 Set a value that any point above it is considered to be of critical consequence.
    Major Threshold Set a value that any point above it, but below the value of the Critical Threshold, is considered to be of major consequence.
    Minor Threshold Set a value that is if exceeded, it is considered to be of minor consequence.
    Warning Threshold Set a value that, if it is exceeded, a warning is issued.
  4. To create a custom Health Monitor Script, in the Health Monitor Scripts form:
    1. Fill in the fields of the Health Monitor Scripts form. Ensure that Active is selected.
    2. In the Script editor, create the custom script. 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 and the script template provided.

      Self-Health script template

    Ensure that the custom script includes the following:

    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. Specify the initialization of the monitor record in the required record in the em_monitor_state table.

    Use the helper functions defined in EvtMgmtHealthMonitorCommon and EvtMgmtEventAlertGenerator script includes:
    • EvtMgmtHealthMonitorCommon
    • healthMonitorCommon.shouldRun
    • healthMonitorCommon.calculateSeverity
    • EvtMgmtEventAlertGenerator
    • openAlert
    • closeAlert

    You can use the em_monitor_conf table for Self-health configuration, em_monitor_script table for script, and em_monitor_state table for displaying the results of the monitor, as initialized inside runInsertHealthMonitorScripts.

    For further information:

  5. Click Submit.