Discussion:
Event Message attribute in JsonApi's add_event
matttherogue
2013-07-30 14:56:59 UTC
Permalink
matttherogue [http://community.zenoss.org/people/matttherogue] created the discussion

"Re: Event Message attribute in JsonApi's add_event"

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

--------------------------------------------------------------
I hate re-opening a two year old post, but are you basically saying to override that constructor to expect an additional "message" string?

Thanks,
-Matt
--------------------------------------------------------------

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

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Shane Scott
2013-07-30 14:59:43 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: Event Message attribute in JsonApi's add_event"

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

--------------------------------------------------------------
Matt,

Yep. Normally these other variables default to None or blank unless specified.

Best,
--Shane Scott (Hackman238)
--------------------------------------------------------------

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

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-30 15:03:51 UTC
Permalink
matttherogue [http://community.zenoss.org/people/matttherogue] created the discussion

"Re: Event Message attribute in JsonApi's add_event"

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

--------------------------------------------------------------
Shane,
Thanks for replying so quickly! Allow me to ask another, hopefully non-redundant, question. I can't add a {"message":"This is my message string"} to the data section as is, I need to actually change the code in Zenoss. When I add the message block, I get this as the return.

{"uuid": "0f22c055-afa6-45ab-b163-b058e2cec4a2", "action": "EventsRouter", "result": {"msg": "TypeError: add_event() got an unexpected keyword argument 'message'", "type": "exception", "success": false}, "tid": 1, "type": "rpc", "method": "add_event"}

Basically, I'm hoping for someone to tell me there is an easy way of doing this :)

-Matt
--------------------------------------------------------------

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

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Shane Scott
2013-07-30 15:06:05 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: Event Message attribute in JsonApi's add_event"

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

--------------------------------------------------------------
Matt,

You'll need to take a look at the router and facade to see what optional arguments you can supply. There may or my not be one for message. I'm pretty sure there's one for summary, though it might not be called summary.

Best,
--Shane Scott (Hackman238)
--------------------------------------------------------------

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

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-30 15:09:19 UTC
Permalink
matttherogue [http://community.zenoss.org/people/matttherogue] created the discussion

"Re: Event Message attribute in JsonApi's add_event"

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

--------------------------------------------------------------
Ok!

This is just for anyone else who references the thread.

$ZENHOME/Products/Zuul/routers/zep.py:
line 600, def add_event:
        @type  summary: string
        @param summary: New event's summary
        @type  device: string
        @param device: Device uid to use for new event
        @type  component: string
        @param component: Component uid to use for new event
        @type  severity: string
        @param severity: Severity of new event. Can be one of the following:
                         Critical, Error, Warning, Info, Debug, or Clear
        @type  evclasskey: string
        @param evclasskey: The Event Class Key to assign to this event
        @type  evclass: string
        @param evclass: Event class for the new event
        @rtype:   DirectResponse

I will update this thread with code when (if?) I have it working.

Thanks for being my sounding board this morning and I hope you have a great day!
-Matt
--------------------------------------------------------------

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

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Shane Scott
2013-07-30 15:12:43 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: Event Message attribute in JsonApi's add_event"

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

--------------------------------------------------------------
Matt,

Sure. I see summry there. It's possible message=summary somewhere in the method. It might be it's just not exposed at all or is in the extended event atributes. Let me know if summary works for you and if not I'll take a glance at the code.

--Shane Scott (Hackman238)
--------------------------------------------------------------

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

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-30 15:22:38 UTC
Permalink
matttherogue [http://community.zenoss.org/people/matttherogue] created the discussion

"Re: Event Message attribute in JsonApi's add_event"

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

--------------------------------------------------------------
Shane,

I think part of my confusion is summary vs. message. In our Zenoss 3 instance, we could send a a massive string that specified both summary and message, a feature I'm trying to duplicate (if only to keep QC off my back!). Looking at the Zen3 system, it seems that summary and message contain differing content. Don't bother wasting brainpower on this one yet, I still want to play with it some.

Thanks again,
-Matt
--------------------------------------------------------------

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

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-30 19:30:01 UTC
Permalink
matttherogue [http://community.zenoss.org/people/matttherogue] created the discussion

"Re: Event Message attribute in JsonApi's add_event"

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

--------------------------------------------------------------
I got it! Here's where I outlined how to add it into the API by modifying zepfacade.py and zep.py: http://community.zenoss.org/message/74234#74234#74234 http://community.zenoss.org/message/74234#74234
--------------------------------------------------------------

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

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-30 19:30:26 UTC
Permalink
matttherogue [http://community.zenoss.org/people/matttherogue] created the discussion

"Re: Event Message attribute in JsonApi's add_event"

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

--------------------------------------------------------------
I'm not sure if you ever figured it out, but I put what I ended up doing in http://community.zenoss.org/message/74234#74234#74234 http://community.zenoss.org/message/74234#74234
--------------------------------------------------------------

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

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