ZenDMD Tip - Dump zProperties values for a Device

From Zenoss Wiki
Revision as of 14:23, 20 November 2013 by Crouthamela (Talk | contribs)$7

(diff) ← Older revision | Approved revision (diff) | Latest revision (diff) | Newer revision → (diff)
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)