NetXMS Support Forum

Please login or register.

Login with username, password and session length

Author Topic: DCI Template manual override  (Read 709 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: 6619
    • 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: 6619
    • 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: 6619
    • 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

igor

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: DCI Template manual override
« Reply #9 on: June 04, 2019, 03:50:52 pm »

Hi Victor,
still about this issue, how can I do if I have more than 1 disk with different sizes?

thank you
Logged

Victor Kirhenshtein

  • Lead Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 6619
    • View Profile
Re: DCI Template manual override
« Reply #10 on: June 06, 2019, 09:52:49 am »

Hi,

you may need to use instance discovery.

Best regards,
Victor
Logged

igor

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: DCI Template manual override
« Reply #11 on: June 06, 2019, 05:44:41 pm »

Yes it's ok.
What I mean is, if I have more than 1 disk with different size and I need a different threshold, for example 20% and 10%, and set a custom attributes with script, all disks will get this same attribute, correct?
So how can I do  this?

thank you
Logged

Tursiops

  • Sr. Member
  • ****
  • Posts: 424
    • View Profile
Re: DCI Template manual override
« Reply #12 on: June 07, 2019, 04:19:02 am »

You will probably need to do something similar to what's been discussed in this post:
https://www.netxms.org/forum/general-support/simple-question-cdm-monitoring-using-snmp-anybody-doing-this/15/

Bascially, you will need to use a combination of script thresholds and custom attributes so you can override your default thresholds.
Logged

paul

  • Full Member
  • ***
  • Posts: 111
    • View Profile
Re: DCI Template manual override
« Reply #13 on: June 13, 2019, 04:15:57 am »

As per Tursiops and Victor, the Windows template example that I uploaded deals with both customized DCI thresholds with three variations, as well as dropping DCI's for instances not wanted.

For instance exclusion, there is probably a better way, but basically, you can either do the DCI exclusion in the automatic bind coding - I do it there because it globally applies and it would be cleaner to have different templates for devices based on different firmware / software levels that do / do not support all the DCI's. You might have two templates - Microtik with Voltage and Microtik no voltage - selected based on whatever determines that voltage is expected to be returned (Poll the voltage or set a system attribute somewhere - volt_sensor_installed).

Having said that, I use the same global thresholds for Windows and Linux - all variants. I can override per node, and have set global thresholds for things like /var and C:\ - mixing and matching as needed. The only real difference is that Windows devices node specific override is first three chars whereas Linux is full instance name match.

It took me some time to get my head around this - plus the invaluable assistance from Tursiops and Victor - but it is all there and is all working. When I get time (hahaha), I will write up a "how to" for this as there are a few different components that need to be aligned in order for this to work.
Logged

igor

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: DCI Template manual override
« Reply #14 on: June 13, 2019, 08:26:01 pm »

Tursiops,
It's work fine!!!

Thanks a lot!
Logged