Created
April 27, 2012 16:14
-
-
Save evandhoffman/2510508 to your computer and use it in GitHub Desktop.
Zenoss - print out hostnames & IP addresses
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getDeviceProps(device, propNames): | |
res = '' | |
for i in propNames: | |
res += str(getattr(device, i)) + "\t" | |
return res | |
res = '' | |
#propNames = ('id', 'snmpindex', 'monitor', 'manageIp', 'productionState','preMWProductionState','snmpAgent','snmpDescr','snmpOid','snmpContact','snmpSysName','snmpLocation','snmpLastCollection','snmpAgent','rackSlot','comments','sysedgeLicenseMode','priority','zDeviceTemplates') | |
propNames = ('id','manageIp') | |
for prop in propNames: | |
res += prop + "\t"; | |
res += "\n" | |
for d in context.getSubDevices(): | |
res += getDeviceProps(d, propNames)+"\n" | |
return res |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment