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/

above

Example: the watch above, and its trend ahead; the space used on / by SSH.

  • example
  • watch
  • above
  • trend
  • disk
  • ssh

by banshee1 installation2 versions

v2Latest

Published on October 28, 2026. One naming convention across collections; documentation completed.

Keen 1.0.0 · 19 lines
// The watch "above": it raises when a value is strictly above a threshold. With "ahead", it judges the
// value the trend will reach, and raises before the threshold is crossed.
// The collector reads the space used on the root file system of a Linux, by SSH.
need('protocol:ssh');

output('used-percent', 'number', array('label' => 'Used space', 'unit' => '%'));

watch.above('used', 'Used space', 'used-percent', array('warning' => 80, 'critical' => 90));
// ahead: the value judged is the one the trend reaches in 7 days. It learns the trend first, and says so.
watch.above('full-soon', 'Full within a week', 'used-percent', array('warning' => 99, 'ahead' => '7 d'));

// A header line, then "/dev/sda1 30832548 12056700 17186124 42% /", the sizes in KiB.
$df = ssh.run('df -P -k /');
$lines = text.lines($df['output']);
if (list.count($lines) < 2) {
    fail('misconfigured', 'df gave no line for /', $df['errors']);
}
$f = text.words($lines[1]);
value('used-percent', number.round(100 * $f[2] / $f[1], 1));