Skip to content

Commit af36872

Browse files
committed
storcli.py: Skip battery backup unit status if it does not exist
Some HPE RAID controllers have an external battery (Energy pack aka HPE Smart Storage Battery) instead of a controller onboard battery backup unit. With our controller (HPE MR416i-a Gen10+) the "BBU Status" field is not present in the storcli output and storcli.py aborts data collection. This commit skips the BBU Status field if it does not exist. Signed-off-by: bugspencor <[email protected]>
1 parent 3018120 commit af36872

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

storcli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def handle_sas_controller(response):
251251
def handle_megaraid_controller(response):
252252
controller_index = response["Basics"]["Controller"]
253253

254-
if response["Status"]["BBU Status"] != "NA":
254+
if "BBU Status" in response["Status"] and response["Status"]["BBU Status"] != "NA":
255255
# BBU Status Optimal value is 0 for normal, 8 for charging.
256256
metrics["bbu_healthy"].labels(controller_index).set(
257257
response["Status"]["BBU Status"] in [0, 8, 4096]

0 commit comments

Comments
 (0)