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
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
Checking for a | in check[:output] before trying to split solves the problem