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/

increase

Example: the watch increase on a counter over a window; out-of-memory kills by SSH.

  • example
  • watch
  • increase
  • counter
  • memory
  • ssh

by banshee1 installation1 version

v1Latest

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

Keen 1.0.0 · 14 lines
// The watch "increase": it raises when a counter, a number that only grows, grew too much over a window.
// The kernel of a Linux counts in oom_kill the processes it killed for lack of memory since its start.
need('protocol:ssh');

output('oom-kills', 'number', array('label' => 'Processes killed for lack of memory, since the start'));

// One kill within a day is a warning, three a critical. A restart brings the counter back to zero: the
// window then starts again from there.
watch.increase('oom', 'Out of memory', 'oom-kills', array('warning' => 0, 'critical' => 2, 'window' => '1 d'));

// "oom_kill 3", in /proc/vmstat since Linux 4.13.
$read = ssh.run("grep '^oom_kill ' /proc/vmstat");
$f = text.words($read['output']);
value('oom-kills', $f[1]);