Ok so I finally sorted this out so I thought I'd post my solution:
Assuming you've already setup your xml-rpc connection to your device you wish
to manipulate as "deviceServ"
Code:
eventlist = deviceServ.getJSONEventsInfo() #get list of events
eventlist = eventlist.replace('\"','\'') #replace " with ' to be more
pythonish
eventlist = eval(eventlist) #eval string so it becomes a
multi-dimensional array
numberevents = int(eventlist[1]) #pull out reported number of events
if numberevents > 0: #if there are events to "historify"
evtids = [] #create a new array to hold them
for i in range(0, numberevents): #loop through all events and
evtids.append(eventlist[0][i][6]) #append the evid to the list
deviceServ.manage_deleteEvents(evtids); #and then delete them.
Hope this helps people!
-t
Code:
Code:
-------------------- m2f --------------------
Read this topic online here:
http://forums.zenoss.com/viewtopic.php?p=32345#32345
-------------------- m2f --------------------
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users