Examples
banshee/examples-collection/examples/watches/
silence
Example: the watch silence, a value at zero too long; connections to port 443 by SSH.
par banshee1 installation1 version
Publiée le 27 octobre 2026. First version in this collection.
// The watch "silence": it raises when a value stayed at zero for too long.
// The collector counts the connections open to the port 443 of a Linux, by SSH: none for hours means
// that nobody reaches the site any more.
need('protocol:ssh');
output('connections', 'number', array('label' => 'Connections open to port 443'));
watch.silence('unused', 'Nobody connects', 'connections', array('warning' => '1 h', 'critical' => '6 h'));
// ss -H prints no header line: one line per connection established to the local port 443.
$read = ssh.run("ss -H -t state established '( sport = :443 )'");
value('connections', list.count(text.lines($read['output'])));