cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
607
Views
4
Helpful
1
Replies

How to receive async event from UCS?

chengli2
Level 1
Level 1

Hi guys,
I got a problem when I need to subscribe the UCS event. When I send the subscription HTTP request to UCS, I can not receive any reply, and the session will hang up till to time out. During the session's life, I change the configuration data, which is supposed to generate an event and publish it to the subscribers. But the UCS plugin dose not receive anything.

1: If I can receive response of subscribing request, I can keep the session alive and read the session in a loop, so that I can handle the data in time. But I can not receive anything, the request is blocked.

2: If the request will response nothing, and the session just hang up for the future event, I think I should have received the events when I change the config, But I didn't.

So, now I have two problem.

1: Why the request session can not receive any response?
2: Why I can not receive events? even when I change the config

The API usage link is: http://www.cisco.com/c/en/us/td/docs/unified_computing/ucs/sw/api/b_ucs_api_book/b_ucs_api_book_chapter_010.html#r_eventsubscribe

which mentions that the event subscribing request will response nothing or a response.

If you know how to solve this problem, please help me!

1 Accepted Solution

Accepted Solutions

dsoper
Cisco Employee
Cisco Employee

Here's example use with curl to subscribe to all events:

$ curl --insecure -d '<aaaLogin inName="admin" inPassword="password" />' https://172.16.143.157/nuova

<aaaLogin cookie="" response="yes" outCookie="1487209775/ec4c1515-0ae4-4fc3-a7c2-17a16d51e6d2" outRefreshPeriod="600" outPriv="admin,read-only" outDomains="org-root" outChannel="noencssl" outEvtChannel="noencssl" outSessionId="" outVersion="3.1(2e)" outName=""> </aaaLogin>


$ curl --insecure -d '<eventSubscribe cookie="1487209775/ec4c1515-0ae4-4fc3-a7c2-17a16d51e6d2"/>' https://172.16.143.157/nuova


18327

<methodVessel cookie=""> <inStimuli>  <configMoChangeEvent cookie="" inEid="92927"> <inConfig> <lsServer assocState="associating" configState="applied" descr="demo" dn="org-root/ls-SP_OSP_Compute_2"

...

Note that to avoid timeouts you'll want to use aaaKeepAlive as described here:

How to call the eventSubscribe method of Cisco IMC on UCS C?

Also note that a general event subscription will generate a lot of traffic.  The python SDK provides a strait forward way to filter the subscription as documented here: Table of Contents — ucsmsdk 0.9.1.0 documentation

View solution in original post

1 Reply 1

dsoper
Cisco Employee
Cisco Employee

Here's example use with curl to subscribe to all events:

$ curl --insecure -d '<aaaLogin inName="admin" inPassword="password" />' https://172.16.143.157/nuova

<aaaLogin cookie="" response="yes" outCookie="1487209775/ec4c1515-0ae4-4fc3-a7c2-17a16d51e6d2" outRefreshPeriod="600" outPriv="admin,read-only" outDomains="org-root" outChannel="noencssl" outEvtChannel="noencssl" outSessionId="" outVersion="3.1(2e)" outName=""> </aaaLogin>


$ curl --insecure -d '<eventSubscribe cookie="1487209775/ec4c1515-0ae4-4fc3-a7c2-17a16d51e6d2"/>' https://172.16.143.157/nuova


18327

<methodVessel cookie=""> <inStimuli>  <configMoChangeEvent cookie="" inEid="92927"> <inConfig> <lsServer assocState="associating" configState="applied" descr="demo" dn="org-root/ls-SP_OSP_Compute_2"

...

Note that to avoid timeouts you'll want to use aaaKeepAlive as described here:

How to call the eventSubscribe method of Cisco IMC on UCS C?

Also note that a general event subscription will generate a lot of traffic.  The python SDK provides a strait forward way to filter the subscription as documented here: Table of Contents — ucsmsdk 0.9.1.0 documentation

Review Cisco Networking products for a $25 gift card