Examples
banshee/examples-collection/examples/protocols/
snmp-date
Example: snmp.date, a DateAndTime brought back to UTC; the clock of a device.
par banshee1 installation1 version
Publiée le 27 octobre 2026. First version in this collection.
Protocol: snmp.date
snmp.date reads an OID that holds a date, of the syntax DateAndTime, and brings it back to UTC, in seconds since 1 January 1970. Here, the date of a device against the clock of the poller.
How to read it
hrSystemDate.0is the date of the device with its offset from UTC, to the tenth of a second.- An agent that serves the date without its offset (8 bytes) does not say which instant it is:
snmp.datestops the collector, misconfigured, rather than guess. time.now()is the time of the poller, in seconds since 1970, to the millisecond.-$offset: the minus before a value turns its sign.
To adapt it
- This compares with the poller's clock, which may be wrong itself. To compare with a time server, add
need('protocol:ntp')andntp.time(), aslinux/snmp/clockof the Linux collection does.