CMDB Query Builder With Reporting

What I will cover in this post

  1. Overview of CMDB Query Builder
  2. How to create complex query
  3. Will generate report which will help to make better business decision.
  4. CMDB Query Builder feature.
  5. Use cases like simple, complex, multilevel etc.

CMDB Query Builder feature

  • We can create simple or complex queries to get data from any table (class) in CMDB.

Ex. Find all SQL database instances running on server.

  • We can make queries for Non-CMDB table which have reference to CMDB table / classes.

Ex. Find all windows server which have Incident/Problem/Change created for.

  • We can schedule the query execution and result can be share to email.
  • Performance Analytics (PA) and Standard report can be generated and same we can bring on dashboard.
  • We can allow multiple user to run the query independently, like report.  

  • Roles:

Cmdb_query_builder : Folks having this role can create, save, run and delete the queries.

Cmdb_query_builder_read: Folks having this role can view and run the saved queries.

Note: If your queries have non-cmdb table then you have to grant additional role depending on the table.

ITIL role will work on most of the cases.

It is recommended to use filters on tables for faster execution and limiting the result for better understanding.

Use Case

  • Find all SQL database instances running on computers.

  • Find all windows clusters which are indirectly connected with Vmware Virtual Machine Instances

  • Saved Query in CMDB groups: Let’s say we want to apply patch to all windows server which connect to databases.

  • Create query with Non-CMDB Tables: Let’s say, we want to see all application server which has active incident and change request.

  • Import and export the query
  • Create Report
  • Add Tag on your query, it will help you to search by tag name.
  • Execute query using script:
    • Starting from Orlando, you can execute saved queries from server-side script using CMDBQueryBuilderAPI
    • Open up ‘Scripts – Background’ and run below query : gs.log(SNC.CMDBQueryBuilderAPI.getSavedQueryExecutionDetails(Query Builder Name’, true));
    • You can use GlideRecord or Table APIs to retrieve data from result table.

CMDB Query Builder Additional Information

https://hi.service-now.com/kb_view.do?sysparm_article=KB0681251

LEAVE A REPLY

Please enter your comment!
Please enter your name here