Examples
banshee/examples-collection/examples/mechanics/
errors
Example: errors= to decide what a failed call means; a site down said critical.
by banshee1 installation1 version
Published on October 27, 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$errwhatever happens,array('code' => …, 'text' => …, 'details' => …); on success,codeandtextare''.- 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… Thetextis 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…