Author Topic: Bug: Template custom attributes  (Read 112 times)

Egert143

  • Full Member
  • ***
  • Posts: 117
    • View Profile
Bug: Template custom attributes
« on: July 07, 2020, 10:37:04 am »
Today i noticed a different behavior from NetXms, not sure from what version it started.

Basicly i have template for each logical drive letter: C,D,E etc. In that template, 2 dci is created per drive and one dci is with threshold value "%{dci-DiskFreeGB-C:50}". "dci-DiskFreeGB-C" is inherited from template and by default is empty. So expected behavior was when drive free space is under 50, trigger alert. But today i noticed that when empty "dci-DiskFreeGB-C" is inherited no alerts are triggered. When i set "dci-DiskFreeGB-C" manualy to 50 then it will work. So easy fix right, lets set template inherited value to 50, but for some reason it wount be inherited. Even if i remove node from template and do another config discovery, still no luck. Next i tryed to removed template custom atribute and re add note, from some mysterios place it still auto inherits it.

Any ideas ?

Filipp Sudanov

  • Global Moderator
  • Full Member
  • *****
  • Posts: 242
    • View Profile
Re: Bug: Template custom attributes
« Reply #1 on: July 08, 2020, 05:27:13 pm »
The thing is, that empty custom attribute is converted into integer and turns into 0.
Not sure when there were changes in this. But current behavior is actually correct one - if custom attribute exists, but is empty, we treat it as existing and do not apply the default value for threshold. For numeric threshold empty value is converted into 0.

Egert143

  • Full Member
  • ***
  • Posts: 117
    • View Profile
Re: Bug: Template custom attributes
« Reply #2 on: July 08, 2020, 10:13:25 pm »
Out of curiosity, if node inherites custom attribute + value from template and later that value is modified on node, will it return to template value at some point ?

Victor Kirhenshtein

  • Lead Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 7010
    • View Profile
Re: Bug: Template custom attributes
« Reply #3 on: July 09, 2020, 02:15:58 pm »
Only if you'll remove overridden value from node.