Importing Servers from ServiceNow into Checkmk with CMDB Syncer

Table of Contents
Introduction #
Managing IT assets efficiently requires robust synchronization between Configuration Management Databases (CMDB) and monitoring tools. CMDB Syncer is a powerful open-source tool designed to automate the integration of host data across various systems, including Checkmk and ServiceNow. In this post, we’ll explore how to use CMDB Syncer to import server data from ServiceNow via its REST API and sync it with Checkmk.
Prerequisites #
Before getting started, ensure you have:
- A running instance of ServiceNow with API access (for demo purposes, I use a developer instance with demo data)
- CMDB Syncer 3.8.x or newer installed and configured
- Checkmk monitoring 2.3.x set up to receive host data
- API credentials with appropriate permissions in ServiceNow
Step 1: Configuring ServiceNow API Access #
To enable CMDB Syncer to pull data from ServiceNow, follow these steps:
Create a ServiceNow User for API access
- Navigate to User Admin > Users in ServiceNow.
- Create a new user with read permissions for the CMDB tables.
- Assign the rest_api_explorer and cmdb_read roles.
- Set a password.
ServiceNow User Creation Identify the CMDB Table
- In ServiceNow, CMDB data is stored in tables like cmdb_ci_server. If you just need Linux servers, use cmdb_ci_linux_server or cmdb_ci_win_server for Windows servers.
- Use the REST API Explorer to test API queries (/api/now/table/cmdb_ci_server).
ServiceNow REST API Explorer
Step 2: Configuring CMDB Syncer #
CMDB Syncer allows modular imports. The REST API is best suited for importing data from ServiceNow.
Within CMDB Syncer, create a new account (Accounts -> Create). Use the following parameters:
Settings Description My Example Name Choose a name for the Account name like “ServiceNow” Type Type of API use “Remote Rest API” Is Master Master object (not overwritten) yes Address HTTPS Endpoint https://<INSTANCE>.service-now.com/api/now/table/cmdb_ci_server Username User Login your ServiceNow user, e.g., “api_ro_bytingbytes” Password User Password <your secret password> auth_type Authentication Type use “Basic” as auth type hostname_field Field name for hostname most common fit will be “name” Everything else is set to default values.
CMDB Syncer Account View
Step 3: Test sync #
To test the setup, just use the cmdbsyncer command. Optionally, run the command with the parameter “–debug” to get more information in case of errors.
$ ./helper shell
Start Container Shell
/srv # ./cmdbsyncer rest import_hosts ServiceNow
If everything is set up correctly, the servers are imported:
Within the CMDB Syncer frontend, it should look like this if you go to “Hosts”:
For each server you can check the data which got imported:
Step 4: Automate the sync process #
To ensure regular updates, set up a cron job. This will update and sync new assets regularly.
CHECK_FOR_VALID_HOSTNAME
in local_config.py
to False. However, this might lead to other issues later on.Step 5: Checkmk Exports #
For detailed instructions on exporting hosts and attributes to Checkmk, refer to the CMDB Syncer Checkmk Documentation.
Conclusion #
CMDB Syncer simplifies the process of integrating ServiceNow CMDB data with monitoring tools like Checkmk. By automating the import process, you can ensure real-time asset visibility, reduce manual intervention, and improve infrastructure monitoring efficiency.
Looking to enhance your setup? Explore CMDB Syncer’s plugin API and custom rule configurations for deeper integrations!