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/

habit

Example: the watch habit, a value far from its usual level; the processes of a Linux by SSH.

  • example
  • watch
  • habit
  • processes
  • ssh

by banshee1 installation1 version

v1Latest

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

Keen 1.0.0 · 17 lines
// The watch "habit": it raises when a value leaves its habit for this host, at this hour and on this day
// of the week. It learns the habit first: until then it raises nothing, and says it is learning.
// The collector counts the processes of a Linux, by SSH.
need('protocol:ssh');

output('processes', 'number', array('label' => 'Processes'));

// sensitivity: low, normal or high. floor: under 50 processes it never raises, whatever the habit.
watch.habit('unusual', 'Unusual number of processes', 'processes', array(
    'help'        => 'Warns when the number of processes is far from what this host usually runs at this hour.',
    'sensitivity' => 'low',
    'floor'       => 50,
));

// One line per process, no header.
$read = ssh.run('ps -e -o pid=');
value('processes', list.count(text.lines($read['output'])));