bb-Ricardo / check_redfish

A monitoring/inventory plugin to check components and health status of systems which support Redfish. It will also create a inventory of all components of a system.
MIT License
110 stars 30 forks source link

Disabled power control become CRITICAL #105

Closed hpcitdude closed 1 year ago

hpcitdude commented 1 year ago

Hi,

We had this in the older versions also. I tested on 1.5 just now and can see the same. We have 4 node enclosuers from Gigabyte where we can check the power status. The chassis is supplying power for the 4 nodes. If we are checking the nodes themselves we see a CRITICAL alert for the power check like:

[CRITICAL]: Chassis Power Control (status: CRITICAL/Disabled) current consumption: 597W

So in our install packages we have created a patch to fix this. Just set state to OK if power control is Disabled. Request that you have a look at it and implement similar thing?

--- /usr/local/nagios/plugins/check_redfish/cr_module/power.py    2022-09-22 14:25:19.618392000 +0200
+++ power.py    2022-09-22 15:42:04.388101000 +0200
@@ -210,6 +210,8 @@
             power_control_status = get_status_data(grab(power_control, "Status"))
             status = power_control_status.get("Health")
             state = power_control_status.get("State")
+            if "Disabled" == state:
+                status = "OK"
             name = power_control.get("Name")
             reading = power_control.get("PowerConsumedWatts")
bb-Ricardo commented 1 year ago

Hi,

Would you be able to provide me with an redfish Mock of that server?

Then I could add it to my unit test environment and cover this case as well.

hpcitdude commented 1 year ago

Hi Ricardo,

Sure, I just sent you an email with a mockup taken for one of our blades.

bb-Ricardo commented 1 year ago

Awesome, thank you very much. Will add it.

Not sure how fast I will be able to add/fix this.

bb-Ricardo commented 1 year ago

Hey, I fixed it in next-release branch. Can you try it out please? Thank you

hpcitdude commented 1 year ago

Hi, sorry for answering late. Tested it now and it works :) Thanks!

bb-Ricardo commented 1 year ago

Great news, then I will close this issue.