Archived community.zenoss.org | full text search
Skip navigation
Currently Being Moderated

Fix a broken deviceSearch or componentSearch catalog

VERSION 1 
Created on: Sep 14, 2009 11:21 AM by Noel Brockett - Last Modified:  Sep 14, 2009 11:21 AM by Noel Brockett

deviceSearch or componentSearch corrupt? Fix it with these steps.

Fixing the deviceSearch and componentSearch catalogs

It seems that the deviceSearch and componentSearch catalogs can become corrupt. The reason(s) for this aren't understood at this point, but you can fix them.

 

Removing Stale References from the catalogs

Follow these steps to remove stale references from your catalogs.

  1. Go to the shell and switch to the zenoss user "su - zenoss"
  2. Run "zendmd" to enter the interactive shell
  3. Paste the following script into zendmd.

problems = True
while problems:
    problems = False
    brains = dmd.Devices.deviceSearch()
    for d in brains:
        try:
            bah = d.getObject()
        except Exception:
            print "Removing non-existent device from deviceSearch: " + d.getPath()
            dmd.Devices.deviceSearch.uncatalog_object(d.getPath())
            problems = True

problems = True
while problems:
    problems = False
    brains = dmd.Devices.componentSearch()
    for d in brains:
        try:
            bah = d.getObject()
        except Exception:
            print "Removing non-existent component from componentSearch: " + d.getPath()
            dmd.Devices.componentSearch.uncatalog_object(d.getPath())
            problems = True

commit()
Comments (1)