Configuring ServiceNow Observer jobs
Using the ServiceNow Observer job, you can retrieve the configuration management database (CMDB) data from ServiceNow via REST API, using basic authentication credentials.
Before you begin
Ensure you have the ServiceNow service details to hand, such as username, password, and URL
Ensure your user account has the rest_api_explorer
and
web_service_admin
roles. These roles are required to access the resources from
ServiceNow.
cmdb_read
service_viewer
The ServiceNow Observer is installed as part of the core installation procedure.
- Log into the ServiceNow instance using an admin account.
- Navigate to User Adminstration and select Users
from the menu.
- To create a new user, click New.
- To edit an existing user, search for and then select the user.
- From the user's information tab, select the Roles tab, then click Edit.
- Assign the required roles to the user.
- Click Save, then Update.
Specify cmdb_ci_{name} tables to discover using the ServiceNow tables to be discovered parameter.
Follow these steps to run ServiceNow glide script that lists availabe cmdb_ci tables. Admin access is required to run the script.
- Login to the Servicenow instance as the admin user.
- Go to
- Paste the following script into the text
box:
var g = new GlideAggregate('cmdb_ci'); g.addAggregate('COUNT', 'sys_class_name') g.orderByAggregate('COUNT', 'sys_class_name'); g.query(); while (g.next()) { gs.info(g.sys_class_name + ': ' + g.getAggregate('COUNT', 'sys_class_name')); }
- Run the script.
- Servicenow will list all cmdb_ci tables in the environment. Sample
output:
*** Script: cmdb_ci_spkg: 1767 *** Script: cmdb_ci_computer: 814 *** Script: cmdb_ci_service: 41 *** Script: cmdb_ci_printer: 28 *** Script: cmdb_ci_server: 19 *** Script: cmdb_ci_win_cluster_node: 14 *** Script: cmdb_ci_database: 13 *** Script: cmdb_ci_web_server: 9 *** Script: cmdb_ci_win_server: 8 *** Script: cmdb_ci_unix_server: 7 *** Script: cmdb_ci_ups: 6 *** Script: cmdb_ci_email_server: 5 *** Script: cmdb_ci_netgear: 5 *** Script: cmdb_ci_rack: 5 *** Script: cmdb_ci_zone: 5 *** Script: cmdb_ci_linux_server: 4 *** Script: cmdb_ci_win_cluster: 4 *** Script: cmdb_ci_cluster_node: 3 *** Script: cmdb_ci_ip_router: 3 *** Script: cmdb_ci_msd: 3 *** Script: cmdb_ci_network_adapter: 3 *** Script: cmdb_ci_aix_server: 2 *** Script: cmdb_ci_computer_room: 2 *** Script: cmdb_ci_disk: 2 *** Script: cmdb_ci_peripheral: 2 *** Script: cmdb_ci: 1 *** Script: cmdb_ci_appl: 1 *** Script: cmdb_ci_app_server_java: 1 *** Script: cmdb_ci_cluster: 1 *** Script: cmdb_ci_datacenter: 1 *** Script: cmdb_ci_db_mysql_catalog: 1 *** Script: cmdb_ci_db_ora_catalog: 1 *** Script: cmdb_ci_ip_switch: 1 *** Script: cmdb_ci_service_group: 1 *** Script: cmdb_ci_storage_switch: 1
About this task
ServiceNow jobs retrieve the configuration management database (CMDB) data from ServiceNow via REST API. The Observer loads and updates the resources and their relationships within the Netcool Agile Service Manager core topology service.
- /api/now/table/cmdb_ci_service_discovered (services data)
- /api/now/table/cmdb_rel_ci (connectivity information for inventory data)
- /api/now/table/cmdb_ci_service_calculated (calculated service data)
- /api/now/table/cmdb_ci_query_based_service (query-based service data)
cmdb_ci
, as well as the following resource: - /api/now/table/sys_user (user data)
- ServiceNow job
- By default, these jobs are one-off, transient jobs that carry out a full upload of all requested topology data when they are triggered.
ServiceNow object types | Entity types |
---|---|
cmdb_ci, cmdb_ci_service_discovered | based on sys_class_name attribute |
sys_user | person |