banshee is under active development: collectors will keep changing, and a version you publish will likely need adjustments. For stable use, wait for version 1.0.0.

Examples

banshee/examples-collection/examples/protocols/

snmp-date

Example: snmp.date, a DateAndTime brought back to UTC; the clock of a device.

  • example
  • protocol
  • snmp
  • date
  • clock

by banshee1 installation1 version

v1Latest

Published on October 27, 2026. First version in this collection.

Keen 1.0.0 · 17 lines
// snmp.date: read an OID that holds a date (DateAndTime), brought back to UTC, in seconds since
// 1 January 1970. A date without its offset from UTC stops the collector rather than guess it.
// The collector compares the clock of a device with the clock of the poller.
need('protocol:snmp');

output('drift', 'number', array('label' => 'Offset from the poller clock', 'unit' => 's'));

watch.above('clock-off', 'Clock off', 'drift', array('warning' => 5, 'critical' => 60));

// hrSystemDate (HOST-RESOURCES-MIB): the date of the device.
$date = snmp.date('1.3.6.1.2.1.25.1.2.0');
$offset = $date - time.now();
// The minus before a value turns its sign: the offset, without its sign.
if ($offset < 0) {
    $offset = -$offset;
}
value('drift', number.round($offset, 1));