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

Fixed Sensor Warnings for non-numeric comparison #317

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arnotron
Copy link

Hello,
we encountered the same problem referenced in #310 - With check_nwc_health version 10.0 the error looks as follows:

Argument "ON" isn't numeric in numeric eq (==) at /usr/lib64/nagios/plugins/check_nwc_health line 71087.
Argument "LOST" isn't numeric in numeric eq (==) at /usr/lib64/nagios/plugins/check_nwc_health line 71087.
CRITICAL - sensor PSU [2] alarm status is true | 'sensor_PSU [1] '=0;;;; 'sensor_PSU [2] '=0;;;;

Unfortunately, even after applying the fix from dcec checking the value for being actually "-1" in string comparison before doing a numeric eq, I received another error:

Argument "ON" isn't numeric in sprintf at ./check_nwc_health.new line 514.
Argument "LOST" isn't numeric in sprintf at ./check_nwc_health.new line 514.
CRITICAL - sensor PSU [2] alarm status is true | 'sensor_PSU [1] '=0;;;; 'sensor_PSU [2] '=0;;;;

So I dusted off my perl skills and tried to fix that, too, by sending perfdata only if the value is numeric. Please let me know if this is sufficient and the proper way to do it.

changed performance data to be produced only on numeric values
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

Successfully merging this pull request may close these issues.

None yet

1 participant