Difference between revisions of "ZenDMD Tip - Test & Delete Overrides"

From Zenoss Wiki
Jump to: navigation, search
m (Reverted edits by Crouthamela (talk) to last revision by Hackman238)
m (Reverted edits by Hackman238 (talk) to last revision by Crouthamela)
 
Line 16: Line 16:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Change out the 'zDeviceTemplates' in the examples to the property you need to work with.
 
Change out the 'zDeviceTemplates' in the examples to the property you need to work with.
 
Source: http://shanewilliamscott.com/Code/zendmd-tip-test-a-delete-overrides.html
 
  
 
[[Category:Tips]]
 
[[Category:Tips]]
 
[[Category:ZenDMD]]
 
[[Category:ZenDMD]]

Latest revision as of 03:15, 31 October 2015

As the zenoss user on the ZenMaster, zendmd.

For classes:

for d in dmd.Devices.getSubOrganizers():
    if d.getOverriddenObjects('zDeviceTemplates'): d.id

For devices:

for d in dmd.Devices.getSubDevices():
    if d.getOverriddenObjects('zDeviceTemplates'): d.id

To remove the property, use the 'deleteZenProperty' method as follows:

d.deleteZenProperty('zDeviceTemplates')

Change out the 'zDeviceTemplates' in the examples to the property you need to work with.