Skip to content

Commit

Permalink
Update ipmi_sensor_ to handle ipmitool Unable to read sensor erro…
Browse files Browse the repository at this point in the history
…rs (#1601)

Occasionally (once every few days) `ipmitool` will output a reading like
this:
```
Sensor Reading        :  Unable to read sensor: Device Not Present
```

Currently, Munin's `ipmi_sensor_` produces the following output in that
situation:
```
fan1.value Unable
```
…which causes Munin to log:
```
Failed to interpret expected numeric value of field 'fan1' (host 'palo.kosada.com'): 'Unable'
Argument "Unable" isn't numeric in sprintf
```
…and issue alerts as though the reading had a value of `0`.

This PR modifies `ipmi_sensor_` to omit the invalid value, which should
avoid the unnecessary alerts.
  • Loading branch information
kenyon authored Nov 29, 2023
2 parents b8cf300 + 14b7939 commit b9c1106
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 b9c1106

Please sign in to comment.