Ad Widget

Collapse

Autodiscovery rule help

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

    #1

    Autodiscovery rule help

    Hello,

    I have the following scenario:

    I have an OLT, I need to monitor its ONT clients, I created an item that walks the following OID:

    Code:
     1.3.6.1.4.1.3902.1012.3.28.1.1.2
    This returns several OIDs in the form of:

    Code:
     1.3.6.1.4.1.3902.1012.3.28.1.1.2.ONT_CHASSIS_LOCATION.ONT_PORT (ie. 1.3.6.1.4.1.3902.1012.3.28.1.1.2.268502016.42)
    This specific OID returns the name of each ONT configured in the device (can be hundreds), but encoded in the OID itself there are other values I need, specifically ONT_CHASSIS_LOCATION and ONT_PORT, the walk item stores both items as SNMPINDEX (ie. 268502016.42)

    I need to:
    • Split #SNMPINDEX into 2 additional variables #ONT_CHASSIS_LOCATION and #ONT_PORT
    • I need to do simple binary operations on ONT_CHASSIS_LOCATION to convert this numeric value into a meaningful value, ie: 268502016 should be stored as 1/1/5 instead of the number
    • Have ONT_PORT, ONT_CHASSIS_LOCATION, SNMPINDEX, and SNMPVALUE available for the discovery rules (so I can make prototypes to monitor several things per ONT)
    The problem is that I am 100% clueless as to how to achieve this. I tried preprocessing with a regex in the item and also in the discovery rule, but it only returns the first occurrence. Then I am not sure how to store those values in the variables I mentioned, for the binary operations and I will use Javascript, I don't know how to tackle this problem.

    Any help is appreciated.
Working...