The Cacti Manual
Prev | Chapter 20. Command Line Scripts | Next

# Re-Index Hosts

Re-Indexing is required only for SNMP/Script Data Queries. Remember, that whan applying a Data Query to a Host, a `Re-Index Method` has to be chosen. This reindex method governs the automatic re-indexing based on specific events.

Table 20-1. Re_Index Methods

Re-Index Method | Description
--- | ---
Uptime Goes Backwards | Refers to a system reboot. Cacti will detect if the target has been rebootet by querying sysUptime (.1.3.6.1.2.1.1.3.0). If the current value for the uptime is lower than the previous one (uptime goes backwards), a reboot is assumed and a re-index is performed

Index Count Changed

Refers to a change of the number of indexed items, e.g. interfaces, without checking sysUptime. It is of particular interest in cases, where indexed entries may change without the need of a reboot. As modern operating systems seldom require reboots for system configuration changes, you may want to consider this setting for many cases (e.g. creating of a new filesystem without a reboot). The index to be considered is defined by the according XML file.

Verify All Fields | All index fields of the according XML file are checked for changes. This is of particular interest e.g. in cases, where the index is non-numeric (e.g. a MAC address).

If you feel the need for manual re-indexing, you may run it from cli. Calling the script with the parameter `--help` yields

    shell>php -q poller_reindex_hosts.php --help
    Cacti Reindex Host Script 1.0, Copyright 2007 - The Cacti Group

    usage: poller_reindex_hosts.php -id=[host_id|All] [-d] [-h] [--help] [-v] [--version]

    -id=host_id   - The host_id to have data queries reindexed or 'All' to reindex all hosts
    -d            - Display verbose output during execution
    -v --version  - Display this help message
    -h --help     - Display this help message

Running it in debug mode for the host with `id=2` may yield

    shell>php -q poller_reindex_hosts.php -id=2 -d
    WARNING: Do not interrupt this script.  Reindexing can take quite some time
    DEBUG: There are '1' data queries to run
    DEBUG: Data query number '1' starting
    DEBUG: Data query number '1' ending

A silent run for all devices is issued by

    shell>php -q poller_reindex_hosts.php -id=All
    WARNING: Do not interrupt this script.  Reindexing can take quite some time
    .....shell>

Stop the Poller during Re-Indexing
Re-Indexing interferes with the poller operation. Please make sure, that the poller is not running and will not start during a reindex operation

Prev | Home | Next
Command Line Scripts | Up | Empty Poller Output Table