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/watches/

deviate

Example: the watch deviate, one element far from the others; the load of each processor by SNMP.

  • example
  • watch
  • deviate
  • per
  • processor
  • snmp

by banshee1 installation1 version

v1Latest

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

Keen 1.0.0 · 19 lines
// The watch "deviate": it raises when one element strays from the others of the same pass; here, a
// processor left idle while the others work. It needs a selection (per), and judges nothing under three
// elements.
// The collector reads the load of each processor, by SNMP.
need('protocol:snmp');

per('processor', 'Processors');
output('load', 'number', array('label' => 'Load of the processor', 'unit' => '%', 'per' => 'processor'));

// side below: only a value under the median of the others counts. 40 points under it is a warning, when
// it holds for 3 passes.
watch.deviate('neglected', 'A processor left idle', 'load', array('side' => 'below', 'warning' => 40, 'for' => '3 runs'));

// hrProcessorLoad (HOST-RESOURCES-MIB): the load of each processor over the last minute, in percent.
// The suffix of each OID is the index of the processor.
$loads = snmp.walk('1.3.6.1.2.1.25.3.3.1.2');
foreach ($loads as $index => $load) {
    value('load', $load, 'cpu' . $index);
}