Cacti (home)ForumsDocumentation


This shows you the differences between two versions of the page.

manual:088:6_reference.4_cli_script.2_reindex_hosts [2019/10/29 15:16] (current)
Line 1: Line 1:
 +==== 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 (. 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
 +<code>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</code>
 +Running it in debug mode for the host with //id=2// may yield
 +<code>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</code>
 +A silent run for all devices is issued by
 +<code>shell>php -q poller_reindex_hosts.php -id=All
 +WARNING: Do not interrupt this script.  Reindexing can take quite some time></code>
 +**Note:** 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

Personal Tools