banshee est en développement actif : les collecteurs vont encore changer, et une version que vous publiez demandera sans doute des ajustements. Pour un usage stable, attendez la version 1.0.0.

Examples

banshee/examples-collection/examples/protocols/

snmp-get

Example: snmp.get, one OID; the time since the SNMP agent started.

  • example
  • protocol
  • snmp
  • uptime

par banshee1 installation1 version

v1Dernière

Publiée le 27 octobre 2026. First version in this collection.

Keen 1.0.0 · 11 lignes
// snmp.get: read one OID. An OID the agent does not have stops the collector, misconfigured.
// The collector reads how long the SNMP agent of a device has been running.
need('protocol:snmp');

output('uptime', 'number', array('label' => 'Time since the agent started', 'unit' => 'd'));

watch.below('restarted', 'Restarted recently', 'uptime', array('warning' => 1));

// sysUpTime.0 (SNMPv2-MIB), in hundredths of a second: 8 640 000 make a day.
$ticks = snmp.get('1.3.6.1.2.1.1.3.0');
value('uptime', number.round($ticks / 8640000, 2));