NetXMS Support Forum

English Support => General Support => Topic started by: MarkusO on June 17, 2016, 02:49:17 PM

Title: Polls needed for deactivation event 'rearm-event' in THRESHOLD configuration
Post by: MarkusO on June 17, 2016, 02:49:17 PM
I know how to configure the number of polls needed for an activation event in THRESHOLD configuration. This is the 'samples' field.


Can this also be done for the number of polls needed for a deactivation event in THRESHOLD configuration.


At the moment when i have a look at the logging values of  a DCI with a threshold set i can see that a deactivation event already occurs after 1 poll with a value below the set threshold.
I would like to set the number of polls needed for a deactivation event  (rearm-event) to for example 5.

Anyone any suggestions?
Thanks in advance.
Title: Re: Polls needed for deactivation event 'rearm-event' in THRESHOLD configuration
Post by: Tatjana Dubrovica on July 05, 2016, 06:50:13 PM
For now there is no easy solution for it. I have created bug about it: https://dev.raden.solutions/issues/1253

One of non trivial solutions can be:
Create script DCI that will return 1 if threshold should be generated and 0 if deactivation event should be generated. And count everything by yourselves(it should be working but "dirty" solution).

Something like this(have not tested this):
value = GetDCIValue($node, FindDCIByName($node, "Agent log status"));
if(value != null)
{
   attr = GetCustomAttribute($node, "NormalStateSampleCount");
   count = 5;
   if(attr != null)
   {
      count = int32(attr);
   }
   if(int32(value) > 5) //Activation event should be generated
   {
      SetCustomAttribute($node, "NormalStateSampleCount", "0");
      return 1;
   }
   
   if(int32(value) < 5)
   {
      count++;
      SetCustomAttribute($node, "NormalStateSampleCount", "0");
      if(count == 5) //Deactivation event should be generated
      {
         return 0;
      }
      return 1;
   }   
}

SetCustomAttribute($node, "NormalStateSampleCount", "0");
return 1;
Title: Re: Polls needed for deactivation event 'rearm-event' in THRESHOLD configuration
Post by: MarkusO on July 13, 2016, 04:26:48 PM
Thank you for your help.

Kindest regards.