Hi,
I wrote my first python script tonight and it actually does something useful: 
dumps some information out of zenoss. I have been poking around and I came 
across a the ZCmdBase class, which is what the zendmd is based on. this class 
can be found in <$ZENHOME>/Products/Utils . there are a few other  useful 
classes in this directory as well. Using ZCmdBase, it would be possible for 
some of the folks with large sites to automate and script various tasks. 

Here is my script:

from ZCmdBase import ZCmdBase

cmdObj = ZCmdBase()
dmdRoot = cmdObj.dataroot.getDmdRoot("Devices")
allDevices = dmdRoot.getSubDevices()
for devEntry in allDevices:
        device = cmdObj.findDevice(devEntry.getDeviceName())
        deviceName = device.getDeviceName()
        hwManufacturer = device.getHWManufacturerName()
        comments = device.comments
        print deviceName , ":" , hwManufacturer , ":" , comments

I plan on maintaining what I get working here:
http://www.unixgarage.com/monitoring/zenoss

------------------------
 Mohamed Hussein




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

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

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



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

Reply via email to