richardbrounste
ServiceNow Employee
ServiceNow Employee

The ServiceNow CMDB contains information on mapped Business Services, as well as an inventory of hardware and software configuration items.     Thanks to Service Mapping and Discovery, most of these CIs have relationships.   Reporting on related CIs is very important for many IT processes such as financial management and configuration management. Here are two typical reports that customers would like to run out of the CMDB:

  • On which Servers do my Business Services depend?
  • To which machines do I need to apply a certain software patch?

To get the first report, we need to query information from the following tables:

  • Business Service (cmdb_ci_service):   Stored Business Service CIs
  • Hardware (cmdb_ci_hardware):   Stored Hardware CIs
  • Service Configuration Item Association (svc_ci_assoc): Stored the many-to-many relationships between Business Services and Hardware

For the second report, we would need to query information from the tables:

  • Hardware (cmdb_ci_hardware)
  • CI Relationship (cmdb_rel_ci):   Defines all relationships between CIs
  • Application Server (cmdb_ci_app_server):   Stored Application Servers CI

Here is a diagram, which shows how these tables are related with the primary and secondary keys:

i1.png

In order to query related data, we can leverage database views in ServiceNow.   With a database view, we can create a virtual table, which is a collection of related tables. By creating a database view, a user can easily create a report just by selecting a virtual table.

  • To create the report shows a list view of Business Services and servers the Business Services depend on.

  Define a database view called: Business Service and Related Computer (u_business_services_and_related_computers), which have the relationship between the Business Service and Hardware:

i2.png

Note the individual tables and Where clauses for the Service Configuration Item Association and Hardware tables.   The order number is very important when defining the view:

i3.png

Now that this view is defined, I have a new virtual table called "Business Service and Related Computer", from which I can easily create report and select the individual fields from the tables that meet my reporting need.

In this example, the report uses the fields:   business service name, class, and hardware name.

i4.png

Here's the list view report display the business service and all servers it depend on.

i5.png

  • To create a report to help identify which machines do I need to apply a certain software patch?

Define a view that includes the relationship between Computers and the Applications running on them also related to the Business Services:

i6.png

And the new database view resulting in an easy-to-create report:

In this example, the report uses the fields:   bsvc name, cmpid, class, applsvc, and Version

i7.png

Here's the list view report show software version running on servers that supporting business services to help organization understand the risk/impact and make better decision when applying software patch.

i8.png

i9.png

Happy Reporting!

2 Comments