ZenDMD Tip - Fix Broken Graph Report Elements

From Zenoss Wiki
Revision as of 21:05, 24 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

To fix Graph Reports broken by invalid or missing components, su zenoss and zendmd. Run the following.

  children = dmd.Reports.children()
  for c in children:
      if c.id == "Graph Reports":
          for reportsParent in c.getSubOrganizers():
              reports = reportsParent.reports()
              for r in reports:
                 for i in r.getElements():
                     ii = i.getComponent()
                     if not ii:
                         print "I couldn't get object " + str(i.id) + " listed in report " + str(r.id) + " in organizer " + str(reportsParent.id) 
                         r.elements.removeRelation(i)
                         commit()


Best, --Shane Scott (Hackman238)