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/protocols/

ssh-run

Example: ssh.run, its output, errors and exit, and arguments=; the size of a file.

  • example
  • protocol
  • ssh
  • file

by banshee1 installation1 version

v1Latest

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

Protocol: ssh.run

ssh.run runs a command on the host by SSH and returns array('output' => …, 'errors' => …, 'exit' => …): what it printed, what it printed as errors, and its exit code. Here, the size of one file.

How to read it

  • need('protocol:ssh') declares the SSH access: the address, the account, the host key and its fingerprint, the port, the delay, the password or the private key, all set in the tree.
  • A command that exits non-zero is an answer: stat on a missing file exits 1, and the collector says so, fail('critical', …). A connection that fails, a refused account, stops the collector by itself (see examples/mechanics/errors).
  • arguments=array($path): each argument goes apart and protected; a path that holds a blank, a quote or a ; stays one argument. Never glue a value into the command: 'stat -c %s ' . $path would run whatever the path holds.
  • What the command does on the host is the author's judgement: use an account without write rights.

To adapt it

  • variable('example:file:path', …) is the setting of the probe (see examples/mechanics/variables).
  • stat -c %s is GNU and BusyBox; on a BSD, stat -f %z.