Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sakuli container as a native Nagios Plugin #305

Open
simonmeggle opened this issue Feb 2, 2018 · 0 comments
Open

Sakuli container as a native Nagios Plugin #305

simonmeggle opened this issue Feb 2, 2018 · 0 comments

Comments

@simonmeggle
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment