layer3_catalog corrupt? Fix it with these steps.
Fixing the layer3_catalog
It seems that it is possible for the layer3_catalog to end up with stale references to objects (Networks or IPs) that no longer exist. This ends up causing errors in your Google Maps portlet that look like "KeyError: IP.ADDRESS". Fortunately it is possible to programatically remove these stale references.
Removing Stale References from the layer3_catalog
Follow these steps to remove stale references from your layer3_catalog.
- 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.
- Repeat step 3 until you no longer see messages about removals
# Remove stale entries from the layer3_catalog
brains = dmd.ZenLinkManager.layer3_catalog()
for i in brains:
try:
bah = i.getObject()
except Exception:
print "Removing non-existent device from layer3_catalog: " + i.getPath()
dmd.ZenLinkManager.layer3_catalog.uncatalog_object(i.getPath())
# Save changes
commit()