Name

sn_itom_licensing.EvtMgmtLicenseCountStore

Description

No description available

Script

var EvtMgmtLicenseCountStore = Class.create();
EvtMgmtLicenseCountStore.prototype = {
  initialize: function() {},
  getNodesCount: function() {
      gs.info("ITOM Health Licensing Usage Count");
      var EMCount = this.getEMCount();
      var OICount = 0;
      var isOIInstalled = GlidePluginManager().isActive('com.snc.sa.metric');
      if (isOIInstalled) { // check if OI installed
          new ITOMHealthLicenseCounterWithOTOMStore().deletePreviousCIs();
          OICount = global.EMLicensingUtilWrapper.getCount();
      }

      var licenseUtils = new ITOMLicensingUtilsStore();
      licenseUtils.updateProductCount("Event Management", EMCount);
      licenseUtils.updateProductCount("Operational Intelligence", OICount);
  },
  getEMCount: function() {
      var gr = new GlideAggregate('em_unique_nodes');
      gr.addQuery('is_licensable', true);
      gr.addAggregate('COUNT');
      gr.query();
      var EMCount = 0;
      if (gr.next())
          EMCount = gr.getAggregate('COUNT');
      return EMCount;
  },

  type: 'EvtMgmtLicenseCountStore'
};

Sys ID

9bc1eed5538a301046dfddeeff7b12bd

Offical Documentation

Official Docs: