NetXMS Support Forum

Please login or register.

Login with username, password and session length

Author Topic: DCI Template manual override  (Read 298 times)

letabawireless

  • Newbie
  • *
  • Posts: 12
    • View Profile
DCI Template manual override
« on: April 25, 2019, 12:07:54 pm »

Hi there
I upgraded to the latest version of NetXMS, and now the Template automatically overrides manual changes that I had before on the nodes.
I have certain nodes that I want the default template added when I am adding the node, but need to adapt to the voltage at the site, which is not always the default value. (This is for threshold alarms)
Is there a way on the new version to handle this ? I have found that I can manually add the DCC value again, but this is a bit of a mission as I have to apply this at quite a few of my nodes.
Thank you for an awesome program !!
Logged

Victor Kirhenshtein

  • Lead Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 6536
    • View Profile
Re: DCI Template manual override
« Reply #1 on: April 25, 2019, 01:32:17 pm »

This is the idea of templates (and why you always get a warning when editing template item on a node). If you need customizable thresholds you can use combination of script thresholds and custom attributes. For example, if you need to check that value is less than 10 unless custom value is set on a node in custom attribute "CustomThresholdValue" you can use the following script threshold:
Code: [Select]
v = GetCustomAttribute($node, "CustomThresholdValue");
return $1 < ((v != null) ? v : 10);

Best regards,
Victor
Logged

letabawireless

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: DCI Template manual override
« Reply #2 on: April 29, 2019, 07:58:49 am »

Hi Victor

I am a bit of a noob with custom attributes etc. So let me explain what I used before. I have a voltage threshold on the template of 22v. But I have a lot of nodes that require a threshold of 25v, some 23.5, etc( a few different values depending on voltage full state). So in the older version, I simply changed it so that those templates are over ridden, and it worked. I am not the only administrator, so I would like to keep it as simple as possible.
So can a template be added that can be over ridden, or should I add multiple DCI's with different thresholds, and maybe disable the ones I dont want / need ? Alternatively, I should remove the template and add them one by one, which seems counter-intuitive.
Let me know on your thoughts,
Thanks
Logged

tickett

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: DCI Template manual override
« Reply #3 on: April 29, 2019, 10:37:26 am »

Perhaps you want to set the Server Configuration parameter ImportConfigurationonStartup to 0? This did the trick for us.
Logged

letabawireless

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: DCI Template manual override
« Reply #4 on: April 29, 2019, 10:43:20 am »

Hi - but what about new nodes that needed to get the template values ? The template adds about 5 DCI's, of which one needs to be adapted. I think I will just duplicate on each of the custom nodes, and disable the one from the template.
Logged

Victor Kirhenshtein

  • Lead Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 6536
    • View Profile
Re: DCI Template manual override
« Reply #5 on: April 29, 2019, 11:23:10 am »

Hi,

you can change threshold to script like this:
Code: [Select]
v = GetCustomAttribute($node, "VoltageThreshold");
return $1 < ((v != null) ? v : 22);

then threshold will fire if voltage is less than 22 unless you have custom attribute VoltageThreshold set on a node - in that case it will compare current value with value of this attribute. So if you need to override threshold to fire if below 25v on specific node, go to that node properties, page "Custom Attributes", and add attribute VoltageThreshold with value 25.

Best regards,
Victor
Logged

letabawireless

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: DCI Template manual override
« Reply #6 on: May 07, 2019, 08:45:23 am »

Hi Victor

Could you possibly just explain where I add the custom attributes ? To each node that the default threshold has to be overwritten ? And do I add this on the DCC where the default values currently are ? I apologise again for not seeing this clearly...
Logged

letabawireless

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: DCI Template manual override
« Reply #7 on: May 07, 2019, 10:19:58 am »

Hi

Another thing - lets say I have 5 DCI's in the template (This is for Mikrotik), but I have a node that cannot process one of those DCI's (no voltage for eg) - if I disable it, the Template adds it again ? Can this be avoided somehow ?
Thank you
Logged

Victor Kirhenshtein

  • Lead Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 6536
    • View Profile
Re: DCI Template manual override
« Reply #8 on: May 10, 2019, 11:32:44 pm »

Hi,

yes, idea is that you add this attribute on each node where default threshold value should be overridden. You cannot exclude certain DCIs from being applied as part of template.

Best regards,
Victor
Logged