ZenDMD Tip - Remove Invalid Devices from Collectors

From Zenoss Wiki
Revision as of 16:01, 19 July 2012 by 50.56.228.65 (Talk)$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)

Don't forget to commit()

Best, --Shane (Hackman238)