Hi,
I am currently using snmp to read some oids from a DD-wrt router for bandwidth monitoring and such.
All is well, but: the oids of the interfaces sometimes change after a reboot (probably something to do with the initialization times of the interfaces?) . The result is that my sensor reports nothing because of this.
baseoid: 1.3.6.1.2.1.31.1.1.1.6.8 on dd-wrt reports the total bandwidth used, but after a reboot it sometimes changes to 1.3.6.1.2.1.31.1.1.1.6.11 or 1.3.6.1.2.1.31.1.1.1.6.12 on the router.
I was thinking of creating sensors which read the oids where the interface names are contained:
iso.3.6.1.2.1.31.1.1.1.1.1 = STRING: “lo”
iso.3.6.1.2.1.31.1.1.1.1.8 = STRING: “br0”
and based on that use some kind of variable in the sensor which contains the last integer of the correct oid, in this case that would be “8”…
ie:
- platform: snmp
host: 192.168.0.253
baseoid: 1.3.6.1.2.1.31.1.1.1.6.{{some_variable}}
Any ideas on how i could go about this?