Ad Widget

Collapse

Can't use SNMP-walk dependent item in item prototypes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vanessa
    Member
    • Oct 2024
    • 38

    #1

    Can't use SNMP-walk dependent item in item prototypes

    Trying to calculate the disk usage in percentage by using javascript preprocessing. But there's insufficient documentation, so I'll try asking here.

    I have followed the first steps of this "guide" (mostly useless): https://www.zabbix.com/documentation...snmp_oids_walk

    1. In a template, create an snmp agent item with oid "walk[1.2.3]"
    2. Make a discovery rule that use the item in step1 as a dependent item. Use preprocessing step "SNMP walk to JSON" to break down the dependent snmp-walk into macros.
    3. Create item prototypes by using the macros from the preprocessing step from the discovery rule.

    Now to the problem:
    I'm usng "SNMP walk to JSON" in the preprocessing step of the item prototype (which is using the original snmp-walk as depending item) like so:
    OID prefix: 1.2.3.4.{#SNMPINDEX} --> Macro {$DISKUSAGE}
    OID prefix: 1.2.3.6.{#SNMPINDEX} --> Macro {$DISKSIZE}

    I then use these macros in javascript in the next preprocessing steps.

    The SNMP walk to JSON fails with "no data found".
    The OIDs in that step in the instantiated items do exist, and return values when I snmpget or snmp-walk them.

    How do I grab the values of that walk and use them in a formula?

    Where do I find ACTUAL and useful documentation on how to do these things? I understand that zabbix wants to sell support, but I personally find this beyond unethical.
    Last edited by vanessa; 11-11-2024, 01:50.
  • ISiroshtan
    Senior Member
    • Nov 2019
    • 324

    #2
    It would be good if you showed actual OIDs you trying to parse into macros with preprocessing and OID(s) you trying to walk over. Also output of manual walk would be helpful.

    Never really worked with new walk[] functions, but pretty sure you could create an SNMP Agent type item for Zabbix to fetch same data discovery tries to fetch, to see what is wrong with data, as error seems to indicate that something is not right with data you feeding into discovery.

    Comment

    • vanessa
      Member
      • Oct 2024
      • 38

      #3
      I solved it.

      So, snmp walk to json can't be used on item prototypes like that. It can only be used in the discovery phase (other ways of using it is not well documented).

      The current practice is to then create separate items based on that walk, that grabs the wanted values from an snmp-walk into individual items. You can then make a calculated item based of these items if you want to aggregate their values somehow. The seemingly obvious way to aggregate these values based on the documentation won't work (since it's not actually documented really).
      Last edited by vanessa; 11-11-2024, 13:11.

      Comment

      Working...