diff --git a/storcli.py b/storcli.py index 16a4e98..073b4a6 100755 --- a/storcli.py +++ b/storcli.py @@ -173,6 +173,11 @@ ], namespace=namespace, registry=registry, ), + "pd_temp": Gauge( + "pd_temp_celsius", + "MegaRAID physical drive temperature in degrees Celsius", + ["controller", "enclosure", "slot"], namespace=namespace, registry=registry, + ), # fmt: on } @@ -377,6 +382,11 @@ def create_metrics_of_physical_drive(physical_drive, detailed_info_array, contro attributes["Firmware Revision"].strip(), attributes["SN"].strip(), ).set(1) + + if "Drive Temperature" in state: + metrics["pd_temp"].labels(controller_index, enclosure, slot).set( + state["Drive Temperature"].split("C")[0].strip() + ) except KeyError: pass