[collectd] Snmp plugin: how does the FilterValues match an OID? (I don't know the ASN type)

Graham Leggett minfrin at sharp.fm
Mon Apr 4 18:02:20 CEST 2022


Hi all,

I am struggling to work out the correct syntax for FilterValues in the snmp plugin.

I have an snmpwalk like below, and I want to match entries where “ HOST-RESOURCES-MIB::hrStorageType” matches “ HOST-RESOURCES-TYPES::hrStorageRam”.

[root at monitor ~]# snmpwalk router HOST-RESOURCES-MIB::hrStorageTable
HOST-RESOURCES-MIB::hrStorageIndex.65536 = INTEGER: 65536
HOST-RESOURCES-MIB::hrStorageIndex.131072 = INTEGER: 131072
HOST-RESOURCES-MIB::hrStorageType.65536 = OID: HOST-RESOURCES-TYPES::hrStorageRam
HOST-RESOURCES-MIB::hrStorageType.131072 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageDescr.65536 = STRING: main memory
HOST-RESOURCES-MIB::hrStorageDescr.131072 = STRING: system disk
HOST-RESOURCES-MIB::hrStorageAllocationUnits.65536 = INTEGER: 1024 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.131072 = INTEGER: 1024 Bytes
HOST-RESOURCES-MIB::hrStorageSize.65536 = INTEGER: 524288
HOST-RESOURCES-MIB::hrStorageSize.131072 = INTEGER: 16384
HOST-RESOURCES-MIB::hrStorageUsed.65536 = INTEGER: 85748
HOST-RESOURCES-MIB::hrStorageUsed.131072 = INTEGER: 14052
HOST-RESOURCES-MIB::hrStorageAllocationFailures.65536 = Counter32: 0
HOST-RESOURCES-MIB::hrStorageAllocationFailures.131072 = Counter32: 0

The config like this is not matching anything:

   <Data "mikrotik_memory_used">
       Table true
       Plugin "memory"
       PluginInstanceOID "HOST-RESOURCES-MIB::hrStorageIndex"
       Type "memory"
       TypeInstance "used"
       Values "HOST-RESOURCES-MIB::hrStorageUsed"
       FilterOID "HOST-RESOURCES-MIB::hrStorageType"
       FilterValues "HOST-RESOURCES-TYPES::hrStorageRam"
   </Data>

The error I am getting is as follows:

Apr  4 17:58:34 monitor collectd[224513]: snmp plugin: I don't know the ASN type #6 (OID: "HOST-RESOURCES-MIB::hrStorageType.65536", data block "mikrotik_memory_used", host block “router")
Apr  4 17:58:34 monitor collectd[224513]: snmp plugin: I don't know the ASN type #6 (OID: "HOST-RESOURCES-MIB::hrStorageType.131072", data block "mikrotik_memory_used", host block “router”)

Do these two lines make sense?

       FilterOID "HOST-RESOURCES-MIB::hrStorageType"
       FilterValues "HOST-RESOURCES-TYPES::hrStorageRam”

I only see references to “strings” matching in the docs, but don’t know how OIDs turn into strings in this case. Does anyone know?

Regards,
Graham
—




More information about the collectd mailing list