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

errors

Example: errors= to decide what a failed call means; a site down said critical.

  • example
  • errors
  • failure
  • http

par banshee1 installation1 version

v1Dernière

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

Catching a failed call

By default, a call that fails stops the collector, in the state its failure gives. errors=$err lets the collector decide: here, a site that refuses or does not answer is said down, critical, rather than unreachable.

How to read it

  • http.get($url, errors=$err): the call fills $err whatever happens, array('code' => …, 'text' => …, 'details' => …); on success, code and text are ''.
  • On a failure caught so, the call returns '' and the collector goes on: test $err['code'] != '' before reading the answer. Reading $answer['status'] of a failed call stops the collector.
  • The codes are fixed: timeout, connection_refused, host_unknown, network_error, access_denied… The text is for people, never to test.
  • errors= never catches a refusal of the connection checks set in the tree (a certificate, a fingerprint, the TLS profile): those always stop the collector, misconfigured.
  • There is no try and no catch: errors= covers its own call only.

To adapt it

  • errors= exists on every protocol call: ssh.run, snmp.get, ntp.time, winrm.run…