Initialize "crit" threshold to avoid crash in the case device doesn't provide a baseline #747
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thank you for your interest in contributing to Checkmk!
Consider looking into Readme regarding process details.
General information
Extremely simple one-line fix to prevent the liebert_pump plugin from crashing due to "crit" being uninitialized, if the device does not have a threshold OID (as some in our environment do not).
Bug reports
To reproduce, add a Liebert CRAC that reports pump hours over SNMP but does not provide a critical threshold over SNMP. This will cause the plugin to crash. The attached CRAC2.txt is an SNMP walk that simulates one such device.
Proposed changes
This plugin should, at the very least, initialize the crit variable, which will be used later (but has a possibility to not be set in the following loop).