banshee est en développement actif : les collecteurs vont encore changer, et une version que vous publiez demandera sans doute des ajustements. Pour un usage stable, attendez la version 1.0.0.

Examples

banshee/examples-collection/examples/basics/

first-collector

Example: the smallest collector, one SSH command, one value, one watch.

  • example
  • basics
  • ssh
  • output
  • watch

par banshee1 installation1 version

v1Dernière

Publiée le 27 octobre 2026. First version in this collection.

Keen 1.0.0 · 17 lignes
// A first collector: it reads one number on a Linux by SSH, returns it, and proposes one watch.
// A collector has two parts. The header comes first: it declares what the collector needs, what it
// returns and what it watches, and the master reads it without running anything. The body comes after:
// it does the work, on the poller.

// What it needs: the SSH access of the host (its address, an account, its host key), set in the tree.
need('protocol:ssh');

// What it returns: one number, named users.
output('users', 'number', array('label' => 'Logged-in users'));

// What it watches: a warning above 5 users, critical above 20. The administrator changes both on the probe.
watch.above('crowded', 'Too many users', 'users', array('warning' => 5, 'critical' => 20));

// The body: run a command, read what it printed, return the value.
$answer = ssh.run('who | wc -l');
value('users', text.trim($answer['output']));