Name
global.EvtMgmtLicenseHandleUnknown
Description
After upgrading to Paris, we start using new logic for License calculation, which uses CIs from Alerts. Unknown node that was inserted by the old License calculation, can now be inserted as a server for example - This is causing us to count twice the same node. In this script we delete unknown nodes from the License Usage table. It is used in the following cases 1. After upgrade to Paris - fix script EM - handleUnknownNodes calls this script 2. If a customer is on NY or Orlando, and wants to start using the new logic for License Calculation. In case the customer upgrades to Paris, we return before deleting the nodes, since the property evt_mgmt.unknown_nodes_removed is already true.
Script
var EvtMgmtLicenseHandleUnknown = Class.create();
EvtMgmtLicenseHandleUnknown.prototype = {
initialize: function() {
},
removeUnknownNodes: function() {
var AreNodesRemoved = gs.getProperty("evt_mgmt.unknown_nodes_removed", false);
if (AreNodesRemoved == "true")
return;
var gr = new GlideRecord("em_unique_nodes");
gr.addQuery("type", "unknown");
gr.query();
gs.info("EvtMgmtLicenseHandleUnknown - deleting {0} rows from License Usage table.", gr.getRowCount());
gr.deleteMultiple();
gs.setProperty("evt_mgmt.unknown_nodes_removed", true);
},
type: 'EvtMgmtLicenseHandleUnknown'
};
Sys ID
594a453d5be2d010889dd01fb681c7c9