Skip to content

Sakuli container as a native Nagios Plugin #305

@simonmeggle

Description

@simonmeggle

It should be possible to use a Sakuli container like a native Nagios plugin, so that it only returns

  • service output
  • performance data
  • exit code 0-3

This is helpful for small monitoring installations where Sakuli containers are triggered directly from Nagios.
Proposed changes:

New property: sakuli.forwarder.nagiosplugin=1
This property can be set on container start by

docker run ... ... -e SAKULI_FORWARDER_NAGIOSPLUGIN=1 ... 

Container Entrypoint
Change the ENTRYPOINT script so that when SAKULI_FORWARDER_NAGIOSPLUGIN is set,

  • all output on STDERR/STDOUT gets suppressed. (The container should not print out anything then)
  • read output on file descriptor 3

Sakuli forwarder
The Sakuli test will then run (with forwarder sakuli.forwarder.nagiosplugin enabled) and write the result into .nagiosplugin_result within the suite folder. Format:

  • line 1: return code (maps Sakuli exit code 0-6 to Nagios exit code 0-3)
  • line 2 and following: standard Nagios output

Sakuli GO starter
If SAKULI_FORWARDER_NAGIOSPLUGIN is set, the GO starter parses .nagiosplugin_result and

  • prints out line 2+ on file descriptor 3
  • exits with the exit code in line 1

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions