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

source

Instance ID, the system property opennms.instance.id

Instance ID, the system property opennms.instance.id

event_class

OpenNMS.Event

OpenNMS.Alarm

node

Node label

Node label

resource

IP address and service name, or the node label

Event parameters ifIpAddress and service, or the node label

metric_name

Event parameter ds, metric, ifDescr or ifLabel, or the service name

Event parameter ds, metric, ifDescr or ifLabel, or the managed object type

type

Event UEI

UEI of the last event

severity

From the event severity, see the table below

From the alarm severity, see the table below

description

Event parameter description, reason or eventReason

Alarm description

additional_info

All event parameters, as JSON

Alarm ID, reduction key and acknowledged flag, as JSON

time_of_event

Event time, UTC

Time of the last event, UTC

resolution_state

New

New, or Closing for a cleared alarm

message_key

Not set

Alarm reduction key

ci_identifier

Node label

Node label

Severity Mapping

OpenNMS severity ServiceNow severity

CRITICAL

1 (Critical)

MAJOR

2 (Major)

MINOR

3 (Minor)

WARNING

4 (Warning)

CLEARED

0 (Clear)

NORMAL, INDETERMINATE

5 (OK)

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/.*')
Table 1. Available fields
Field Description

event.uei

Event UEI

event.severity.id

Severity as a number: 1 INDETERMINATE, 3 NORMAL, 4 WARNING, 5 MINOR, 6 MAJOR, 7 CRITICAL

event.severity.label

Severity label with one capital, such as 'Major' or 'Critical'. The comparison is case sensitive.

event.severity.name()

Severity name in upper case, such as 'MAJOR' or 'CRITICAL'

event.nodeId

Node ID

event.source

Event source

event.interface

Interface address

event.service

Service name

event.time

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/.*')
Table 2. Available fields
Field Description

alarm.reductionKey

Alarm reduction key

alarm.id

Alarm ID

alarm.severity.id

Severity as a number: 1 INDETERMINATE, 3 NORMAL, 4 WARNING, 5 MINOR, 6 MAJOR, 7 CRITICAL

alarm.severity.label

Severity label with one capital, such as 'Major' or 'Critical'. The comparison is case sensitive.

alarm.severity.name()

Severity name in upper case, such as 'MAJOR' or 'CRITICAL'

alarm.node.label

Node label

alarm.node.location

Node location

alarm.type.name()

Alarm type: 'PROBLEM', 'RESOLUTION' or 'PROBLEM_WITHOUT_RESOLUTION'

alarm.situation

True for a situation

alarm.acknowledged

True for an acknowledged alarm

alarm.logMessage

Alarm log message

alarm.description

Alarm description

alarm.lastEvent.uei

UEI of the last event

alarm.managedObjectType

Managed object type

alarm.firstEventTime

Time of the first event

alarm.lastEventTime

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:

  1. Open Event Management > Event Rules and create a new rule.

  2. Set the filter condition Source instance is OpenNMS.Event.

  3. 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.