Ad Widget

Collapse

Macro manipulation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bitz_G
    Junior Member
    • May 2024
    • 2

    #1

    Macro manipulation

    Hello,

    I find myself in a situation where it would be nice to have a macro that is dependent on another one. Here is my context :
    I've made a LLD rule that aims to discover every switch from a stack. I perform a walk on an oid that returns the snmp index for each switch of the stack. Let's say that i have two switch in the stack, i would have 1 and 2 as results, stored in {$SNMPINDEX}
    With this index i can retreive the CPU load with an oid that look like X.X.X.{$SNMPINDEX} (X.X.X.1 ; X.X.X.2), and the RAM usage with X.X.Y.{$SNMPINDEX}(X.X.Y.1 ; X.X.Y.2). Until here, no problem. However, to get temperature infos on the switch the oid is X.Z.W.{$SNMPINDEX}+568 (X.Z.W.569 ; X.Z.W.570).
    I've tried to create a macro {#TEMPINDEX} = {$SNMPINDEX}+568 but it obviously doesn't work. i've tried to create my temperature item through a JS script item that would make snmp calls, but that doesn't work either. I could create another discovery rule but i would have the problem in the item's name. I want every item of a switch to be name Switch {$SNMPINDEX} as in the picture (sorry for the french names in the pictures).

    Any idea is welcomed, thank you

    Click image for larger version

Name:	image.png
Views:	135
Size:	4.8 KB
ID:	483845
Working...