Open barrypitman opened 8 months ago
It seems to be failing here:
match := reOutput.FindStringSubmatch(output)
result := make(map[string]string)
for i, name := range reOutput.SubexpNames() {
if i != 0 && name != "" {
result[name] = match[i]
}
}
Can you attach the nagios-service-checks.yml, specifying which one is failing and its output when you run it manually?
Which version of the integration are you using?
The root cause seems to be match
having fewer elements than expected due to the command output. We can add a check to exit in a more graceful way avoiding a panic
I have ~30 checks that I want to run on certain virtual machines, and I'd like to report the output of the commands to New Relic using this integration.
However, I found that if just one of the checks outputs an invalid exit code / output, then none of the checks report back to New Relic, and the integration exits with an error:
Of course, the cause of the failing check should be addressed, but this shouldn't cause the entire suite of checks to stop reporting, the integration should report the result of the failing check as an error, similar to what Nagios would do in this scenario.