--- title: Create a self-health monitor with a custom script description: You can create a self-health monitor to use custom health monitor script to monitor specified Event Management components. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/it-operations-management/event-management/custom-configure-threshold-monitoring.html release: australia product: Event Management classification: event-management topic_type: task last_updated: "2026-03-12" reading_time_minutes: 4 breadcrumb: [Self-health monitors for Event Management, Manage and monitor alerts, Configure, Event Management, ITOM AIOps, IT Operations Management] --- # Create a self-health monitor with a custom script 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.
| 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. |
| 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-operations-management/event-management/configure-threshold-monitoring.md). 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`. |
| 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-operations-management/event-management/custom-configure-threshold-monitoring.md). |
| **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. |
| 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-operations-management/event-management/custom-configure-threshold-monitoring.md) as examples of how to author the script, and use the [script editor tools](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/api-reference/scripts/c_SyntaxEditor.md). 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 |