Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requiring ansible modules/adhoc command to record cisco ucs manager critical alerts,major faults #134

Open
vivekanand552 opened this issue Aug 19, 2020 · 2 comments

Comments

@vivekanand552
Copy link

Hello All,

We are currently automating the Cisco UCS infrastructure environment in our company and we are exploring options to record the critical alerts,major faults in cisco ucs environment before proceeding with automation activities

In the Cisco UCS CLI we have an option to check the critical alerts/major faults under scope monitoring/show new faults that will show new faults.

Can you kindly help with similar ansible modules or ansible adhoc commands to show critical alerts/major faults which can be used as reference that the automation activity has been successfully completed.

Thanks for your help in advance!

Regards
Vivekanand

@Hlibovytskyi
Copy link

Hi @vivekanand552
We are using https://github.com/CiscoUcs/ucsm-ansible for that
This example shows how you can easily access UCSm fault instance which contains all faults:

- hosts: all
  connection: local
  gather_facts: no
  tasks:
  - name: Faults query 
    vars:
      login_info: &login_info
        hostname: "{{ ucs_hostname }}"
        username: "{{ ucs_username }}"
        password: "{{ ucs_password }}"  
        
    ucs_query:
      <<: *login_info
      class_ids: Faultinst
    register: Faultinst_query

Faultinst_query contains dict with all faults and you can store it in a file or parse directly using ansible.

@vivekanand552
Copy link
Author

Hello @Glibovitskiy,

Thanks a lot for your response, it was very helpful, I am able to generate the faultinst with all faults in it.

I require another help, using the registered variable "register: Faultinst_query" would i be able to further capture how many critical alerts,major,minor faults are there in cisco ucs manager so that i can take this as reference and abort the play whenever the critical alerts or major faults counters goes up due to wrong configuration?

It would be very helpful if you can provide an answer to the above query.

Thanks and Regards
Vivekanand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants