Oct 15, 2009 12:05 PM
XML-RPC Unable to clear event
-
Like (0)
Hey
I seem to have a problem with XML-RPC.
Via XML-RPC i can create events. However i also want to Clear events from XML-RPC and that does not seem to work
Create events works with this command...
Create events :
$serv = RPC::XML::Client->new('http://<user>:<passowrd>@<servername>:8080/zport/dmd/ZenEventManager');
%evt = ('device' => 'TEST', 'component' => 'Webinject', 'summary' => 'TEST' , 'severity' => 5);
$args = RPC::XML::struct->new(%evt);
$serv->simple_request('sendEvent', $args);
But this does not work ... and is this even the correct way? I know I know that normally zenoss should create events but i have a script that currently mails when something is wrong that i want to report to zenoss....
Please help ...
Clear events:
$serv = RPC::XML::Client->new('http://<user>:<passowrd>@<servername>:8080/zport/dmd/ZenEventManager');
%evt = ('device' => 'TEST', 'component' => 'Webinject', 'summary' => 'TEST' , 'severity' => 1);
$args = RPC::XML::struct->new(%evt);
$serv->simple_request('sendEvent', $args);
Well, here is how it would be done in python:
xmlrpc = self.__class__._get_xmlrpc_proxy(self.server, "/zport/dmd/ZenEventManager")
return xmlrpc.manage_deleteEvents((self.evid,))
Where self.evid is the event id.
Check out the zapplet.py source:
http://zapplet.svn.sourceforge.net/viewvc/zapplet/trunk/zapplet/event.py?view=markup&pathrev=14
It uses several Zenoss XML-RPC calls.
Zapplet is available for download at: http://sourceforge.net/projects/zapplet/ if you need to look at more of the code.
Follow Us On Twitter »
|
Latest from the Zenoss Blog » | Community | Products | Services Resources | Customers Partners | About Us | ||
Copyright © 2005-2011 Zenoss, Inc.
|
||||||||