Using the ServiceNow Adapter Console Application
The ServiceNow Adapter Console Application is a command-line tool that provides various commands for running background and configuration tasks to extract, process, and load data from the Open iT database to the ServiceNow instance.
Displaying the ServiceNow Adapter Console Application Tasks
To show the available tasks, follow these instructions:
-
Open a command prompt and run the following command to go to the installation directory of the ServiceNow Adapter, which is by default in
C:\Program Files\OpeniT\ServiceNow Adapter\
:Examplecd "C:\Program Files\OpeniT\ServiceNow Adapter\"
-
Once in the directory, run the following command:
ExampleOpeniT.Adapter.Console.exe
This will display the available options.
OutputServiceNow Adapter for Open iT Integration, 1.0.0. Copyright 2023 Open iT, Inc. All rights reserved.
Sql Database: ServiceNow @ DESKTOP123WIN\SQL2019E
2023-09-19 23:07:04,853 +08:00 INFO Productinfo - License file is valid. "servicenow" valid until 2024-07-01 (285 days)
2023-09-19 23:07:04,926 +08:00 INFO Productinfo - ServiceNow Adapter for Open iT Integration Version: 1.0.0 (1365a986)
Usage: OpeniT.Adapter.Console <subcommand> [args]
Type 'OpeniT.Adapter.Console help <subcommand>' for help on a specific subcommand.
Available subcommands:
DeploySchema Deploy SQL database schema to either the latest or a specific version.
ProcessData Process Open iT Datatypes and load to staging tables for integration.
Configure Configure ServiceNow-required details
PushData Fetch data from Open iT Database and push to ServiceNow instance.
TestConnection Test connection to ServiceNow instance.
RunAdapter Run all processing jobsTo show the available parameters for each command, add a help parameter before the command:
ExampleOpeniT.Adapter.Console.exe help deployschema
This command displays the available options.
OutputServiceNow Adapter for Open iT Integration, 1.0.0. Copyright 2023 Open iT, Inc. All rights reserved.
Sql Database: ServiceNow @ DESKTOP123WIN\SQL2019E
2023-09-19 23:07:04,853 +08:00 INFO Productinfo - License file is valid. "servicenow" valid until 2024-07-01 (285 days)
2023-09-19 23:07:04,926 +08:00 INFO Productinfo - ServiceNow Adapter for Open iT Integration Version: 1.0.0 (1365a986)
Deploy SQL database schema to either the latest or a specific version.
usage: OpeniT.Adapter.Console DeploySchema [/version:value] [/trace]
[/version:value] Specific version to migrate to
[/trace] Enable tracing of SQL statements.
Deploying Database Schema in SQL Server (DeploySchema)
This command creates all the necessary SQL objects for data processing, including tables, stored procedures, and predefined static data for specific tables.
Instructions
-
Open a command prompt and run the following command to go to the installation directory of the ServiceNow Adapter, which is by default in
C:\Program Files\OpeniT\ServiceNow Adapter\
:Examplecd "C:\Program Files\OpeniT\ServiceNow Adapter\"
-
Once in the directory, run the following command:
ExampleOpeniT.Adapter.Console.exe DeploySchema
To further customize the command, use the optional parameters.
SyntaxOpeniT.Adapter.Console.exe DeploySchema [/version:value] [/trace]
Optional Parameters
/version:[migration_version]
This parameter limits the migration of the database to the specified version. The migration version format isYYYYMMDDHHMMSS
.ExampleOpeniT.Adapter.Console.exe DeploySchema /version:20220101143000
/trace
This parameter triggers the command to display SQL statements.ExampleOpeniT.Adapter.Console.exe DeploySchema /trace
Combine or use optional parameters at the same time to achieve necessary capabilities.
ExampleOpeniT.Adapter.Console.exe DeploySchema /version:20220101143000 /trace
-
The Console Application will display informational messages in the command prompt. Let the process run until it completes.
Processing Data from Open iT SQL Database (ProcessData)
This command fetches data from specific data types in the Analysis Server database and loads it to the ServiceNow staging tables.
Instructions
-
Open a command prompt and run the following command to go to the installation directory of the ServiceNow Adapter, which is by default in
C:\Program Files\OpeniT\ServiceNow Adapter\
:Examplecd "C:\Program Files\OpeniT\ServiceNow Adapter\"
-
Once in the directory, run the following command:
ExampleOpeniT.Adapter.Console.exe ProcessData
To further customize the command, use the optional parameter.
SyntaxOpeniT.Adapter.Console.exe ProcessData [/fullwipe]
Optional Parameter
/fullwipe
This parameter triggers the command to delete all processed and cached data.ExampleOpeniT.Adapter.Console.exe ProcessData /fullwipe
-
The Console Application will display informational messages in the command prompt. Let the process run until it completes.
Configuring ServiceNow Settings (Configure)
This command contains various subcommands to configure necessary ServiceNow settings for a successful API connection.
Instructions
-
Open a command prompt and run the following command to go to the installation directory of the ServiceNow Adapter, which is by default in
C:\Program Files\OpeniT\ServiceNow Adapter\
:Examplecd "C:\Program Files\OpeniT\ServiceNow Adapter\"
-
Once in the directory, run the following command:
ExampleOpeniT.Adapter.Console.exe Configure
The console application will display the available options.
ExampleServiceNow Adapter for Open iT Integration, 1.0.0. Copyright 2023 Open iT, Inc. All rights reserved.
Sql Database: ServiceNow @ DESKTOP123WIN\SQL2019E
2023-09-19 19:14:52,194 +08:00 INFO Productinfo - License file is valid. "servicenow" valid until 2024-07-01 (285 days)
2023-09-19 19:14:53,243 +08:00 INFO Productinfo - ServiceNow Adapter for Open iT Integration Version: 1.0.0 (1365a986)
Current ServiceNow Configurations
ServiceNow Instance URI: https://dev165816.service-now.com/
Authentication Type: basic
Username: user1
[1]: Set ServiceNow instance URI
[2]: Set Authentication
[3]: Test Connection
[4]: Save configuration
[0]: Exit
Select: -
Select from options 1 to 4, then press Enter.
-
The Console Application will display informational messages in the command prompt. Let the process run until it completes.
Setting the ServiceNow Instance URI
This Configure subcommand updates the value of the ServiceNow instance URI. The initial value is the one provided during installation.
Instructions
-
Follow the instructions in the Configure section.
-
Select option 1.
-
Provide a valid ServiceNow instance URI.
ExampleServiceNow Adapter for Open iT Integration, 1.0.0. Copyright 2023 Open iT, Inc. All rights reserved.
Sql Database: ServiceNow @ DESKTOP123WIN\SQL2019E
2023-09-19 19:14:52,194 +08:00 INFO Productinfo - License file is valid. "servicenow" valid until 2024-07-01 (285 days)
2023-09-19 19:14:53,243 +08:00 INFO Productinfo - ServiceNow Adapter for Open iT Integration Version: 1.0.0 (1365a986)
Current ServiceNow Configurations
ServiceNow Instance URI: https://dev165816.service-now.com/
Authentication Type: basic
Username: user1
[1]: Set ServiceNow instance URI
[2]: Set Authentication
[3]: Test Connection
[4]: Save configuration
[0]: Exit
Select:1
ServiceNow instance URI [https://dev165816.service-now.com/]:The current ServiceNow instance URI is displayed inside the square brackets. Press Enter to use the value.
noteTest the newly provided ServiceNow instance URI with the configured authentication using the Test Connection subcommand.
-
Select option 4 to save the changes.
The application will test the connection using the provided configuration. If the connection fails, a prompt will be displayed.
Example[1]: Set ServiceNow instance URI
[2]: Set Authentication
[3]: Test Connection
[4]: Save configuration
[0]: Exit
Select: 4
2023-09-19 19:35:10,352 +08:00 INFO Actions - ServiceNow URI:
https://dev165816.service-now.com/
2023-09-19 19:35:10,370 +08:00 INFO Actions - Authentication
Type: basic
2023-09-19 19:35:10,385 +08:00 INFO Actions - Validating supplied/saved configurations.
2023-09-19 19:35:10,395 +08:00 INFO Actions - Testing supplied configurations...
2023-09-19 19:35:11,872 +08:00 ERROR Actions - Credentials supplied is invalid!
2023-09-19 19:35:11,890 +08:00 ERROR Actions - Connect response:
{"error":{"message":"User Not Authenticated","detail":"Required to provide Auth information"},"status":"failure"}
2023-09-19 19:35:11,899 +08:00 ERROR Actions - Cannot connect using supplied credentials!
Would like to continue saving [y/n]? [y]:
-
Type y (or press Enter) to continue saving. Let the process run until it completes.
After configuring the new ServiceNow instance URI, follow the ServiceNow Adapter Post-Installation Configuration steps.
Setting Authentication to Basic Authentication
This Configure subcommand updates the Authentication Type to Basic Authentication and the credentials to connect to the ServiceNow instance.
Instructions
-
Follow the instructions in the Configure section.
-
Select option 2.
-
The available Authentication Types will be displayed. Select 1.
ExampleServiceNow Adapter for Open iT Integration, 1.0.0. Copyright 2023 Open iT, Inc. All
rights reserved. http://www.openit.com
Sql Database: ServiceNow @ DESKTOP123WIN\SQL2019E
2023-09-19 23:07:04,853 +08:00 INFO Productinfo - License file is valid. "servicenow" valid until 2024-07-01 (285 days)
2023-09-19 23:07:04,926 +08:00 INFO Productinfo - ServiceNow Adapter for Open iT Integration Version: 1.0.0 (1365a986)
Current ServiceNow Configurations
ServiceNow Instance URI: https://dev165816.service-now.com/
Authentication Type: basic
Username: user1
[1]: Set ServiceNow instance URI
[2]: Set Authentication
[3]: Test Connection
[4]: Save configuration
[0]: Exit
Select: 2
Set ServiceNow Authentication Type
[1]: Basic Authentication
[2]: Bearer Authentication
[3]: Oauth2 Authentication
[0]: Exit
Select [1][basic]:1The current authentication type is displayed inside the square brackets.
Press Enter to proceed with new value.
-
Provide the credentials.
ExampleBasic Authentication Details
Username: user1
Password (in clear text): p@$$w0RdnoteTest the newly provided authentication with the configured ServiceNow Instance URI using the Test Connection subcommand.
-
Select option 4 to save the changes.
The application will test the connection using the provided configuration. If the connection fails, a prompt will be displayed.
Example[1]: Set ServiceNow instance URI
[2]: Set Authentication
[3]: Test Connection
[4]: Save configuration
[0]: Exit
Select: 4
2023-09-19 19:35:10,352 +08:00 INFO Actions - ServiceNow URI:
https://dev165816.service-now.com/
2023-09-19 19:35:10,370 +08:00 INFO Actions - Authentication
Type: basic
2023-09-19 19:35:10,385 +08:00 INFO Actions - Validating supplied/saved configurations.
2023-09-19 19:35:10,395 +08:00 INFO Actions - Testing supplied configurations...
2023-09-19 19:35:11,872 +08:00 ERROR Actions - Credentials supplied is invalid!
2023-09-19 19:35:11,890 +08:00 ERROR Actions - Connect response:
{"error":{"message":"User Not Authenticated","detail":"Required to provide Auth information"},"status":"failure"}
2023-09-19 19:35:11,899 +08:00 ERROR Actions - Cannot connect using supplied credentials!
Would like to continue saving [y/n]? [y]: -
Type y (or press Enter) to continue saving. Let the process run until it completes.
Setting Authentication to Bearer Authentication
This Configure subcommand updates the Authentication Type to Bearer Authentication and the credentials to connect to the ServiceNow instance.
Instructions
-
Follow the instructions in the Configure section.
-
Select option 2.
-
The available Authentication Types will be displayed. Select 2.
ExampleServiceNow Adapter for Open iT Integration, 1.0.0. Copyright 2023 Open iT, Inc. All
rights reserved. http://www.openit.com
Sql Database: ServiceNow @ DESKTOP123WIN\SQL2019E
2023-09-19 23:07:04,853 +08:00 INFO Productinfo - License file is valid. "servicenow" valid until 2024-07-01 (285 days)
2023-09-19 23:07:04,926 +08:00 INFO Productinfo - ServiceNow Adapter for Open iT Integration Version: 1.0.0 (1365a986)
Current ServiceNow Configurations
ServiceNow Instance URI: https://dev165816.service-now.com/
Authentication Type: basic
Username: user1
[1]: Set ServiceNow instance URI
[2]: Set Authentication
[3]: Test Connection
[4]: Save configuration
[0]: Exit
Select: 2
Set ServiceNow Authentication Type
[1]: Basic Authentication
[2]: Bearer Authentication
[3]: Oauth2 Authentication
[0]: Exit
Select [2][bearer]: 2The current authentication type is displayed inside square brackets.
Press Enter to proceed with new value.
-
Provide the Bearer Token.
ExampleBearer Authentication Details
Bearer Token (in clear text): YmvtmaPJrVB_gLfUdGgMZkM_DPLROwKKc8TtSSBEqP4DbbZjfuN4zUDIH3ht2jjRFnoteTest the newly provided authentication with the configured ServiceNow Instance URI using the Test Connection subcommand.
-
Select option 4 to save the changes.
The application will test the connection using the provided configuration. If the connection fails, a prompt will be displayed.
Example[1]: Set ServiceNow instance URI
[2]: Set Authentication
[3]: Test Connection
[4]: Save configuration
[0]: Exit
Select: 4
2023-09-19 19:35:10,352 +08:00 INFO Actions - ServiceNow URI: https://dev165816.service-now.com/
2023-09-19 19:35:10,370 +08:00 INFO Actions - Authentication Type: bearer
2023-09-19 19:35:10,385 +08:00 INFO Actions - Validating supplied/saved configurations.
2023-09-19 19:35:10,395 +08:00 INFO Actions - Testing supplied configurations...
2023-09-19 19:35:11,872 +08:00 ERROR Actions - Credentials supplied is invalid!
2023-09-19 19:35:11,890 +08:00 ERROR Actions - Connect response:
{"error":{"message":"User Not Authenticated","detail":"Required to provide Auth information"},"status":"failure"}
2023-09-19 19:35:11,899 +08:00 ERROR Actions - Cannot connect using supplied credentials!
Would like to continue saving [y/n]? [y]: -
Type y (or press Enter) to continue saving. Let the process run until it completes.
Setting Authentication to OAuth2 Authentication
This Configure subcommand updates the Authentication Type to OAuth2 Authentication and the credentials to connect to the ServiceNow instance.
Instructions
-
Follow the instructions in the Configure section.
-
Select option 2.
-
The available Authentication Types will be displayed. Select 3.
ExampleServiceNow Adapter for Open iT Integration, 1.0.0. Copyright 2023 Open iT, Inc. All rights reserved. http://www.openit.com
Sql Database: ServiceNow @ DESKTOP123WIN\SQL2019E
2023-09-19 23:19:14,492 +08:00 INFO Productinfo - License file is valid. "servicenow" valid until 2024-07-01 (285 days)
2023-09-19 23:19:14,593 +08:00 INFO Productinfo - ServiceNow Adapter for Open iT Integration Version: 1.0.0 (1365a986)
Current ServiceNow Configurations
ServiceNow Instance URI: https://dev165816.service-now.com/
Authentication Type: basic
Username: user1
[1]: Set ServiceNow instance URI
[2]: Set Authentication
[3]: Test Connection
[4]: Save configuration
[0]: Exit
Select: 2
Set ServiceNow Authentication Type
[1]: Basic Authentication
[2]: Bearer Authentication
[3]: Oauth2 Authentication
[0]: Exit
Select [3][oauth2]: 3The current authentication type is displayed inside the square brackets.
Press Enter to proceed with new value.
-
Provide the credentials.
ExampleOauth2 Authentication Details
Username: user1
Password (in clear text): p@$$w0Rd
Client Id: 9390a749d288f1109b4f0825be53a43a
Client Secret (in clear text): s3cReTnoteTest the newly provided authentication with the configured ServiceNow Instance URI using the Test Connection subcommand.
-
Select option 4 to save the changes.
The application will test the connection using the provided configuration. If the connection fails, a prompt will be displayed.
Example[1]: Set ServiceNow instance URI
[2]: Set Authentication
[3]: Test Connection
[4]: Save configuration
[0]: Exit
Select: 4
2023-09-19 19:35:10,352 +08:00 INFO Actions - ServiceNow URI: https://dev165816.service-now.com/
2023-09-19 19:35:10,370 +08:00 INFO Actions - Authentication Type: oauth2
2023-09-19 19:35:10,385 +08:00 INFO Actions - Validating supplied/saved configurations.
2023-09-19 19:35:10,395 +08:00 INFO Actions - Testing supplied configurations...
2023-09-19 19:35:11,872 +08:00 ERROR Actions - Credentials supplied is invalid!
2023-09-19 19:35:11,890 +08:00 ERROR Actions - Connect response:
{"error":{"message":"User Not Authenticated","detail":"Required to provide Auth information"},"status":"failure"}
2023-09-19 19:35:11,899 +08:00 ERROR Actions - Cannot connect using supplied credentials!
Would like to continue saving [y/n]? [y]:
-
Type y (or press Enter) to continue saving. Let the process run until it completes.
Testing the Connection
This Configure subcommand triggers a test connection to the ServiceNow instance using the current session’s configuration. This is useful for verifying the settings before saving them.
Instructions
-
Follow the instructions in the Configure section.
-
Select option 3.
ExampleServiceNow Adapter for Open iT Integration, 1.0.0. Copyright 2023 Open iT, Inc. All rights reserved. http://www.openit.com
Sql Database: ServiceNow @ DESKTOP123WIN\SQL2019E
2023-09-19 23:19:14,492 +08:00 INFO Productinfo - License file is valid. "servicenow" valid until 2024-07-01 (285 days)
2023-09-19 23:19:14,593 +08:00 INFO Productinfo - ServiceNow Adapter for Open iT Integration Version: 1.0.0 (1365a986)
Current ServiceNow Configurations
ServiceNow Instance URI: https://dev165816.service-now.com/
Authentication Type: basic
Username: user1
[1]: Set ServiceNow instance URI
[2]: Set Authentication
[3]: Test Connection
[4]: Save configuration
[0]: Exit
Select: 3The application tests the connection using the ServiceNow instance URI and authentication details from the current session. If no values are set in the session, it uses the existing configuration.
On success, it displays Connection Successful. On failure, it shows Connection Failed along with details about the error.
Testing the Connection to the ServiceNow Instance
This command triggers a connection test to the ServiceNow instance.
Make sure that all ServiceNow configurations (i.e., Instance URI, Authentication Type, and Credentials) are properly configured.
Instructions
-
Open a command prompt and run the following command to go to the installation directory of the ServiceNow Adapter, which is by default in
C:\Program Files\OpeniT\ServiceNow Adapter\
:Examplecd "C:\Program Files\OpeniT\ServiceNow Adapter\"
-
Once in the directory, run the following command:
ExampleOpeniT.Adapter.Console.exe TestConnection
-
The Console Application will display informational messages in the command prompt. Let the process run until it completes.
Sending Processed Data to the ServiceNow Instance (PushData)
This command fetches data from various Open iT data types in the Open iT database and sends it to the ServiceNow instance.
Make sure that all ServiceNow configurations (i.e., Instance URI, Authentication Type, and Credentials) are properly configured.
Instructions
-
Open a command prompt and run the following command to go to the installation directory of the ServiceNow Adapter, which is by default in
C:\Program Files\OpeniT\ServiceNow Adapter\
:Examplecd "C:\Program Files\OpeniT\ServiceNow Adapter\"
-
Once in the directory, run the following command:
ExampleOpeniT.Adapter.Console.exe PushData
-
The Console Application will display informational messages in the command prompt. Let the process run until it completes.
Running All Adapter Processing Jobs (RunAdapter)
This command combines the data processing commands – ProcessData and PushData, enabling scheduling of background data processing and sending.
Instructions
-
Open a command prompt and run the following command to go to the installation directory of the ServiceNow Adapter, which is by default in
C:\Program Files\OpeniT\ServiceNow Adapter\
:Examplecd "C:\Program Files\OpeniT\ServiceNow Adapter\"
-
Once in the directory, run the following command:
ExampleOpeniT.Adapter.Console.exe RunAdapter
To further customize the command, use the optional parameter.
SyntaxOpeniT.Adapter.Console.exe RunAdapter [/fullwipe]
Optional Parameter
/fullwipe
This parameter triggers the command to wipe all processed and cached data before loading and processing data.ExampleOpeniT.Adapter.Console.exe RunAdapter /fullwipe
-
The Console Application will display informational messages in the command prompt. Let the process run until it completes.
ServiceNow Adapter Console Configuration
Use these procedures to configure how the ServiceNow Adapter extracts, processes, and retains data.
Configuring the Data Extraction Range (Month Offset)
The ServiceNow Adapter extracts and processes 3 months of data by default, covering the current month and the previous two (2) months.
For example, if the current month is October, it will extract data from August to October.
To set the number of month offset, follow these instructions:
-
Log in to the Open iT Analysis Server web interface.
-
Go to Administration > Configuration.
-
Locate the configuration key
Root.ServiceNow.MonthOffset
. -
Click the value to make it editable.
-
Set the value to the desired number of months to include in extraction and processing.
-
Click Save to apply the changes.
Setting Months Offset
-
Click the Reset Session button at the bottom of the configuration table.
ServiceNow Integration: Reset Session
Configuring Data Retention (Keep Stale Record)
The ServiceNow Adapter keeps data active for 90 days by default. Data not seen within this period are marked as inactive.
To set the number of days to keep unseen data, follow these instructions:
-
Log in to the Open iT Analysis Server web interface.
-
Go to Administration > Configuration.
-
Locate the configuration key
Root.ServiceNow.KeepStaleRecord
. -
Click the value to make it editable.
-
Set the value to the desired maximum number of days to keep stale data.
-
Click Save to apply the changes.
Setting Keep Stale Record
-
Click the Reset Session button at the bottom of the configuration table.
Reset Session