ZenDMD Tip - Refresh DeviceSearch Catalog

From Zenoss Wiki
This is the approved revision of this page, as well as being the most recent.
Jump to: navigation, search

There are times when you might need to refresh the DeviceSearch catalog. For me this happens mostly around groups, although there are tons of other scenarios. From time to time I will notice that a group has a member that it shouldn't. Looking at the list of groups from the Device overview page, the group is not listed, but when looking at the group through the Infrastructure tab, it shows up. Additionally I'm unable to delete it.

This little snippet will refresh the catalog and has generally fixed this issue for me:

from Products.ZCatalog.ProgressHandler import StdoutHandler
dmd.Devices.deviceSearch.refreshCatalog(clear=1,pghandler=StdoutHandler())
 
commit()

Warning: Never refresh the global_catalog using this method. Always use zencatalog.