Discussion:
Changes in API from Zenoss 3.x to 4.2.4
matttherogue
2013-07-29 15:48:40 UTC
Permalink
matttherogue [http://community.zenoss.org/people/matttherogue] created the discussion

"Changes in API from Zenoss 3.x to 4.2.4"

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

--------------------------------------------------------------
Good morning,
I've recently started at a company moving from Zenoss 3.x to the latest version, 4.2.4. One of the things I'm trying to get working involves creating events from our internal system using the api (basically running curl).

The old format basically is as follows with line-breaks for readability:

http://{our Zenoss site}/zport/dmd/ZenEventManager/manage_addEvent
?{device=___}
&{component=___}
&{eventkey=___}
&{summary=___}
&{message=___}
&{eventClass=___}
&{severity=____}


Unfortunately, this doesn't quite work for the newer API. I've been looking at the API docs for the versions to get ZEP's add_event method working through URLs, but I've been unsuccessful so far.

In the zenDMD, I've been able to add events with the following code and watch it pop up on the device's event page:

import zep
zep_facade=getFacade('zep')
zep_facade.create("EventSummary", "Severity # (not working)", "Device", "Component", "EventClass (not working)", "Something else (no idea)")

How do I format a string to create an event through the web API?
--------------------------------------------------------------

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

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
dpetzel
2013-07-29 17:02:02 UTC
Permalink
dpetzel [http://community.zenoss.org/people/dpetzel] created the discussion

"Re: Changes in API from Zenoss 3.x to 4.2.4"

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

--------------------------------------------------------------
I suggest you use the JSON API ( http://community.zenoss.org/community/documentation/official_documentation/api http://community.zenoss.org/community/documentation/official_documentation/api)  instead. As I understand it the JSON API will be more "upgrade proof".
--------------------------------------------------------------

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

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
matttherogue
2013-07-29 17:07:26 UTC
Permalink
matttherogue [http://community.zenoss.org/people/matttherogue] created the discussion

"Re: Changes in API from Zenoss 3.x to 4.2.4"

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

--------------------------------------------------------------
This is not a helpful response.

I understand that the JSON API is more "upgrade proof." That's not the question I was asking. To switch to a JSON API would require a serious rewrite of our a component of our code. I am trying to avoid impacting our development resources in this regard. Please do not link to API documentation again.

Is there a method to add an event similar to the "old style" of event management?
--------------------------------------------------------------

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

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
dpetzel
2013-07-29 17:13:46 UTC
Permalink
dpetzel [http://community.zenoss.org/people/dpetzel] created the discussion

"Re: Changes in API from Zenoss 3.x to 4.2.4"

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

--------------------------------------------------------------
Apologies, I though that was a more helpful response than ignoring the message entirely....

Perhaps it would be useful if you specified such constraints in your original post. Obviously I wouldn't have offered a solution that didn't meet your requirements if you had listed them. I'll be sure to never link you to API documentation in the future.
--------------------------------------------------------------

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

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
matttherogue
2013-07-29 17:17:34 UTC
Permalink
matttherogue [http://community.zenoss.org/people/matttherogue] created the discussion

"Re: Changes in API from Zenoss 3.x to 4.2.4"

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

--------------------------------------------------------------
Nah, I unfairly snapped at you. I've been staring at the stupid documentation for about a week now and wasted most of yesterday trying to get it to work. Sorry about being mean.

Our application is configured to build and then hit a url to add the event. The entire messaging framework is designed around a URL and we dont' have a JSON builder designed into the system. To add JSON support, we'd need to create a lot of code. I was trying to keep it as simple as possible.
--------------------------------------------------------------

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

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...