Examples
banshee/examples-collection/examples/protocols/
snmp-get
Example: snmp.get, one OID; the time since the SNMP agent started.
par banshee1 installation1 version
Publiée le 27 octobre 2026. First version in this collection.
Protocol: snmp.get
snmp.get reads one OID and returns its value: here, sysUpTime.0, the time since the SNMP agent started, turned into days.
How to read it
need('protocol:snmp')declares the SNMP access: the address, the version, the port, the delay, the community of v2c or the account of v3, all set in the tree.- An OID is written as a text, between quotes:
'1.3.6.1.2.1.1.3.0'. Without quotes, Keen reads a number and refuses it. - An OID the agent does not have stops the collector, misconfigured (
snmp_not_found). An agent that does not answer stops it, unreachable (timeout); in SNMP v2c, a wrong community looks the same: the agent keeps quiet. sysUpTimecounts in hundredths of a second.
To adapt it
sysUpTimeis the time since the agent started, not always since the device did:hrSystemUptime.0(1.3.6.1.2.1.25.1.1.0) gives the host's, when the agent serves it.- Several values of one table:
snmp.table(seeexamples/protocols/snmp-table).