Setting Event Management Threshold

Looper23
Tera Contributor

I have a requirement where I need to not create an Alert for the same node if I get a Clear from it within 10 minutes. So for example I receive an Event for Node1 at 10:23:00 with Severity as Major. Then at 10:25:00, I receive another Event from Node1 with Severity as Clear. How do I set Threshold so it doesn't create an Alert but only creates it if the Event came in at 10:33:00 or after for the same Node.

7 REPLIES 7

Snehangshu Sark
Mega Guru

Hi @Looper23,

 

You can do this in many ways, how do you get the event? via email, API call?

As per my suggestion, you can use the sys_created_on field to compare with the current time and see if it passes the 10 mins. If yes, then you can create/reopen a task or update/skip the existing one.

var currentTime = new GlideDateTime();   // current datetime
var createdOn = new GlideDateTime(gr.getValue("sys_created_on")); // convert sys_created_on to datetime datatype
createdOn.addSeconds(600);   // add 10 minutes i.e. 600 seconds
var diff = parseInt(gs.dateDiff(currentTime, createdOn, true));  //compare two times
if(diff > 600){      // check if the time duration is less than 10 mins
	//create/reopen
}
else{
	//update the existing one
}

 

Regards,

Snehangshu Sarkar

 

Please mark an appropriate response as correct if my answer replied to your question.

Is this supposed to be a Business Rule? 

VaranAwesomenow
Mega Sage