To set up the ServiceNow configuration file
EMS actions that forward events and incidents to ServiceNow
To forward events from Entuity to ServiceNow
To forward incidents from Entuity to ServiceNow
To log requests to the ServiceNowSent.log file
Preliminary requirement:
Before you can send events and incidents from Entuity to ServiceNow, you must first install the ServiceNow Event Management plugin to your instance of ServiceNow.
To set up the ServiceNow configuration file:
- Navigate to the
sn-example.cfgfile, located in the entuity_home/etcdirectory. - Using this example, create a
sn.cfgfile, and save it to the same entuity_home/etcdirectory. - Update the 'default' section and/or add a named 'section' to the file for each ServiceNow path.
Each 'section' is a connection definition used by Entuity to connect to ServiceNow. -
Add the
socketTimeoutandconnectionTimeoutparameters to only one 'section' and enter a value for the parameters, in seconds.
These values determine the socket and connection timeouts for each ServiceNow request.
Note, theconnectionTimeoutvalue is global to all connections so it must be defined only once within one of the active 'sections' that you create in thesn.cfgfile.
For example:[default]
port = 443
host = myhost1.service-now.com
path = /api/now/table/em_event
user = Entuity
pass = ServiceNow
socketTimeout = 20
connectionTimeout = 15
[myhost2]
port = 443
host = myhost2.service-now.com
path = /api/now/table/em_event - Save the file, and then stop and restart Entuity.
Note, you can enter the value of a 'section' name (default or myhost2 in this example) in the cname parameter later when you configure Entuity to forward events and incidents.
The attributes for the connection definition are as follows:
Mandatory attributes:
- host - host of the connection.
- path - URL path for the connection.
- user * - username to be used for the connection.
- pass * - password/key required for establishing the connection.
Note, user and pass attributes are not required if using the 'Send to ServiceNow Queue' action, as they can be entered as parameters in the action itself.
Optional attributes:
- proto - protocol to be used, either http or https. Default is https.
- trust - trust https SSL certificate, either 0 or 1. Default is 1. 0 ignores SSL trust certificate and accepts all.
- port - connection port. Default is 443.
- proxyHost - to use proxy connection.
- proxyPort - specify the proxy port. Default is 80.
- socketTimeout - define the timeout, in seconds, for responses.
- connectionTimeout - define the timeout, in seconds, for connections.
EMS actions that forward events and incidents to ServiceNow
To create ServiceNow events, you can configure EMS actions to forward events and/or incidents from Entuity to ServiceNow.
As of Entuity v23.0 P01 upwards, there are two EMS actions for forwarding events and incidents to ServiceNow: 'Send to ServiceNow' and 'Send to ServiceNow Queue'
The 'Send to ServiceNow' action forwards each event and incident directly to ServiceNow, while the 'Send to ServiceNow Queue' action forwards events and incidents to ServiceNow through a queue from the Message Broker. Sending through a queue helps prevent communication or connection errors during the forwarding process, as messages remain in the queue until successfully acknowledged by the target endpoint. A message queue log file is also created when using the 'Send to ServiceNow Queue' action. For more information on message queues, see this article.
For information about EMS actions, see What are EMS actions?
To forward events from Entuity to ServiceNow:
- From the Main Menu, click Administration.
- On the Administration page, click Event Administration.
- On the Event Administration page, click the Rules tab.
- Select Post Storage in the tree on the left, and then click Add Rule at the bottom of the window.
- From the Add Rule window that is opened, ensure the Type field is set to 'Generic', and that the enabled checkbox is selected.
- Complete the Name and Description fields, as appropriate.
- Leave the Condition field as 'None'.
- In the Action Steps section, click Add.
-
From the Add Action window that is opened, do the following:
- From the Type dropdown field, select 'Send to ServiceNow' or, from Entuity v23.0 P01 upwards, 'Send to ServiceNow Queue'.
- If you want to keep the 'cname' parameter value as 'default', skip to step iv. Otherwise, in the Parameters field, click Set to change the 'cname' parameter value.
- From the Parameter Value window that is opened, enter the 'section' value that you defined in the ServiceNow configuration file, and click OK to save and close the Parameter Value window.
- If you selected the 'Send to ServiceNow Queue' action step in step i (Entuity v23.0 P01 upwards), select the 'username' and 'password' parameters in the Parameters field on the Add Action window, and click Set.
- Enter the username and password information in each parameter that Entuity will use to establish a connection with ServiceNow, and click OK.
- Click OK to save the action step and return to the Add Rule form.
- If you want to forward events to multiple ServiceNow paths, repeat step 9 and specify the unique webhook path for each channel.
- Click OK to save and add the rule, and then click the Save icon in the upper-right of the Event Administration page to save the event project.
-
If you selected the 'Send to ServiceNow Queue' action step in step i (Entuity v23.0 P01 upwards), choose whether to execute callback actions by optionally using the 'Response Callback' action. Do one of the following:
- If you want a 'Response Callback' action executed when event and incident data is sent to the ServiceNow integration:
- Keep the 'callback' parameter in the 'Send to ServiceNow Queue' action step.
- Create a ServiceNow-specific 'Response Callback' action from the Actions tab of the Event Administration page, and define which action to execute upon receiving a response from the ServiceNow integration.
- Return to the 'Send to ServiceNow Queue' action step in the new rule from the Rules tab (for events) or in the new trigger from the Incidents tab (for incidents) on the Event Administration page.
- Enter the name of the newly created 'Response Callback' action as the value of the action step 'callback' parameter.
- If no 'Response Callback' action is required, set the value to null without quotes.
- If you want a 'Response Callback' action executed when event and incident data is sent to the ServiceNow integration:
Note, if events are forwarded through message queues, the 'Set Attribute' option can't be used as a 'Response Callback' action. However, you can use other options in the 'Response Callback' action, such as 'Create Event'.
To forward incidents from Entuity to ServiceNow:
You can forward incidents to ServiceNow by setting up a global incident trigger. You can configure a global trigger so that all incidents are forwarded to the server, or configure individual triggers so that only individual incidents are forwarded:
- From the Main Menu, click Administration.
- On the Administration page, click Event Administration.
- On the Event Administration page, click the Incidents tab.
- Click Edit Global Triggers at the bottom of the window to open the Edit Global Triggers window.
- Click Add.
- On the Create Trigger window that is displayed, complete the Name and Description fields, as appropriate, and ensure that the enabled checkbox is selected..
- Keep the On Transition To dropdown field set to 'Any Change' so that all incidents raised against the same source are forwarded to ServiceNow.
- In the Condition dropdown field, select 'All tests must succeed', which updates the window.
- In the Tests section, click Add to open the Add Test window..
-
From the Type dropdown field on the Add Test window, select 'Groovy Script' and click OK to prevent notifications from being sent to ServiceNow when the incident changes from the 'Closed' to the 'Expired' state (as this is of no relevance to ServiceNow).
The Groovy script uses the following syntax:state !=4
-
In the Action Steps section of the Create Trigger window, click Add to open the Add Action window.
- From the Type dropdown field, select 'Send to ServiceNow' or, from Entuity v23.0 P01 upwards, 'Send to ServiceNow Queue'.
- In the Parameters field, edit the values of the 'cname', 'user', and 'password' parameters, in the same manner as steps ii - iv of the event process.
-
Click OK to
save the action and close the Add Action window.
- Click OK to save and add the trigger, and then click the Save icon in the upper-right of the Event Administration page to save the project.
- If you selected the 'Send to ServiceNow Queue' action step in step i, choose whether to execute callback actions, the same way as step 12 of the event process.
To log requests to the ServiceNowSent.log file:
Each time the 'Send to ServiceNow' action is invoked, the request is logged in the file eventEngine.log. You can also specify that the response for each request be logged in ServiceNowSent.log.
Each log contains a timestamped entry for every time a ServiceNow event is raised from Entuity. The information in these entries can help with troubleshooting.
To log requests in ServiceNowSent.log:
- Navigate to the
entuity_home/install/template/etc/event-engine-log4j2.propertiesfile. -
At line 131, change the following line:
logger.SERVICE-NOW-SENT.level = INFO
to either '
= DEBUG' or '= ALL'. - Run
configure.
Making the change in this location ensures that the change is not overwritten the next time you runconfigure. You can also change the same line in the entuity_home/etc/event-engine-log4j2.propertiesfile.
Comments
0 comments
Please sign in to leave a comment.