diff --git a/host_poller.py b/host_poller.py index f8e1657..f8c32d5 100644 --- a/host_poller.py +++ b/host_poller.py @@ -22,7 +22,7 @@ import time from services import store from services.cache import close_cache, init_cache, redis_available from services.host import get_host_drives -from services.host_sensors import read_coretemp, read_ipmi_temps +from services.host_sensors import read_coretemp, read_hwmon_env, read_ipmi_temps logging.basicConfig( level=logging.INFO, @@ -47,7 +47,7 @@ async def sweep_env() -> None: except Exception as e: errors.append(f"ipmi:{e}") ipmi = [] - env = [s for s in ipmi if s.get("kind") == "env"] + env = [s for s in ipmi if s.get("kind") == "env"] + read_hwmon_env() cpu = read_coretemp() or [s for s in ipmi if s.get("kind") == "cpu"] await store.set_host_sensors({ diff --git a/services/host_sensors.py b/services/host_sensors.py index 4736f57..ce2650b 100644 --- a/services/host_sensors.py +++ b/services/host_sensors.py @@ -7,7 +7,9 @@ coretemp is a cheap sysfs read. """ import asyncio import logging +import os import re +from collections import Counter from pathlib import Path from services.hwgate import gate @@ -67,6 +69,46 @@ def _parse_ipmi(text: str) -> list[dict]: return sensors +def read_hwmon_env() -> list[dict]: + """Read labelled temps from extra hwmon chips as env sensors. + + For boxes without IPMI (e.g. Dell workstations), the BIOS SMM interface + (`dell_smm`) exposes CPU/ambient/SODIMM/board temps. Chips are configurable + via HOST_HWMON_CHIPS (comma list; default "dell_smm"); set to "" to disable. + Names are "