Skip to content

Commit 1cac7a1

Browse files
authored
Create Non-Operational & Installed Application CI Count
Counts all application CIs where operational_status = 2 (non-operational) and install_status = 1 (installed). Outputs the total count to system logs for quick health and compliance checks.
1 parent 3006edc commit 1cac7a1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
var ga = new GlideAggregate('cmdb_ci_appl');
2+
ga.addQuery('operational_status', 2); // Non-operational
3+
ga.addQuery('install_status', 1); // Installed
4+
ga.addAggregate('COUNT');
5+
ga.query();
6+
7+
var total = 0;
8+
if (ga.next()) {
9+
total = ga.getAggregate('COUNT');
10+
}
11+
12+
gs.info('Application CIs installed but not in operational count: ' + total);

0 commit comments

Comments
 (0)