ZenDMD Tip - Dump zProperties values for a Device

From Zenoss Wiki
This is the approved revision of this page, as well as being the most recent.
Jump to: navigation, search

For a variety of reasons, you may want to dump the current values of all zProperties on a device.

The following snippet will print out the property name and value. You can get as creative as you want rather than simply printing them to the screen.

d = dmd.Devices.findDevice('device_name') #Set this to your devices name
for prop_id in d.zenPropertyIds():
    value = d.getProperty(prop_id)
    print "{0} - {1}".format(prop_id, value)