matttherogue
2013-07-30 17:05:23 UTC
matttherogue [http://community.zenoss.org/people/matttherogue] created the discussion
"JSON add_event - Include Message?"
To view the discussion, visit: http://community.zenoss.org/message/74233#74233
--------------------------------------------------------------
Good afternoon,
I'm trying to create a API call that will add an event to the system and I'm having two issues. The major issue that I've encountered is the inability to include a separate message text. I tried adding a new function to zep.py and zepfacade.py to accept a message as one of the variables passed, but it gives me some serious errors whenever I try to restart Zenoss afterwards. +Has anyone managed to include message text passed through the API?+
The other issue I'm encountering is that it's simply ignoring my severity setting. I've tried passing everything from "severity":5 to "severity":"Critical", but with no success so far. Is there something simple I'm completely missing?
Here is a formatted version of my working cURL command.
curl
   -u "user:password"
   -X POST
   -H "Content-Type:application/json"
   -d "{
       \"action\":\"EventsRouter\",
       \"method\":\"add_event\",
       \"data\":[{
           \"summary\":\"summary text here\",
           \"device\":\"tc1-atl.loc\",
           \"component\":\"SYSTEM\",
           \"severity\":5,
           \"evclasskey\":\"\",
           \"evclass\":\"/Random\/Class\"
       }],
       \"type\":\"rpc\",
       \"tid\":1}"
   " http://127.0.0.1:8899/zport/dmd/evconsole_router http://127.0.0.1:8899/zport/dmd/evconsole_router" > resultString.html
Thanks a lot,
-Matt
--------------------------------------------------------------
Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74233#74233]
Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
"JSON add_event - Include Message?"
To view the discussion, visit: http://community.zenoss.org/message/74233#74233
--------------------------------------------------------------
Good afternoon,
I'm trying to create a API call that will add an event to the system and I'm having two issues. The major issue that I've encountered is the inability to include a separate message text. I tried adding a new function to zep.py and zepfacade.py to accept a message as one of the variables passed, but it gives me some serious errors whenever I try to restart Zenoss afterwards. +Has anyone managed to include message text passed through the API?+
The other issue I'm encountering is that it's simply ignoring my severity setting. I've tried passing everything from "severity":5 to "severity":"Critical", but with no success so far. Is there something simple I'm completely missing?
Here is a formatted version of my working cURL command.
curl
   -u "user:password"
   -X POST
   -H "Content-Type:application/json"
   -d "{
       \"action\":\"EventsRouter\",
       \"method\":\"add_event\",
       \"data\":[{
           \"summary\":\"summary text here\",
           \"device\":\"tc1-atl.loc\",
           \"component\":\"SYSTEM\",
           \"severity\":5,
           \"evclasskey\":\"\",
           \"evclass\":\"/Random\/Class\"
       }],
       \"type\":\"rpc\",
       \"tid\":1}"
   " http://127.0.0.1:8899/zport/dmd/evconsole_router http://127.0.0.1:8899/zport/dmd/evconsole_router" > resultString.html
Thanks a lot,
-Matt
--------------------------------------------------------------
Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74233#74233]
Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]