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.
- Go to the shell and switch to the zenoss user "su - zenoss"
- Run "zendmd" to enter the interactive shell
- 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()