Skip to content

Commit

Permalink
Extract drive temperature from storcli
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Valdron <[email protected]>
  • Loading branch information
jValdron committed Nov 22, 2023
1 parent f5c56e7 commit cc34ad6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions storcli.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@
"MegaRAID physical drive emergency spare",
["controller", "enclosure", "slot"], namespace=namespace, registry=registry,
),
"pd_temperature": Gauge(
"pd_temperature",
"MegaRAID physical drive temperature",
["controller", "enclosure", "slot"], namespace=namespace, registry=registry,
),
"pd_info": Gauge(
"pd_info",
"MegaRAID physical drive info",
Expand Down Expand Up @@ -344,6 +349,10 @@ def create_metrics_of_physical_drive(physical_drive, detailed_info_array, contro
metrics["pd_other_errors"].labels(controller_index, enclosure, slot).set(
state["Other Error Count"]
)
if "Drive Temperature" in state:
metrics["pd_temperature"].labels(controller_index, enclosure, slot).set(
state["Drive Temperature"].split("C")[0].strip()
)
metrics["pd_predictive_errors"].labels(controller_index, enclosure, slot).set(
state["Predictive Failure Count"]
)
Expand Down

0 comments on commit cc34ad6

Please sign in to comment.