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

Fix a Broken layer3_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

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.

  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.
  4. 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()
Comments (0)