From cdcdeb2e03d147ed556911192c8d7fc0ca429a57 Mon Sep 17 00:00:00 2001 From: Thomas Vincent Date: Mon, 23 Nov 2026 12:12:33 -0800 Subject: [PATCH] docs(cli): [1.2.x] correct command line, poller and operations pages against the source (#264) * docs(cli): [1.2.x] correct command line options against the scripts Replace the pasted --help output for rebuild_poller_cache, poller_reindex_hosts, poller_output_empty, poller_graphs_reapply_names, copy_user, add_device, add_data_query, add_graph_template, add_graphs, add_tree and add_perms with the output of the 1.2.x scripts, remove the add_tree --rra-id and --list-rras documentation, fix the splice_rrd.php name and list the cli scripts that were missing from the tables. Signed-off-by: Thomas Vincent * docs(poller): [1.2.x] correct Spine, script server and boost details against the source Script server pool size is 1 to 15, Data Collector and Device field names follow the 1.2.x forms, php_servers is a system setting, and poller_output is created as a MEMORY table. Signed-off-by: Thomas Vincent * docs: [1.2.x] correct setting names, menu paths and special data source names Align Debugging, FAQ, Spikekill and RRDtool feature pages with the 1.2.x setting labels, menu entries, CDEF special data source names and the Spikekill per RRA kill limit. Signed-off-by: Thomas Vincent --------- Signed-off-by: Thomas Vincent --- Boost.md | 5 +- Command-Line-Scripts.md | 418 ++++++++++++++++++---------------- Debugging.md | 6 +- Frequently-Asked-Questions.md | 10 +- PHP-Script-Server.md | 10 +- RRDtool-Specific-Features.md | 42 ++-- Spikekill.md | 25 +- Spine.md | 24 +- 8 files changed, 281 insertions(+), 259 deletions(-) diff --git a/Boost.md b/Boost.md index 856f512..b2c13c9 100644 --- a/Boost.md +++ b/Boost.md @@ -132,8 +132,9 @@ ALTER TABLE poller_output_boost, ENGINE=memory; ``` -As previously mentioned, its also important that the `poller_output` table is -converted to memory, eliminate any disk I/O related to poller updates. +As previously mentioned, its also important that the `poller_output` table uses +the memory engine, which is how Cacti creates it by default, to eliminate any +disk I/O related to poller updates. Now, you need to determine how many polling cycles will fit into your `poller_output_boost` table. In this case, when sizing the `poller_output_boost` diff --git a/Command-Line-Scripts.md b/Command-Line-Scripts.md index 046ecdd..5a35bc8 100644 --- a/Command-Line-Scripts.md +++ b/Command-Line-Scripts.md @@ -15,35 +15,51 @@ briefly. ## Automation Scripts -| Script | Category | Description | -| ---------------------- | ----------- | ----------------------------------------------------------------------------------------------- | -| add_device.php | Automation | Allows adding a Device to Cacti. Most device options are included. Some plugin options may not. | -| change_device.php | Automation | Allows editing device details such as IP/Poller association | -| add_data_query.php | Automation | Allows adding a Data Query to Cacti. | -| add_graph_template.php | Automation | Allows adding a Graph Template to Cacti. | -| add_graphs.php | Automation | Allows adding a Graph to Cacti. | -| add_perms.php | Automation | Allows adding permissions to Cacti. | -| add_tree.php | Automation | Allows adding tree's tree branches and objects to Cacti Trees. | -| copy_user.php | Maintenance | Allows creating new users from Templates | +| Script | Category | Description | +| -------------------------- | ----------- | ----------------------------------------------------------------------------------------------- | +| add_device.php | Automation | Allows adding a Device to Cacti. Most device options are included. Some plugin options may not. | +| change_device.php | Automation | Allows editing device details such as IP/Poller association | +| add_data_query.php | Automation | Allows adding a Data Query to Cacti. | +| add_graph_template.php | Automation | Allows adding a Graph Template to Cacti. | +| add_graphs.php | Automation | Allows adding a Graph to Cacti. | +| add_perms.php | Automation | Allows adding permissions to Cacti. | +| add_tree.php | Automation | Allows adding tree's tree branches and objects to Cacti Trees. | +| apply_automation_rules.php | Automation | Executes Cacti automation rules for devices selected by id, hostname or description. | +| remove_device.php | Automation | Allows removing Devices selected by id, IP address or description. | +| plugin_manage.php | Automation | Allows installing, enabling, disabling and uninstalling plugins. | +| copy_user.php | Maintenance | Allows creating new users from Templates | ## Maintenance Scripts -| Script | Category | Description | -| ------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| input_whitelist.php | Maintenance | To to onboard new Data Input Methods when using Cacti in a high security environment where new Data Input Methods must always be vetted before enabling for general use. | -| poller_graphs_reapply_names.php | Maintenance | Allows selecting re-running of Cacti's suggested values engine for Graphs | -| poller_reindex_hosts.php | Maintenance | Batch method to re-index Cacti Devices | -| analyze_database.php | Maintenance | Analyzes all Cacti tables rebuilding their index cardinality. Important to run after having added large numbers of Devices and Graphs to Cacti. | +| Script | Category | Description | +| ------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| input_whitelist.php | Maintenance | To to onboard new Data Input Methods when using Cacti in a high security environment where new Data Input Methods must always be vetted before enabling for general use. | +| poller_graphs_reapply_names.php | Maintenance | Allows selecting re-running of Cacti's suggested values engine for Graphs | +| poller_reindex_hosts.php | Maintenance | Batch method to re-index Cacti Devices | +| analyze_database.php | Maintenance | Analyzes all Cacti tables rebuilding their index cardinality. Important to run after having added large numbers of Devices and Graphs to Cacti. | +| batchgapfix.php | Maintenance | Fills gaps in Graphs over a time range, using parallel threads. | +| float_rrdfiles.php | Maintenance | Floats a range of data in selected RRDfiles using the RRDtool dump/import utility. | +| host_update_template.php | Maintenance | Updates Cacti Devices with the latest Device Template. | +| poller_data_sources_reapply_names.php | Maintenance | Recalculates Data Source names for the selected Data Templates. | +| poller_replicate.php | Maintenance | Fully synchronizes Remote Data Collectors. | +| refresh_csrf.php | Maintenance | Updates the csrf_secret() key of the Cacti system. | +| remove_broken_graphs.php | Maintenance | Reports on or removes Graphs that lack Data Sources. | +| remove_graphs.php | Maintenance | Removes Graphs selected by Graph Template, Device Template, Device or Graph name expression. | +| removespikes.php | Maintenance | Removes spikes from an RRDfile. See [Spikekill](Spikekill.md). | +| reorder_data_query.php | Maintenance | Re-orders Data Queries for a Device or for all Devices in batch mode. | +| update_heartbeat.php | Maintenance | Updates RRDfile heartbeats and the Cacti database to match. | ## Repair Scripts -| Script | Category | Description | -| ------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | -| poller_output_empty.php | Repair | Removes bad entries from Cacti's poller output table. | -| rebuild_poller_cache.php | Repair | Batch process to re-populate Cacti's poller cache. NOTE: This script can run for a very long time on large systems. | -| repair_database.php | Repair | Utility to look for common problems with old Cacti databases where objects were removed while still in use. Also rapairs all tables after a system crash. | -| repair_graphs.php | Repair | Utility to repair Cacti Graphs whose structure is damaged due to legacy Cacti behavior. | -| repair_templates.php | Repair | Utility to repair Cacti Templates whose structure was damaged due to legacy Cacti behavior. | +| Script | Category | Description | +| ------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | +| poller_output_empty.php | Repair | Removes bad entries from Cacti's poller output table. | +| audit_graph_template_inputs.php | Repair | Reports Graph Template input integrity findings without changing the database. | +| push_out_hosts.php | Repair | Deprecated. Use `rebuild_poller_cache.php`. | +| rebuild_poller_cache.php | Repair | Batch process to re-populate Cacti's poller cache. NOTE: This script can run for a very long time on large systems. | +| repair_database.php | Repair | Utility to look for common problems with old Cacti databases where objects were removed while still in use. Also rapairs all tables after a system crash. | +| repair_graphs.php | Repair | Utility to repair Cacti Graphs whose structure is damaged due to legacy Cacti behavior. | +| repair_templates.php | Repair | Utility to repair Cacti Templates whose structure was damaged due to legacy Cacti behavior. | ## Repair/Migration Scripts @@ -51,13 +67,15 @@ briefly. | ------------------ | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | audit_database.php | Repair/Migration | Script to audit your Cacti schema, and repair any tables that don't match the stock Cacti schema. It will also upgrade the Cacti schema and run plugin upgrade functions. This is a good migration tool to move database from old versions of Cacti. | | convert_tables.php | Repair/Migration | Convert all tables from their current form to the Cacti preferred table type, collation and charset | -| splice_rra.php | Migration | Utility that allows two RRDfiles to be merged, and also assists with resampling an old RRDfile to a new RRA configuration, for example moving a Cacti system from 5 minute polling to 1 minute polling. | +| fix_mediumint.php | Repair/Migration | Increases the size of key Cacti columns for systems with over a million Graphs that have been in service for years. | +| splice_rrd.php | Migration | Utility that allows two RRDfiles to be merged, and also assists with resampling an old RRDfile to a new RRA configuration, for example moving a Cacti system from 5 minute polling to 1 minute polling. | ## Install/Upgrade Scripts | Script | Category | Description | | ----------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| import_package.php | Install/Upgrade | Import a signed Cacti `.xml.gz` package, including its template definitions and embedded resource files. Run on the main collector; see [Template Import](Import-Template.md). | +| import_package.php | Install/Upgrade | Import a signed Cacti `.xml.gz` package, including its template definitions and embedded resource files. Run on the main collector; see [Template Import](Import-Template.md). | +| import_template.php | Install/Upgrade | Import a Cacti Template XML file from the command line. | | install_cacti.php | Install/Upgrade | Script to install Cacti from a raw schema. Used primarily by distribution maintainers. | | md5sum.php | Install/Upgrade | Utility to verify the MD5SUM of a file. | | sqltable_to_php.php | Install/Upgrade | Utility for Plugin Developers to create an object for creating tables in plugins. | @@ -102,19 +120,31 @@ Localhost - mtaReceivedVolume SNMP Version: 1, Community: somesecret, OID: .1. There are several circumstances, that may result in the poller cache being out of sync. An example would be a change of the name of a script used in a `Data Input Method`. This change is _not_ automatically propagated to the poller -cache. It is required, to run `php -q rebuild poller_cache.php` manually. +cache. It is required, to run `php -q rebuild_poller_cache.php` manually. Calling the script with the parameter `--help` yields ```console shell>php -q rebuild_poller_cache.php --help -Cacti Rebuild Poller Cache Script 1.0, Copyright 2004-2026 - The Cacti Group +Cacti Rebuild poller cache Tool, Version 1.2.x Copyright (C) 2004-2026 The Cacti Group -usage: rebuild_poller_cache.php [-d] [-h] [--help] [-v] [--version] +usage: rebuild_poller_cache.php [--host-id=N] [--host-template-id=N] [--data-template-id=N] [--debug] + +Cacti's repopulate poller cache tool. This CLI script will +repopulate poller cache for all or specified hosts. + +This utility will run in parallel with the given number of threads, +Optional: + --threads=N - The number of threads to use to repopulate, default = 5 + --host-id=N - Run for a specific Device + --host-template-id=N - Run for a specific Device Template + --data-template-id=N - Run for a specific Data Template + --debug - Display verbose output during execution + +System Controlled: + --type - The type and subtype of the rebuild poller cache process + --child - The thread id of the child process --d - Display verbose output during execution --v --version - Display this help message --h --help - Display this help message ``` Debug mode lists the data sources items that are worked upon. @@ -181,17 +211,15 @@ the script with the parameter `--help` yields ```console shell>php -q poller_reindex_hosts.php --help -Cacti Reindex Host Script 1.2, Copyright 2004-2026 - The Cacti Group +Cacti Reindex Host Utility, Version 1.2.x (DB: 1.2.x), Copyright (C) 2004-2026 The Cacti Group +usage: poller_reindex_hosts.php --id=[host_id|all] [--qid=[ID|all]] + [--host-descr=[description]] [--debug] -usage: poller_reindex_hosts.php --id=[host_id|All] [--qid=[ID|All]] [--host-descr=[description]] - [-d] [-h] [--help] [-v] [--version] - ---id=host_id - The host_id to have data queries reindexed or 'All' to reindex all hosts ---qid=query_id - Only index on a specific data query id; defaults to 'All' +--id=host_id - The host_id to have data queries reindexed or 'all' to reindex all hosts +--qid=query_id - Only index on a specific data query id; defaults to 'all' --host-descr=description - The host description to filter by (SQL filters acknowledged) +--force - Force Graph and Data Source Suggested Name Re-mapping for all items --debug - 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 @@ -229,7 +257,7 @@ DEBUG: Data query number '3' host: '15' SNMP Query Id: '1' ending It is possible, to select a host based on its host description using `--host-descr=[host description]`. It is allowed to apply an SQL filter -expression for the description like `--qid=some%descr`. Use this parameter in +expression for the description like `--host-descr=some%descr`. Use this parameter in conjunction with either `--id=[host id]` or `--qid=[data query id]` or both: ```console @@ -261,12 +289,12 @@ parameter `--help` yields ```console shell>php -q poller_output_empty.php --help -Cacti Empty Poller Output Table Script 1.0, Copyright 2004-2026 - The Cacti Group +Cacti Process Poller Output Utility, Version 1.2.x (DB: 1.2.x), Copyright (C) 2004-2026 The Cacti Group -usage: poller_output_empty.php [-h] [--help] [-v] [--version] +usage: poller_output_empty.php + +A utility to process the poller output table. This tool is deprecated but should work. --v --version - Display this help message --h --help - Display this help message ``` You see, no parameter is required for operating successfully. Under normal @@ -321,15 +349,20 @@ poller_graphs_reapply_names.php drops in. Calling the script with the parameter ```console shell>php -q poller_graphs_reapply_names.php --help -Cacti Reapply Graph Names Script 1.0, Copyright 2004-2026 - The Cacti Group +Cacti Reapply graph Names Utility, Version 1.2.x (DB: 1.2.x), Copyright (C) 2004-2026 The Cacti Group -usage: poller_graphs_reapply_names.php -id=[host_id|All][host_id1|host_id2|...] [-s=[search_string] [-d] [-h] [--help] [-v] [--version] +usage: poller_graphs_reapply_names.php --host-id= [--filter=] [--debug] + +A utility to reapply Cacti Graph naming rules to existing Graphs in bulk. + +Required: + --host-id=id|all|N1,N2,... - The device id, 'all' or a comma delimited list of ids + --id and -id - Aliases for --host-id + +Optional: + --filter=string - A Graph Template name or Graph Title to search for + --debug - Display verbose output during execution --id=host_id - The host_id or 'All' or a pipe delimited list of host_id's --s=search_str - A graph template name or graph title to search for --d - Display verbose output during execution --v --version - Display this help message --h --help - Display this help message ``` Assume a situation, where the suggested names where changed for the standard @@ -337,7 +370,7 @@ data query named `SNMP - Get Mounted Partitions`. In this case, you will want to rework all graphs for this data query only. A verbose run will yield ```console -shell>php -q poller_graphs_reapply_names.php -id=All -d -s="Used space" +shell>php -q poller_graphs_reapply_names.php --host-id=all -d --filter="Used space" WARNING: Do not interrupt this script. Interrupting during rename can cause issues DEBUG: There are '6' Graphs to rename DEBUG: Graph Name 'Localhost - Used Space - Memory Buffers' starting @@ -354,8 +387,8 @@ DEBUG: Graph Name 'Localhost - Used Space - /boot' starting DEBUG: Graph Rename Done for Graph 'Localhost - Used Space - /boot' ``` -Notice the miss-spelling of the word “Space”. The `-s=` option is not case -sensitive. +Notice the miss-spelling of the word “Space”. The `--filter` option (also +accepted as `-s`) is not case sensitive. ## Copy Local Cacti Users @@ -366,8 +399,8 @@ Calling the script with the parameter `--help` yields ```console shell>php -q copy_user.php --help -Cacti Copy User Utility, Version 1.2.0, Copyright (C) 2004-2026 The Cacti Group -usage: copy_cacti_user.php