TECHZEN Zenoss User Community ARCHIVE  

Adding new event class via JSON API

Subject: Adding new event class via JSON API
Author: [Not Specified]
Posted: 2014-12-04 03:02

Hi

I'm developing a different type of alerting scheme where I create events via the JSON API, and all this is working fine, however I'd like to be able to classify these events in different eventclasses.

I have tried to use the following post to /zport/dmd/service_router

{"action":"ServiceRouter","method":"addClass","tid":1,"type":"rpc","data":[{"contextUid":"/zport/dmd/Events","id":"NewEventClass"}]}

But I get this error back

{"uuid"=>"cdd5449a-bce8-42d2-82f9-a5c03b8aebb7", "action"=>"ServiceRouter", "result"=>{"msg"=>"Exception: Invalid service context UID: /zport/dmd/Events", "type"=>"exception", "success"=>false}, "tid"=>1, "type"=>"rpc", "method"=>"addClass"}

I have tried different values of context UID, but I have not been able to find a value that actually works...

Anybody knows how I may solve this

Using Zenoss Core 4.2.5

Regards
Thomas



Subject: Adding new event class via JSON API
Author: [Not Specified]
Posted: 2014-12-04 12:58

Thomas -
The problem is that the ServiceRouter Class is for working on Services (ie Windows services):
For example, this would create a new Windows service named 'NewEventClass' under the root organizer:
{"action":"ServiceRouter","method":"addClass","tid":1,"type":"rpc","data":[{"contextUid":"/zport/dmd/Services/WinService","id":"NewEventClass"}]}

The EventsRouter class within the Zep Module is the only Json available for events and doesn't include any methods for adding event classes.
--Rob




Subject: Thanks rob,
Author: [Not Specified]
Posted: 2014-12-05 03:40

Thanks rob,

I was coming to that conclusion as well.. I've created https://jira.zenoss.com/browse/ZEN-15668 to request the option for creating eventclasses via the JSON API.

Thomas



< Previous
zenoss event dependancy when server down
  Next
Zenoss refusing to load after power failure(A Zenoss error has occurred)
>