IPMI crash
If the ipmitool
command returns malformed data, the plugin thread crashes:
Oct 16 04:54:58 ThreadReaper python[3394175]: Exception in thread Plugin-1-IPMI:
Oct 16 04:54:58 ThreadReaper python[3394175]: Traceback (most recent call last):
Oct 16 04:54:58 ThreadReaper python[3394175]: File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
Oct 16 04:54:58 ThreadReaper python[3394175]: self.run()
Oct 16 04:54:58 ThreadReaper python[3394175]: File "/root/mqtt4hass/mqtt4hass.py", line 145, in run
Oct 16 04:54:58 ThreadReaper python[3394175]: self.loop()
Oct 16 04:54:58 ThreadReaper python[3394175]: File "/root/mqtt4hass/plugins/ipmi/__init__.py", line 34, in loop
Oct 16 04:54:58 ThreadReaper python[3394175]: ipmi_data: Dict[str, Tuple[str, Optional[str]]] = IPMI.read_ipmi(self._ipmitool_cmd)
Oct 16 04:54:58 ThreadReaper python[3394175]: File "/root/mqtt4hass/plugins/ipmi/__init__.py", line 86, in read_ipmi
Oct 16 04:54:58 ThreadReaper python[3394175]: lines: str = check_output(cmd).decode("utf-8")
Oct 16 04:54:58 ThreadReaper python[3394175]: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 2100: invalid start byte
It should log the error, and try again next time. This is similar to #32 (closed), probably can just add the additional exception type and be done.