Connecting to ServiceNow

The connection sequence that the gateway uses has two phases: establishing the connection to ServiceNow and validating the data.

Establishing the connection to ServiceNow

At start up, the gateway sends an HTTP GET request on the ServiceNow target table defined by the Gate.ServiceNow.TableName property and validates the table. In the same action, the gateway validates the connection details to ServiceNow.

Use the following properties defined in the G_SERVICENOW.props properties file to establish connection to ServiceNow:

  • Set the Gate.ServiceNow.Host property to the name (or IP address) of the server on which ServiceNow is running and to which the gateway connects. The gateway will connect to this ServiceNow server to create tickets and to read updates from it.
  • Set the Gate.ServiceNow.Username property to the username for the user account that the gateway uses to access the ServiceNow instance. This user account must be created in ServiceNow and consist of a username and password. Use this property in conjunction with the Gate.ServiceNow.Password property.
  • Set the Gate.ServiceNow.Password property to the password for the user account that the gateway uses to access the ServiceNow instance. This user account must be created in ServiceNow and consist of a username and password. Use this property in conjunction with the Gate.ServiceNow.Username property.

Authentication contains information on creating a dedicated gateway user on the ServiceNow system and using those credentials for specifying the user name and password for the Gate.ServiceNow.Username and Gate.ServiceNow.Password properties.

When the gateway starts, it checks the previously described properties and, if valid, uses them as part of every REST request issued to the target ServiceNow instance. If one or more of the previously described properties has invalid values or is empty, the gateway shuts down and writes an appropriate message to the log.

If the gateway starts up successfully and subsequently loses its connection with ServiceNow, the gateway goes into store and forward mode.

See Store and forward capability for information on the store and forward feature.

Validating the gateway properties and map file

When the gateway starts, but before it connects to the ServiceNow server, it validates the gateway properties file, G_SERVICENOW.props, to ensure that each property has the correct syntax and correct value type. After the gateway successfully connects to the ServiceNow server, it performs a number of checking operations including the following:

  • Validates the mapping file as defined in the Gate.MapFile property. Specifically, the gateway:
    • Ensures that the mapping file contains at least the status map (StatusMap). If the status map is not present, the gateway shuts down.
    • Checks with ServiceNow that every field specified is a valid ServiceNow field name.
  • Validates a number of attribute names with ServiceNow. These attribute names are used to set gateway specific properties, for example, Gate.ServiceNow.UpdateFields and Gate.ServiceNow.AlternateIndexField.

Improving the performance of the gateway

To improve the performance of the gateway use the Gate.ServiceNow.Connections property (defined in the G_SERVICENOW.props properties file). The Gate.ServiceNow.Connections property takes an integer value that specifies the number of simultaneous connections the gateway makes with ServiceNow. In general, the more connections specified, the faster the gateway can create requests in ServiceNow from alerts sent by the ObjectServer.

In the following gateway properties file example, the Gate.ServiceNow.Connections property is set to the value 6, which means the gateway will make six simultaneous connections with ServiceNow:

.
.
.
# ServiceNow gateway specific properties
.
.
.
Gate.ServiceNow.Connections:6
.
.
.
Note: If specified, the value of the Gate.ServiceNow.Connections property should be greater than 2. Also, the underlying hardware architecture must align with the number of connections.