ITOM License consumption for Unresolved Objects?

Vini
Giga Guru

Hi,

 

Implemented Event Management with source PRTG tool, We been received events on Event Rules and those rules are captured in "Unresolved Objects" and consume Licenses.

These entries are available in License Usage table "em_unique_nodes", since these are not actual nodes, how to remove these entries.

1 ACCEPTED SOLUTION

Vini
Giga Guru

Using sample script specified in KB0761165

(https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0761165),

created the script below that can performed under:
https://instance.service-now.com/sys,scripts.do

Note: As per KB article mentioned, you can test scriptby setting dryRun variable to TRUE:

When dryRun = true, the script is in testing mode (no deletes) and will only identify and log duplicates to be removed.
When dryRun = false, the script will delete the duplicates it identifies

-------SCRIPT------------------
var StringUtil = GlideStringUtil;
var dryRun = true;
var deletedRecords = 0;

var gr = new GlideRecord("em_unique_nodes");
gr.addQuery("type", "Unknown");
gr.orderBy("node");
gr.query();

var node;
while (gr.next()){
node=gr.getValie("node");
gs.info("Going to remove unknown record with node: " + node);
if(!dryRun){
gr.deleteRecord();
}
this.deletedRecords++;
}


gs.info("Total records been deleted: " + this.deletedRecords);

View solution in original post

2 REPLIES 2

Vini
Giga Guru

Using sample script specified in KB0761165

(https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0761165),

created the script below that can performed under:
https://instance.service-now.com/sys,scripts.do

Note: As per KB article mentioned, you can test scriptby setting dryRun variable to TRUE:

When dryRun = true, the script is in testing mode (no deletes) and will only identify and log duplicates to be removed.
When dryRun = false, the script will delete the duplicates it identifies

-------SCRIPT------------------
var StringUtil = GlideStringUtil;
var dryRun = true;
var deletedRecords = 0;

var gr = new GlideRecord("em_unique_nodes");
gr.addQuery("type", "Unknown");
gr.orderBy("node");
gr.query();

var node;
while (gr.next()){
node=gr.getValie("node");
gs.info("Going to remove unknown record with node: " + node);
if(!dryRun){
gr.deleteRecord();
}
this.deletedRecords++;
}


gs.info("Total records been deleted: " + this.deletedRecords);

Kim Rasmussen
ServiceNow Employee
ServiceNow Employee

The Script is used for cleanup if something was wrong. You should in general not modify the em_unique_nodes table.

The proper way if you keep on getting the Events is to make sure the Events is probably linked to a CI and that CI is properly Classified.