Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This script checks data completeness in the CMDB by identifying missing key fields (like `os` and `location`) across selected CI classes (e.g., servers, applications). It counts how many CIs exist per class and how many are missing each field, helping administrators quickly spot and address data quality issues. This supports CMDB health, audit readiness, and overall data reliability.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
var classes = ['cmdb_ci_win_server', 'cmdb_ci_appl', 'cmdb_ci_computer'];
var fields = ['os', 'location'];

classes.forEach(function(className) {
var total = new GlideAggregate(className);
total.addAggregate('COUNT');
total.query();
var totalCount = total.next() ? total.getAggregate('COUNT') : 0;

fields.forEach(function(field) {
var missing = new GlideAggregate(className);
missing.addNullQuery(field);
missing.addAggregate('COUNT');
missing.query();
var missingCount = missing.next() ? missing.getAggregate('COUNT') : 0;

gs.print(className + ' | Missing ' + field + ': ' + missingCount + ' / ' + totalCount);
});
});
Loading