Federate Your CMDB With LogicMonitor

LogicMonitor Best Practices Blog

In today’s world, working in the IT department of a Fortune 500 company will almost certainly require training or certification in the Information Technology Infrastructure Library (ITIL) framework and how it relates to your company’s IT Service Management (ITSM). Simply put, ITIL is a comprehensive framework for how to run an IT organization. It is a collection of best practices that help organizations align IT services with business needs.

At the center of an ITIL deployment is a configuration management database (CMDB) which acts as a data warehouse for all configuration items (CIs) that represent IT assets in an organization. A CMDB is made up of more than just infrastructure elements; applications, business services, buildings and people can all be CIs. In the CMDB, CIs may have many attributes indicating status (i.e. active, inactive, spare, decommissioned, etc.) and business criticality (i.e. low, medium, high impact to business services). This image illustrates how the CMDB sits at the middle of an ITIL deployment:

1
The CMDB becomes the platform for enabling the various ITIL processes such as Incident Management, Change Management, and Problem Management. In the CMDB, the CIs are linked together to form relationships which can be used for reporting and analysis. For example, router, switch and server CIs can be linked to application and business service CIs, allowing Requests for Changes (RFCs) to particular infrastructure elements to show the broader impact a change will have on IT services.

So how do you keep a CMDB accurate and up-to-date? Fortunately, most CMDBs support the concept of federation; the process of synchronizing CIs from other domain-specific toolsets to keep the CMDB accurate. LogicMonitor is a prime example of an infrastructure monitoring tool that can be used to federate your CMDB. 

The ITIL software market has a range of CMDB products to fit any category: high-end, commercial (BMC, ServiceNow**, Device42) to free and open-source (iTop, OneCMDB, i-doit). Using our publicly available
LogicMonitor APIs, CMDB synchronization is possible with some scripting and customization.

**Note: The native ServiceNow Integration offered in LogicMonitor is for alerting and incident management and not CMDB integration/federation.

For demonstration purposes, we have provided sample iTop CMDB Synchronization Python scripts on our LogicMonitor GitHub showing two-way synchronization of LogicMonitor with Combodo iTop 2.2. The scripts leverage our recently-released logicmonitor_core Python module to make it easy to interact directly with your LogicMonitor portal and extract, update or add LogicMonitor device information.

To allow for independent scheduling, we have provided two sample scripts:

1. lm_itop_sync.py – synchronize LogicMonitor Server, Printer and Hypervisor devices to iTop CI classes (federation).
2. itop_lm_sync.py – synchronize iTop Server CI classes to LogicMonitor devices.

LogicMonitor devices must map to a specific CMDB CI class in order to be synchronized, we configure this using a custom property (itop.class) at the device or group level and give it a value of Server, Printer or Hypervisor:


3

4
With your iTop CMDB up and running, we execute the
lm_to_itop.py Python script to handle the following tasks:

1. Query your LogicMonitor portal to get device info as JSON.
2. Insert the device info into iTop database (MySQL) staging tables.
3. Remotely execute an iTop PHP script to merge staging database table info with production tables.

Once executed, the devices federate the CMDB as CIs with a few attributes (management IP and description).

5
Suppose your CMDB is populated from other federated sources that you want to add to LogicMonitor. The itop_to_lm.py Python script demonstrates how to synchronize CIs to LogicMonitor by handling the following tasks:

1. Create iTop device group in LogicMonitor.
2. Query iTop
CMDB to get CI information as XML.

3. Parse XML and add devices to LogicMonitor (in the iTop device group).

When adding the device to LogicMonitor, we also configure a custom property itop.source custom property with a value of yes, to prevent the new device from federating back to iTop.


6
By running these scripts on a regular schedule (for example, using cron on a Linux server***), two-way synchronization of your CMDB and LogicMonitor can occur at the same or different intervals. For example, you may not want your CMDB to synchronize CIs to LogicMonitor as frequently as having Devices federated from LogicMonitor to your CMDB. In this case, you could configure independent crontab entries:

Daily (every day at midnight) LogicMonitor to iTop CMDB federation:

0 0 * * * /usr/bin/python /path/to/lm_to_itop.py [arguments]

Weekly (every Saturday at midnight) iTop CMDB to LogicMonitor synchronization:

0 0 * * 6 /usr/bin/python /path/to/itop_to_lm.py [arguments]

***Note: Be sure to monitor your Linux server using LogicMonitor and use a
Batchjob to monitor the status of cron jobs!

The LogicMonitor APIs and Python modules can serve as building blocks for your own custom CMDB integration. This article provides further information on CMDB, CIs and ITIL.

Want to see more? Follow us here:

On Facebook
On Twitter
On LinkedIn

Or, e-mail us @ [email protected]

Bennett Borofka

Manager, Solutions Architecture

Bennett been an integral member of LogicMonitor’s Professional Services since 2015. He has over 13 year’s experience deploying and managing IT infrastructure, applications, and solutions around the globe. On the side, Bennett loves to golf, travel, camp, and explore the great outdoors.

Subscribe to our LogicBlog to stay updated on the latest developments from LogicMonitor and get notified about blog posts from our world-class team of IT experts and engineers, as well as our leadership team with in-depth knowledge and decades of collective experience in delivering a product IT professionals love.

More from LogicBlog

Let's talk shop, shall we?

Get started