Discussion:
How to get events Clear summary / Events notes using Zenoss API?
James M
2013-11-03 10:04:52 UTC
Permalink
James M [http://community.zenoss.org/people/James] created the discussion

"How to get events Clear summary / Events notes using Zenoss API?"

To view the discussion, visit: http://community.zenoss.org/message/75156#75156

--------------------------------------------------------------
Hey
I'm using Zenoss API to get events list and noticed that even if the event is clear the summary remains the same,

So I have 2 questions:
*1. How to receive the "clear summary" using the API*
*2. How to receive the each event's notes / log (probably in dictionary - timestamp, user, note) using the API*

I'm using:

"
+    def get_events(self, device=None, component=None, eventClass=None):+
+        data = dict(start=0, limit=2000, dir='DESC', sort='lastTime')+

+        if device: data['params']['device'] = device+
+        if component: data['params']['component'] = component+
+        if eventClass: data['params']['eventClass'] = eventClass+

+        return self._router_request('EventsRouter', 'query', [data])['result']+
"

Any suggestions will be appreciated.

Thanks!
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/75156#75156]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Rob Eagle
2013-11-04 13:59:49 UTC
Permalink
Rob Eagle [http://community.zenoss.org/people/reagle] created the discussion

"Re: How to get events Clear summary / Events notes using Zenoss API?"

To view the discussion, visit: http://community.zenoss.org/message/75157#75157

--------------------------------------------------------------
James,
When you are grabbing the events with the get event method, you should use the recieved evid for each event.
With the evid, you can call the details method for events:
{"action":"EventsRouter","method":"detail","data":[{"evid":"005056b4-027d-68de-11e3-440c54f167bb"}],"type":"rpc","tid":1}

This will give you notes/logs:
[{"log": [["", "2013-11-02 17:15:50", "state changed to Cleared"], ["IDxxxxx", "2013-11-02 13:22:21", "state changed to Acknowledged"]

It will also give you the evid of the clear event's - "clearid": (evid or null if not cleared or is a cleared message), which can in turn be queried with the detail method to get the clear message.
Hope this helps,
---Rob
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/75157#75157]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
James M
2013-11-06 14:12:45 UTC
Permalink
James M [http://community.zenoss.org/people/James] created the discussion

"Re: How to get events Clear summary / Events notes using Zenoss API?"

To view the discussion, visit: http://community.zenoss.org/message/75183#75183

--------------------------------------------------------------
Thanks Rob!

That works perfectly!
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/75183#75183]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...