Examples
banshee/examples-collection/examples/watches/
below
Example: the watch below; the memory a Linux has available, by SSH.
by banshee1 installation1 version
Published on October 27, 2026. First version in this collection.
// The watch "below": it raises when a value is strictly below a threshold.
// The collector reads the memory a Linux still has available, by SSH.
need('protocol:ssh');
output('available', 'number', array('label' => 'Memory available', 'unit' => 'MiB'));
watch.below('low-memory', 'Little memory left', 'available', array('warning' => 512, 'critical' => 128));
// "MemAvailable: 3041672 kB": the second word, in kB.
$read = ssh.run("grep '^MemAvailable:' /proc/meminfo");
$f = text.words($read['output']);
value('available', number.round($f[1] / 1024));