Examples
banshee/examples-collection/examples/mechanics/
fail
Example: fail and its three states, critical, misconfigured, unreachable; software RAID by SSH.
par banshee1 installation1 version
Publiée le 27 octobre 2026. First version in this collection.
Stopping on a state: fail
fail stops the collector on a state it alone knows, with a summary and a detail. Here, the software RAID of a Linux: no RAID, an empty answer, a lost disk.
How to read it
fail('critical', 'A RAID array lost a disk', $mdstat['output']): the state, the summary, and an optional detail. Three states: -critical: the target is in trouble; -misconfigured: the probe is set wrong, here a host without software RAID; -unreachable: the target cannot be read.- A stopped collector returns nothing, not even the values returned before the stop, and no watch is judged: the state of the probe is the one of
fail. text.match($mdstat['output'], '[U*_[U_]*]')finds[U_]or[_UU];list.countof the match is 0 when nothing matches.
To adapt it
failis for what the code alone knows. A threshold the administrator should set is a watch: here, the rebuilding of an array is awatch.state, that can be unchecked.- A secret is never written in a summary or a detail: the validation refuses it.