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

Update ipmi_sensor_ to handle ipmitool Unable to read sensor errors #1601

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions plugins/node.d/ipmi_sensor_
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ def parse_data(data):
Assertions Enabled : lcr-
Deassertions Enabled : lcr-

When a sensor reading is unavailable, ipmitool outputs:
Sensor Reading : Unable to read sensor: Device Not Present

"""
sensors = {}
cur_sensor = None
Expand Down Expand Up @@ -290,6 +293,8 @@ def report_unit(unit):
nname = normalize_sensor(lbl)
try:
value = data[lbl]["sensor reading"].split()[0]
if 'Unable to read sensor' in data[lbl]["sensor reading"]:
value = 'U'
except KeyError:
continue
print("%s.value %s" % (nname, value))
Expand Down
Loading