Ad Widget

Collapse

snmp-walking 10 storage units. Need 5 items per volume to make calculated values

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

    #1

    snmp-walking 10 storage units. Need 5 items per volume to make calculated values

    Hi. So I need three variables to calculate the disk usage on a particular brand of devices.

    1) storage unit size (useless information on its own)
    2) amount of storage units per disk volume (useless information on its own)
    3) utilized number of units per disk volume (useless information on its own)

    I have a snmp-walk item to get all these values. I then need to create one item for each of the above things, to grab them out of the walk as dependent items. That's 30 items.

    Then, for each group of the above I create a 4:th and a 5:th item. These are calcluated item of the size of each disk and the amount used. All the above is pretty useless information on their own.
    So I now have 50 items just to get the size and free diskspace of 10 volumes.

    Is there a better way to do this, or is this simply flaws of the zabbix design?
  • ISiroshtan
    Senior Member
    • Nov 2019
    • 324

    #2
    I would assume you looked through the SNMP MIB and there is no single node that reports the result you need, right?

    In theory, if you don't need data per disk volume, you should be able to calculate it as 5 items total.
    Create the snmp-agent item with snmpwalk[] and add preprocessing "snmpwalk to json" preprocessing right away, That will be 1st item and you have a JSON with all the data in it.
    Create a 2nd item for storage unit size dependent time with snmp-agent item as master. Add 1st step preprocessing JSONPath preprocessing to extract all values of "storage unit size". Result of this preprocessing should be JSON array with numbers of unit size. Add 2nd step preprocessing of JavaScript type and write simple code to read array from step 1 and do sum of all elements. Result of both step should be total storage unit size.
    Repeat above for storage units per disk.
    Repeat above units per disk volume
    Add calculated item that calculates what you need based on 3 items above.

    Or just write a javascript pre-processing that will consume whole JSON from snmp-agent item anb will do all the calculation, then result can be achieved in 2 items...

    It highly depends on actual structure of your JSON, what and how you want to calculate.

    Comment

    • troffasky
      Senior Member
      • Jul 2008
      • 565

      #3
      What you are describing sounds like the standard SNMP way of doing things. Have you looked at how the factory SNMP templates do this?

      Comment


      • vanessa
        vanessa commented
        Editing a comment
        There's just so many items that need to hang around to support the final calculated items that I'm actually interested in. It's bloating up the item list.
    • troffasky
      Senior Member
      • Jul 2008
      • 565

      #4
      Like I said, have you looked at how the factory SNMP templates do this?
      https://git.zabbix.com/projects/ZBX/...at=release/6.2 [I would link to 7.0 but it wants a login which I don't have, so meh].
      You will see a macro {#ALLOC_UNITS} which is actually set by the Discovery OID item and is 1.3.6.1.2.1.25.2.3.1.4.
      There is no "item" for this. Unfortunately this is just one of those things in Zabbix that you need to "just know" and is not obvious. IMO this discovery list should be broken out into items to make it more explicit what is happening in the background.


      It's bloating up the item list.
      So what? If you want to use the data, you have to collect it somehow.

      Comment

      Working...