CiscoUcs / ucsmsdk

Python SDK for Cisco UCSM
Other
80 stars 60 forks source link

Acknowledge fault using ucsmsdk #231

Closed licohe closed 11 months ago

licohe commented 1 year ago

Hello,

Trying to figure out how to acknowledge fault using ucsmsdk.

Here is an example of what I tried:

filter_str = '(id, "7987950")' sp = handle.query_classid(class_id="FaultInst", filter_str=filter_str)[0] sp.ack = 'yes' handle.set_mo(sp) handle.commit()

Here is an output of the fault object before setting ack=yes: `Managed Object : FaultInst

class_id :FaultInst ack :no cause :health-minor change_set : child_action :None code :F1705 created :2023-03-12T00:52:26.895 descr :RAS Event (10) : Please check the Health tab for more details dn :sys/chassis-5/blade-2/mgmt/health/fault-F1705 highest_severity :minor id :7987950 last_transition :2023-03-12T00:52:26.895 lc : occur :1 orig_severity :minor prev_severity :minor rn :fault-F1705 rule :mgmt-health-status-health-minor-issue sacl :None severity :minor status :None tags : type :management`

Here is an output of the fault object after setting ack=yes: `Managed Object : FaultInst

class_id :FaultInst ack :yes cause :health-minor change_set : child_action :None code :F1705 created :2023-03-12T00:52:26.895 descr :RAS Event (10) : Please check the Health tab for more details dn :sys/chassis-5/blade-2/mgmt/health/fault-F1705 highest_severity :minor id :7987950 last_transition :2023-03-12T00:52:26.895 lc : occur :1 orig_severity :minor prev_severity :minor rn :fault-F1705 rule :mgmt-health-status-health-minor-issue sacl :None severity :minor status :modified tags : type :management`

I don't receive any response or error but the alert is not getting acknowledged on UCS. Python 3.10.5 ucsmsdk 0.9.14 UCS 4.2(1m)

Thanks,

dsoper2 commented 1 year ago

What does a Copy XML of the fault show in UCSM:

image

The API call above does ack=yes the fault in my enviornment, but most faults won't actually clear in UCSM unless the fault condition itself is actually cleared.

licohe commented 1 year ago

@dsoper2 , I tested it again and the value not changing to 'yes' also on the xml: image

I don't receive any errors when making the call so I can't say if something is wrong. Thanks,

dsoper2 commented 1 year ago

I'm seeing the issue in additional testing and I'll file an internal bug since this looks to be a back-end UCSM issue and not something with the SDK.

vvb commented 11 months ago

This is a side-effect of an issue with UCSM schema. FaultInst Object is not allowed in the request(UCSM-IN.xsd), but only in the response(UCSM-OUT.xsd). We will add a work-around for this in the ucsmsdk while the UCSM backend fixes this. A fix should be shortly available in the next ucsmsdk release.

vvb commented 11 months ago

0.9.16 fixes this.