1. Installing the data access template
2. Loading the update sets in ServiceNow
3. Creating Scheduled Job in ServiceNow
Introduction and note
This article provides example instructions for integrating ServiceNow with a single standalone Entuity server, so that data can be pulled from Entuity and loaded onto the ServiceNow CMDB.
Important note: this is an example configuration for integrating the ServiceNow CMDB with Entuity, and following these instructions will make changes to your existing ServiceNow configuration (if you have one already set up).
This integration contains three main steps:
- Installing a data access template on the Entuity server, that ServiceNow will use to pull out the required data.
- Loading the update sets in ServiceNow, which will create the necessary tables, transform maps and outbound RESTful API calls that ServiceNow will use when loading data from Entuity.
- Creating the Scheduled Job in ServiceNow, which when executed will run a script to load and process the data from Entuity into ServiceNow.
Requirements:
If your ServiceNow instance is not already configured, please contact Entuity Support for the files required to integrate ServiceNow CMDB with Entuity. Please find the required content for the template.xml file below (this is used in Entuity):
template.xml
<dataAccessTemplate name="SNOW_DEVICES" type="USER" xmlns:ns5="http://www.entuity.com/webrpc" xmlns:ns2="http://www.entuity.com/schemas/webUI" xmlns:ns4="http://www.entuity.com/schemas/eventengine" xmlns:ns3="http://www.entuity.com/schemas/flow" >
<description>Template to import to SNOW CMDB</description>
<object type="DeviceEx" tag="DeviceData">
<selector>simple;ref.devices</selector>
<attribute expression="simple;entuity_server_info()[1]" tag="discovery_source"/>
<attribute expression="simple;concat(entuity_server_info()[0],":",id)" tag="correlation_id"/>
<attribute expression="name" tag="name"/>
<attribute expression="devPolledIpAddr" tag="ip_address"/>
<attribute expression="devManagementMac" tag="mac_address"/>
<attribute expression="sysLocation" tag="location"/>
<attribute expression="devManufacturer" tag="manufacturer"/>
<attribute expression="devModel" tag="model_id"/>
<attribute expression="devVersion" tag="firmware_version"/>
<attribute expression="devSerialNumber" tag="serial_number"/>
<attribute expression="devSysCapabilities" tag="capabilities"/>
<attribute expression="simple;transform("deviceType", devType)" tag="device_type"/>
<attribute expression="simple;count(ref.processors)" tag="cpu_count"/>
<attribute expression="simple;count(foreach(ref.ports, this, portEx(this).portVirtualIndicator == 0))" tag="physical_interface_count"/>
<filter></filter>
</object>
</dataAccessTemplate>
Because ServiceNow is cloud-based, it will require access to your Entuity server. If your Entuity server is not accessible via the internet, you will need to configure a ServiceNow MID server, which allows ServiceNow to talk to objects within your network. The steps to configure a ServiceNow MID server are not detailed in this article.
1. Installing the data access template:
You can use a number of tools and apps to install the data access template. To install the data access template:
- Send an HTTP POST request to the Entuity server, with the payload being the data access template XML. Below is an example using curl on a Linux server. Other curl options may be required depending on your environment. You can also use other tools such as postman. From the directory where the template.xml is located, you can run:
curl -u "yourusername:yourpassword" \
Where you can replace:
"https://yourhostname/api/dataAccessTemplates?media=xml" \
-X POST \
-H "content-type: application/xml" \
-d '@template.xml'- yourusername with the username of an Entuity user.
- yourpassword with the password of the Entuity user.
- yourhostname with the hostname/IP address of the Entuity server.
When successful, you will see the XML file as a response.
2. Loading the update sets in ServiceNow:
- Log in to your ServiceNow instance.
- Click the All tab and enter 'Retrieved Update Sets', and then click Retrieved Update Sets.
- On the page that loads, go to Related Links at the bottom of the page and click Import Update Set from XML.
- On the page that loads, click Choose File and find the 'Entuity CMDB Integration.xml' file provided by Entuity support, then click Upload.
- Once the file has loaded, click the Entuity CMDB Integration link in the table.
- On the page that loads, click Preview Update Set.
- Once the preview has completed, click Close.
- Then click Commit Update Set.
- Once it has been committed, click Close.
- Under the All tab, enter 'Rest Message' and then click Rest Message.
- On the page that loads, click Entuity API from the list.
- On the Entuity API page that loads, click the search icon for the Basic auth profile field.
- In the window that open, click New in the top right corner.
- Under the Basic Auth Configuration New record form, enter an appropriate Name (e.g. 'Entuity API user') and the Username and Password of an appropriate Entuity user, and then click Submit.
- This will return you to the Entuity API page. Click Update.
If your Entuity server is not accessible via the internet, but you have set up a ServiceNow MID server, there are additional steps to take:
- Click Entuity API from the list again.
- On the Entuity API page, click Data Access Get near the bottom of the page.
- On the Data Access Get page, click the HTTP tab and then enter your MID server in the Use MID Server field, or search for it using the search icon.
- Once selected, click Update, and then on the next page click Update again.
3. Creating Scheduled Job in ServiceNow:
A Scheduled Job must be created in ServiceNow, and can be executed on demand, or scheduled to run (e.g. once per day). This job will perform the following:
- run the script that calls Entuity's API;
- process the returned data;
- insert the data into a staging table (where the data is then transformed and inserted into the CMDB table).
The import script is provided by Entuity support.
To create the Scheduled Job:
- In ServiceNow, click the All tab and enter 'Scheduled Jobs', then click the Scheduled Jobs that appears under 'System Definition'.
- On the page that loads, click New in the top right corner.
- On the next page, click Automatically run a script of your choosing.
- On the next page, specify a name for the Scheduled Job (e.g. 'Entuity CMDB import'), how often it should run, the time zone and time, etc. In the Run this script field, copy the contents of the import script.
- In the script, at line 2 ('hostname'), enter the hostname of your Entuity server:
- In the script, at line 2 ('hostname'), enter the hostname of your Entuity server:
- Once completed, click Submit at the bottom of the page.
To check the Scheduled Job is working:
You can wait for the scheduled time for the script to execute, or you can manually confirm the Scheduled Job is working:
- Under the list of Scheduled Jobs in ServiceNow, click Entuity CMDB Import (or whichever name that you gave the Scheduled Job), then click Execute Now at the bottom of the page.
- To view the result, click the All tab and enter 'Network Gear', and then click Network Gear under 'Network'.
Comments
0 comments
Please sign in to leave a comment.