Ad Widget

Collapse

Extract value from SNMPINDEX

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Penultimatum
    Junior Member
    • Oct 2024
    • 1

    #1

    Extract value from SNMPINDEX

    Is it possible to get part of an SNMPINDEX and assign to a macro/value that can be used in other items?

    If I walk my OID (1.3.6.1.4.1.9.9.786.1.2.1.1.5.1) I get the following:

    {"{#SNMPINDEX}":"95.1","{#USERCOUNT}":"5"},
    {"{#SNMPINDEX}":"95.4","{#USERCOUNT}":"2"},
    {"{#SNMPINDEX}":"95.9","{#USERCOUNT}":"3"}

    The 95 value in the index can change, so I want to extract that value and use in items so that:

    Item1: OID.<95>.1 = 'All-Users'
    Item2: OID.<95>.4 = "PPPoE-Users"
    Item3: OID.<95>.9 = "IPoE-Users"

    Is it possible to create a discovery rule or item that can extract the 95 value from an index such as'95.1', so that I can then use that variable in other items?

    I have been looking at SNMP walk to JSON, and LLD macro's but cant figure it out.

    Thanks.
Working...