ZenDMD Tip - Remove Invalid Devices from Collectors

From Zenoss Wiki
Revision as of 16:07, 21 November 2013 by Crouthamela (Talk | contribs)$7

(diff) ← Older revision | Approved revision (diff) | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

As the zenoss user, zendmd

from Products.ZenModel.PerformanceConf import PerformanceConf
for p in dmd.Monitors.Performance.objectValues():
    if not isinstance(p, PerformanceConf):
        continue
    for d in p.devices():
        try:
            bah = d.primaryAq()
        except:
            print "Removing %s from %s" % (d.id, p.id)
            p.d._remove(d)
commit ()