Here's how I access Zenoss data with scripts running elsewhere.

I wrote a custom zenoss device report via Zope as described by Chet here:
http://forums.zenoss.com/viewtopic.php?t=5887
(Chet's instructions here opened up a whole new world of possibilities for me.  
It's worth checking out.)

The custom report allows me (or more importantly, scripts running elsewhere) to 
hit a URL on my zenoss server that returns a comma delimited list of servers 
with whatever info I need (device class, production state, ping uptime, etc).  
I usually use curl or wget to access this URL via script.

The python that I use in the Zope custom report looks like this (the last item 
is a custom boolean zProperty for whether device does remote syslog or not - 
you can ignore that):

Code:
print "#'serverName','class','productionState','IP','pingAge','syslog?'"
for device in context.getSubDevices():
  print "'%s','%s','%s','%s','%s','%s'" % 
(device.id,device.getDeviceClassPath(),
    
device.getProductionStateString(),device.manageIp,device.getPingStatus(),device.getRemoteSyslog())



In another little custom portal server I have custom scripts that access this 
URL, process the results and display in a table.  You could probably setup a 
custom group of Critical devices and get their status that way.  

I also have admin's use this URL to generate a dynamic list of servers to use 
in their daily status checking, etc.  It beats querying spreadsheets ;)

I hope that helps.




-------------------- m2f --------------------

Read this topic online here:
http://forums.zenoss.com/viewtopic.php?p=30590#30590

-------------------- m2f --------------------



_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to