DCI Template manual override

Started by letabawireless, April 25, 2019, 12:07:54 PM

Previous topic - Next topic

letabawireless

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 !!

Victor Kirhenshtein

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:

v = GetCustomAttribute($node, "CustomThresholdValue");
return $1 < ((v != null) ? v : 10);


Best regards,
Victor

letabawireless

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

tickett

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

letabawireless

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.

Victor Kirhenshtein

Hi,

you can change threshold to script like this:

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

letabawireless

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...

letabawireless

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

Victor Kirhenshtein

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

igor

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

thank you

Victor Kirhenshtein

Hi,

you may need to use instance discovery.

Best regards,
Victor

igor

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

Tursiops

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.

paul

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.

igor

Tursiops,
It's work fine!!!

Thanks a lot!