Difference between revisions of "ZenDMD Tip - Fix Broken Graph Report Elements"

From Zenoss Wiki
Jump to: navigation, search
(Created page with "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....")
 
Line 7: Line 7:
 
               reports = reportsParent.reports()
 
               reports = reportsParent.reports()
 
               for r in reports:
 
               for r in reports:
                  for i in r.getElements():
+
                  for i in r.getElements():
                      ii = i.getComponent()
+
                      ii = i.getComponent()
                      if not ii:
+
                      if not ii:
                          print "I couldn't get object " + str(i.id) + " listed in report " + str(r.id) + " in organizer " + str(reportsParent.id)  
+
                          print "I couldn't get object " + str(i.id) + " listed in report " + str(r.id) + " in organizer " + str(reportsParent.id)  
                          r.elements.removeRelation(i)
+
                          r.elements.removeRelation(i)
                          commit()
+
                          commit()
  
  
 
Best,
 
Best,
 
--Shane Scott (Hackman238)
 
--Shane Scott (Hackman238)

Revision as of 21:06, 24 July 2012

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)