Plugin Configuration

Configure the plugin in the OpenNMS web interface under Plugins > ServiceNow. This page describes the connection settings. The feature pages describe the filters and the field mappings.

Settings

Setting Description

ServiceNow instance URL

The URL of your instance, in the form https://<instance>.service-now.com.

Authentication

Basic, OAuth 2.0 client credentials or OAuth 2.0 password grant. See Authentication.

Username and password

The ServiceNow integration user. See ServiceNow Instance Setup. Not used with client credentials. The token runs as the OAuth application user.

Client ID and client secret

OAuth only. The values of the OAuth API endpoint record in the ServiceNow application registry. Leave the secret empty on a later save to keep the stored one.

Forward alarms

Send OpenNMS alarms to ServiceNow Event Management. See Event and Alarm Forwarding.

Forward events

Send OpenNMS events to ServiceNow Event Management. See Event and Alarm Forwarding.

Forward tickets

Create and update ServiceNow incidents from OpenNMS alarms. This needs the ticketer plugin, see Installation. See Ticket Forwarding and Cases.

CMDB import

Import configuration items from the ServiceNow CMDB. See CMDB Import.

Status

Connected or Disconnected, set by the last save.

A save tests the connection first. If the connection fails, nothing is saved. After the save, the plugin checks the access of the user for each enabled feature. A failed check shows a warning, and the settings stay saved.

Authentication

The plugin has three authentication types.

Type Needs When to use

Basic

Username and password

Simple setups. Not possible on instances that require multi-factor authentication for the user.

OAuth 2.0 client credentials

Client ID and client secret. No username, the token runs as the OAuth application user.

Washington DC or later. No user password leaves the instance. Recommended for new setups.

OAuth 2.0 password grant

Client ID, client secret, username and password

Instances older than Washington DC. ServiceNow recommends to disable this grant, so prefer client credentials where possible.

With OAuth, the plugin requests an access token from <instance-url>/oauth_token.do and sends it as a bearer token. The plugin keeps the token and renews it one minute before it expires. A token that lives less than two minutes is renewed after half of its lifetime. When ServiceNow rejects a token, the plugin requests a new one and sends the call again. A token request that fails with a temporary error, such as HTTP 503, is tried again. The password grant renews with the refresh token. When the refresh is rejected, the plugin logs in again. The client credentials grant has no refresh token, so it always logs in again.

The authentication type, the password and the client secret are stored together in the OpenNMS secure credentials vault. A save stores only the secrets of the selected type. After a change of the type, enter the password or the client secret again.

To set up the OAuth API endpoint in ServiceNow, see Step 3: Create an OAuth API Endpoint.

Proxy Servers

Refer to this section only when OpenNMS reaches the internet through an HTTP proxy. When OpenNMS connects to ServiceNow directly, no proxy setup is necessary.

The plugin has no proxy settings. It reads the proxy from the OpenNMS JVM and from the environment of the OpenNMS process, in the same way as curl.

For the https:// instance URL, the plugin uses the first of these values that is set:

  1. The JVM properties https.proxyHost and https.proxyPort, with https.proxyUser and https.proxyPassword for a proxy that needs a login.

  2. The environment variable HTTPS_PROXY or https_proxy.

  3. The environment variable HTTP_PROXY or http_proxy.

A proxy variable holds a URL that starts with http://. The plugin does not support TLS to the proxy. An https:// proxy URL or an invalid proxy value stops every ServiceNow call with an error that names the setting. Correct the value and restart OpenNMS. The instance URL must start with https://. The proxy only opens a tunnel to ServiceNow and does not see the content of the requests.

Put the user and password of a proxy that needs a login in the URL. Encode special characters in the URL form:

HTTPS_PROXY=http://svc%40corp:secret@proxy.example.com:3128

Hosts in NO_PROXY connect directly. The list is comma separated. A name or a leading dot matches the host and its subdomains. Hosts in the JVM property http.nonProxyHosts connect directly too. That list is pipe separated, with exact names or * wildcards, like the JDK. Localhost addresses always connect directly.

Set the values where the OpenNMS JVM sees them. With a package installation, add them to $OPENNMS_HOME/etc/opennms.conf:

export HTTPS_PROXY=http://proxy.example.com:3128
export NO_PROXY=.internal.example.com
# or, as JVM properties:
ADDITIONAL_MANAGER_OPTIONS="$ADDITIONAL_MANAGER_OPTIONS -Dhttps.proxyHost=proxy.example.com -Dhttps.proxyPort=3128"

With a container, set them as environment variables of the container. Restart OpenNMS after a change. At start, the plugin logs the proxy it uses, without the password:

ServiceNow HTTP proxy: https via proxy.example.com:3128 (user svc@corp) from HTTPS_PROXY