Follow

How to use zenindextool to reindex top-level organizers

Applies To

  • Zenoss 5.x
  • Zenoss 4.x

Summary

The zenindextool python script (available as part of the zenoss.toolbox project on Github - https://github.com/zenoss/zenoss.toolbox) is a tool to reindex top-level organizers. This tool was originally included as part of zencatalogscan.

Zenindextool can reindex Devices, DeviceSearch, Events, Manufacturers, Networks, and Services. As a general rule, reindexing is not required. However, if reindexing is recommended, you can use this script.

Zenoss 5.x Requirements

Because Zenoss 5.x uses container technology, it is necessary to stop some containers prior to running the tool. Stopping the containers is necessary because it is not possible for Zenindextool to commit changes to the database(s) with the containers running. The containers that must be stopped, include:

  • zenhub
  • zope
  • zenactiond
  1. Log into the master.
  2. Stop each of the containers.
  3. When the tool completes, restart the stopped containers.

Zenoss 4.x Requirements

It is necessary to stop some daemons prior to running the tool. If a modeling change occurs during an index, modelling will cause indexing to fail. The daemons that must be stopped, include:

  • zenhub
  • zenwebserver
  • zenactiond
  1. Log into the master.
  2. Stop the following daemons:
    • zenhub:
      zenhub stop
    • zenwebserver:
      zenwebserver stop
    • zenactiond:
      zenactiond stop
  3. If the system includes remote hubs, log into each one and stop the zenhub daemon:
    zenhub stop
  4. When the tool completes, restart the stopped daemons.

Using the zenindextool Script

usage:
zenindextool.py [-h] [-v] [-v10] [--tmpdir TMPDIR] [-s] [-l] [-t TYPE]

zenindextool -
re-indexes top-level DMD organizers -
https://support.zenoss.com/hc/en-us/articles/203263689

optional arguments:

-h, --help show this help message and exit
-v, --version show program's version number and exit
-v10, --debug debug verbose log output (debug logging)
--tmpdir TMPDIR override the TMPDIR setting
-s, --skipEvents skip creating summary events
-l, --list output all supported reIndex() types
-t TYPE, --type TYPE specify which type to reIndex()

Example Script Output

[2016-02-18 12:30:41] Initializing zenindextool v2.0.0 (detailed log at /opt/zenoss/log/toolbox/zenindextool.log)
[2016-02-18 12:30:45] Reindexing/rebuilding DeviceSearch ...

Refreshing catalog: zport/dmd/Devices/deviceSearch: Process started (1 objects to go)
Refreshing catalog: zport/dmd/Devices/deviceSearch: Process terminated. Duration: 0.01 seconds
finished

[2016-02-18 12:30:45] Execution finished in 0:00:04  
Was this article helpful?
1 out of 4 found this helpful

Comments

  • Avatar
    Iliyan Petkov

    So much details are missing from this article, that makes it all but useless!

    For example:
    Symptom of Catalog Index Issues
    Details on symptoms coming soon.

    or the usage section where you barely display the same information for script arguments that the script itself is showing without any real explanation about the script usage.

Powered by Zendesk