ServiceNow cmdb_ci table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 02:49 AM
Does cmdb_ci table contains all the company managed devices data? Also, can we apply any filter on cmdb_ci table to fetch company managed devices data?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 09:44 AM - edited 09-06-2023 09:50 AM
Yes and no. The cmdb_ci table itself is the base table for all CI tables in the CMDB. And the way that ServiceNow works, a record stored in a table is also stored in its parent table, and that table's parent table, and so on.
So, given that Hardware (cmdb_ci_hardware) extends Configuration Item (cmdb_ci), and that Computer (cmdb_ci_computer) extends Hardware, if you ask does the Configuration Item table contain all of the Computers? Yes, it does. Every Computer record can be found in the Configuration Item table. However, it doesn't contain all of the data. Some of the data is only found in the Hardware table, and some of the data is only found in the Computer table. Why? Because every class (i.e. table) actually inherits all of the attributes of its parent table and can add additional attributes. So to get Hardware-specific attributes like Hardware Status, which are not found on the base Configuration Item table, you would have to query either the Hardware or Computer table. And to get Computer-specific attributes, like CPU Type, you would have to query the Computer table itself.
So, does the cmdb_ci table contain all of the company managed devices? Yes (assuming by "managed" you mean that they are actually recorded in the CMDB.) Doe the cmdb_ci table contain all of the company managed devices data? Well, no, not all of the data. If you show a list of Configuration Items, you won't be able to see the CPU Type, for example. And therefore you won't be able to filter it either. But if you open a record displayed in that list, it will actually take you to the appropriate table where all of the data can be found. Below is an image showing the table structure as described.
That might have been a more literal answer than the question you intended to asked, but I thought it was worth explaining.
The opinions expressed here are the opinions of the author, and are not endorsed by ServiceNow or any other employer, company, or entity.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2023 10:39 PM
@CMDB Whisperer Thanks for the detailed answer.
Also, as per ServiceNow documentation, "The Configuration Management Database (CMDB) schema model is a series of connected tables that contain all the assets and business services controlled by a company and its configurations",
As per our requirement, we need to fetch only assets data. Is it possible to apply any filter or query to fetch only assets data from cmdb_ci table and not the business services data?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2023 11:01 PM
In ServiceNow the asset data is on the Asset record. Asset records should be created automatically for new CIs. So if you strictly want the Asset data, you need only to query the Assets themselves. On the other hand, by definition, a Configuration Item defines how that Asset is configured and used to provide services. And thus, any Service Management process you are using, including Incidents, Problems, Changes, etc. will always reference the Configuration Item. The Configuration Item contains some of the Asset data as some fields are synchronized between the two tables automatically, so depending on your needs and how you are viewing the data you can certainly select what data fields to view, and you can even "dot-walk" to the Asset record and see additional fields from the Asset, even when you are viewing the CI.
So the short answer is yes.
The opinions expressed here are the opinions of the author, and are not endorsed by ServiceNow or any other employer, company, or entity.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2023 10:28 AM
@CMDB Whisperer are you referring to the alm_asset table? We had referred this table before, but it does not contain few of the fields which we need like mac address or ip address. Is there a way we can get assets data along with this fields? Or can we use cmdb_ci table with any filter for assets?