[collectd] snmp plugin: Add ScaleOID option

Graham Leggett minfrin at sharp.fm
Wed Apr 6 22:42:33 CEST 2022


Hi all,

While graphing memory on some Mikrotik routers using the Host Resources MIB I discovered that it wasn't possible to scale an OID by another OID. Most specifically, hrStorageUsed is in units of hrStorageAllocationUnits, and hrStorageAllocationUnits returns different values depending on the type of storage (disk, RAM).

This has been fixed below, and now this config is possible:

https://github.com/collectd/collectd/pull/3996

   <Data "host_memory_used">
       Table true
       Plugin "memory"
       PluginInstanceOID "HOST-RESOURCES-MIB::hrStorageIndex"
       Type "memory"
       TypeInstance "used"
       #TypeInstancePrefix "port"
       Values "HOST-RESOURCES-MIB::hrStorageUsed"
       ScaleOID "HOST-RESOURCES-MIB::hrStorageAllocationUnits"
       FilterOID "HOST-RESOURCES-MIB::hrStorageType"
       FilterValues "HOST-RESOURCES-TYPES::hrStorageRam"
   </Data>

Regards,
Graham
—




More information about the collectd mailing list