Skip to content

Instantly share code, notes, and snippets.

@evandhoffman
Created April 27, 2012 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evandhoffman/2510508 to your computer and use it in GitHub Desktop.
Save evandhoffman/2510508 to your computer and use it in GitHub Desktop.
Zenoss - print out hostnames & IP addresses
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