Create a self-health monitor to use custom health monitor script
- UpdatedAug 1, 2024
- 4 minutes to read
- Xanadu
- Event Management
Create a self-health monitor to use custom health monitor script
You can create a self-health monitor to use custom health monitor script to monitor specified Event Management components.
Before you begin
About this task
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:
|
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. |
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. |
Procedure
- Navigate to Event Management > Administration > Self-Health Monitoring, and click New.
-
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. - 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.
-
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 Table 1 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
- Click Submit.
Result