|
79 | 79 | "MegaRAID CacheVault temperature",
|
80 | 80 | ["controller", "cvidx"], namespace=namespace, registry=registry,
|
81 | 81 | ),
|
| 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 | + ), |
82 | 97 | "ctrl_sched_patrol_read": Gauge(
|
83 | 98 | "scheduled_patrol_read",
|
84 | 99 | "MegaRAID scheduled patrol read",
|
@@ -276,6 +291,16 @@ def handle_megaraid_controller(response):
|
276 | 291 | metrics["cv_temperature"].labels(controller_index, cvidx).set(
|
277 | 292 | cvinfo["Temp"].replace("C", "")
|
278 | 293 | )
|
| 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 | + ) |
279 | 304 |
|
280 | 305 | for bbuidx, bbuinfo in enumerate(response.get("BBU_Info", [])):
|
281 | 306 | if "Temp" in bbuinfo:
|
|
0 commit comments