Skip to content

Commit

Permalink
Update ipmi_sensor_ to handle ipmitool 'Unable to read sensor' errors
Browse files Browse the repository at this point in the history
  • Loading branch information
smokris committed Nov 29, 2023
1 parent b8cf300 commit 14b7939
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit 14b7939

Please sign in to comment.