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

nagios_perfdata.rb should be robust against checks that are not reporting performance data #21

Open
cruschke opened this issue May 30, 2014 · 0 comments

Comments

@cruschke
Copy link

A failing check command like check_http (in case of port to be checked is not listening) does not necessarily have performance data appended. This results in sensu-server.log filling up with

... "extension":{"type":"extension","name":"nagios_perfdata"},"output":"undefined method `strip' for nil:NilClass","status":2}

Checking for a | in check[:output] before trying to split solves the problem

check  = event[:check]
output = check[:output]

        # https://www.nagios-plugins.org/doc/guidelines.html#AEN200
        if output.include? '|'
          perfdata = output.split('|').last.strip

...
       end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant