Skip to content

Commit 43018b6

Browse files
committed
storcli.py: Add cachevault status
Signed-off-by: Pat Riehecky <[email protected]>
1 parent 3018120 commit 43018b6

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Diff for: storcli.py

+25
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,21 @@
7979
"MegaRAID CacheVault temperature",
8080
["controller", "cvidx"], namespace=namespace, registry=registry,
8181
),
82+
"cv_optimal": Gauge(
83+
"cv_optimal",
84+
"MegaRAID CacheVault is Optimal",
85+
["controller", "cvidx"], namespace=namespace, registry=registry,
86+
),
87+
"cv_degraded": Gauge(
88+
"cv_degraded",
89+
"MegaRAID CacheVault is Degraded",
90+
["controller", "cvidx"], namespace=namespace, registry=registry,
91+
),
92+
"cv_failed": Gauge(
93+
"cv_failed",
94+
"MegaRAID CacheVault is Degraded",
95+
["controller", "cvidx"], namespace=namespace, registry=registry,
96+
),
8297
"ctrl_sched_patrol_read": Gauge(
8398
"scheduled_patrol_read",
8499
"MegaRAID scheduled patrol read",
@@ -276,6 +291,16 @@ def handle_megaraid_controller(response):
276291
metrics["cv_temperature"].labels(controller_index, cvidx).set(
277292
cvinfo["Temp"].replace("C", "")
278293
)
294+
if "State" in cvinfo:
295+
metrics["cv_optimal"].labels(controller_index, cvidx).set(
296+
cvinfo["State"] == "Optimal"
297+
)
298+
metrics["cv_degraded"].labels(controller_index, cvidx).set(
299+
cvinfo["State"] == "Degraded"
300+
)
301+
metrics["cv_failed"].labels(controller_index, cvidx).set(
302+
cvinfo["State"] == "Failed"
303+
)
279304

280305
for bbuidx, bbuinfo in enumerate(response.get("BBU_Info", [])):
281306
if "Temp" in bbuinfo:

0 commit comments

Comments
 (0)