Name
global.EvtMgmtUpdateCisCount
Description
This script counts the number of cis in the cmdb_ci table
Script
gs.include('EvtMgmtCommons');
var EvtMgmtUpdateCisCount = Class.create();
EvtMgmtUpdateCisCount.prototype = {
initialize: function() {
this.evtMgmtCommons = new EvtMgmtCommons();
},
execute: function() {
var gr = new GlideAggregate('cmdb_ci');
gr.addAggregate('COUNT');
gr.setCategory("list");//routing query to read replica
gr.query();
if (gr.next()) {
var count = gr.getAggregate('COUNT');
this.evtMgmtCommons.setHashGr("cis_count", count);
}
},
type: 'EvtMgmtUpdateCisCount'
};
Sys ID
0dcaf75e87d91110e77fedfc8bbb351c