Event and Alarm Forwarding
The plugin sends events and alarms to the ServiceNow Event Web Service API (/api/global/em/jsonv2).
Enable event forwarding, alarm forwarding or both in the plugin configuration.
Events or Alarms
Alarm forwarding is best for alert management.
Each alarm sets message_key to the OpenNMS reduction key.
ServiceNow uses this key to correlate the events of one alarm into one alert.
When an alarm clears, the plugin sends a closing event, and ServiceNow closes the alert.
Event forwarding is best for an audit trail.
ServiceNow records every OpenNMS event in the em_event table.
By default, ServiceNow also creates an alert for each event.
To keep the events without alerts, add an event rule in ServiceNow, see Suppress Alerts for Forwarded Events.
You can enable both. A common setup uses alarm forwarding for the alerts and event forwarding for the event log.
Field Mapping
Events have event_class = OpenNMS.Event. Alarms have event_class = OpenNMS.Alarm.
| ServiceNow field | Source for events | Source for alarms |
|---|---|---|
|
Instance ID, the system property |
Instance ID, the system property |
|
|
|
|
Node label |
Node label |
|
IP address and service name, or the node label |
Event parameters |
|
Event parameter |
Event parameter |
|
Event UEI |
UEI of the last event |
|
From the event severity, see the table below |
From the alarm severity, see the table below |
|
Event parameter |
Alarm description |
|
All event parameters, as JSON |
Alarm ID, reduction key and acknowledged flag, as JSON |
|
Event time, UTC |
Time of the last event, UTC |
|
|
|
|
Not set |
Alarm reduction key |
|
Node label |
Node label |
Event Filter
The event filter selects the events that the plugin sends. It is a JEXL expression.
The default filter removes internal events and trouble ticket events:
!(event.uei =~ 'uei.opennms.org/internal/.*') and !(event.uei =~ 'uei.opennms.org/troubleTicket/.*')
| Field | Description |
|---|---|
|
Event UEI |
|
Severity as a number: 1 INDETERMINATE, 3 NORMAL, 4 WARNING, 5 MINOR, 6 MAJOR, 7 CRITICAL |
|
Severity label with one capital, such as |
|
Severity name in upper case, such as |
|
Node ID |
|
Event source |
|
Interface address |
|
Service name |
|
Event time |
Alarm Filter
The alarm filter selects the alarms that the plugin sends. It is a JEXL expression.
The default filter removes internal alarms and trouble ticket alarms:
!(alarm.reductionKey =~ 'uei.opennms.org/internal/.*') and !(alarm.reductionKey =~ 'uei.opennms.org/troubleTicket/.*')
| Field | Description |
|---|---|
|
Alarm reduction key |
|
Alarm ID |
|
Severity as a number: 1 INDETERMINATE, 3 NORMAL, 4 WARNING, 5 MINOR, 6 MAJOR, 7 CRITICAL |
|
Severity label with one capital, such as |
|
Severity name in upper case, such as |
|
Node label |
|
Node location |
|
Alarm type: |
|
True for a situation |
|
True for an acknowledged alarm |
|
Alarm log message |
|
Alarm description |
|
UEI of the last event |
|
Managed object type |
|
Time of the first event |
|
Time of the last event |
The plugin always sends a cleared alarm with severity 0 and resolution state Closing, so that ServiceNow closes the alert.
|
Event Rules in ServiceNow
Event rules in ServiceNow control how an event becomes an alert. They can filter by source instance, severity, source or other fields, and map event fields to alert fields. Find them under All > Event Management > Event Rules.
Suppress Alerts for Forwarded Events
By default, ServiceNow creates an alert in em_alert for every event in em_event.
To keep the forwarded events as records only, add an event rule that ignores them:
-
Open Event Management > Event Rules and create a new rule.
-
Set the filter condition Source instance is
OpenNMS.Event. -
Select Ignore events that match this filter and submit the rule.
ServiceNow still records the events in em_event, but creates no alerts for them.
This rule matches forwarded events only, with event_class = OpenNMS.Event. Forwarded alarms have event_class = OpenNMS.Alarm and still create alerts.
|