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

selection

Example: per and its default selection, all but ignore; the space used per file system.

  • example
  • per
  • selection
  • ignore
  • disk
  • ssh

by banshee1 installation2 versions

Selection: per and ignore

per makes a collector return one value per element, here per file system, and sets the default selection of the probe: all of them, except those that match a pattern of ignore.

How to read it

  • per('filesystem', 'File systems', array('ignore' => array('/boot*', '/snap/*'))): the name of the elements, the word the screen shows for them (plural), and the patterns left out by default. A collector declares one per at most.
  • 'per' => 'filesystem' on an output: its value is returned once per element, value('used', …, $f[5]), the third argument naming the element, here the mount point.
  • The code never filters: it returns every file system. The poller sets aside, before judging, what the selection of the probe leaves out. The administrator changes the selection on the probe: all, all except, or only.
  • A pattern follows text.like: * any characters, ? one, the rest itself, case counting.
  • Leaving out tmpfs in the code is not a selection: those are not disks at all.

To adapt it

  • only instead of ignore makes the default "only these" (see examples/mechanics/selection-only).
  • Without options, the default is all.