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.
by banshee1 installation1 version
Published on October 27, 2026. First version in this collection.
// 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'])));