* docs: update stale PHP/MySQL/MariaDB version requirements - Requirements.md: PHP 5.4 -> 8.1 (matches 1.2.31+ requirement note) - Requirements.md: MySQL 5.6 -> 5.7, MariaDB 5.5 -> 10.2 (current minimums) - Requirements.md: MySQL section header updated to >= 5.7 / 10.2 - Requirements.md, Install-Under-CentOS_LAMP.md, Install-Under-CentOS_LEMP.md, Installing-Under-Windows.md: comment out innodb_file_format and innodb_large_prefix (removed in MySQL 8.0 / MariaDB 10.3+) Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * docs: upgrade http:// links to https:// and fix dead wiki URLs - Upgrade http:// to https:// in 8 files: General-Installing-Instructions.md, Graph-Templates.md, How-To-SSH-Tunnels.md, Plugin-Development.md, Standards-Code-Formatting.md, Templates.md, Upgrading-Cacti-Under-Windows.md - Replace two dead docs.cacti.net wiki links: How-To-SSH-Tunnels.md: old wiki SNMP guide -> Net-SNMP man page Plugin-Syslog.md: dead plugin:syslog.config -> plugin_syslog repo Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * docs: fix technically inaccurate MySQL configuration recommendations - innodb_additional_mem_pool_size: removed in MySQL 5.7.4 / MariaDB 10.0; replaced with removal notice in Requirements.md and comments in Install-Under-CentOS_LAMP.md and Install-Under-CentOS_LEMP.md - max_heap_table_size: clarify ">= 5" means ">= 5% of system RAM" - innodb_buffer_pool_size: clarify ">= 25" means ">= 25% of system RAM" Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * docs: add missing required PHP extensions to Requirements.md Add dom, mysqlnd, pcntl, Phar, and sqlite3 — all declared as required in composer.json but absent from the module list. pcntl is Linux-only (process control for the poller). Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * docs: fix 36 spelling errors across 19 documentation files Corrections detected by codespell: - somone->someone, Walkthough->Walkthrough, GUAGE->GAUGE - asociate->associate, messege->message, therefor->therefore - get's->gets, Proxys->Proxies, paralelisation->parallelization - parms->params (6 instances in script data query examples) - finialise->finalise, buildin->built-in, everytime->every time - Unistall->Uninstall, resiliant->resilient, build-in->built-in - requriments->requirements (2 instances), explanitory->explanatory (3 instances) - fro->for, invole->involve, reulting->resulting - stauts->status, tge->the Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * ci: add codespell spelling check workflow for documentation Adds GitHub Actions workflow that runs codespell==2.4.1 on all Markdown files on every push/PR to main. Also adds .codespell.cfg to skip binary and generated files (JSON, shell scripts, HTML, images). Update .gitignore to allow .github directory (was blocked by .git* glob). Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * docs: improve voice, consistency, and note formatting across 10 files - Convert passive/impersonal constructions to active voice - Standardize NOTE -> Note in blockquotes for consistency - Reformat inline IMPORTANT/Note callouts as blockquotes - Fix awkward phrasing in LXC container notes - Consolidate fragmented note bullets into single blockquote Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * docs: fix technical accuracy and correct typos across 10 files - Requirements.md: clarify Composer is for source/develop installs only; RRDtool minimum updated to 1.5+ (1.8+ for 1.3.x); php-snmp section rewritten to describe selective fallback behavior; SELinux/AppArmor advice reworded to recommend policy exceptions over blanket disable - Spine.md: fix PHP Script Server range (10 -> 15); fix 'senstivive' and 'Davices' typos - Trees.md: fix broken table rows split across lines; 'Sporting' -> 'Sorting' - Data-Sources.md: restructure storage table to standard 3-column layout; fix '19b' unit typo -> '19kb' - How-To-SNMP-Custom-Script.md: convert bold/backtick commands to proper fenced code blocks; fix 'intex' and 'BNSMPD' typos - Plugins.md: fix 'onfiguration' typo; fix YouTube thumbnail http -> https; fix 'Tuturial' typo - Standards-Security.md: fix 'invalidate' -> 'invalid' - template_apache_config.md: fix 'apcache2' -> 'apache2' - device-template-specific-proxmox.md: replace service file edit with drop-in approach; remove ProtectSystem=off/ProtectHome=off; add note on minimal required systemd overrides - resource/xml/query_interface_traffic.php: http -> https URL Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * docs: rename CentOS install guides to Enterprise Linux; fix grammar, logic, and security flaws - Rename Install-Under-CentOS_LAMP.md → Install-Under-Enterprise-Linux-LAMP.md - Rename Install-Under-CentOS_LEMP.md → Install-Under-Enterprise-Linux-LEMP.md - Update README.md ToC links to match new filenames and correct labels LAMP fixes: - Title updated to reflect RHEL/Rocky Linux/AlmaLinux coverage - Fix step numbering: "2.Install" / "3.Enable" missing space after number - Spine build deps: restructure for EL7/EL8/EL9+ separately; EL8 was missing package install after repo enable; EL9+ uses 'crb' not 'powertools' - SELinux URL: fix quadruple-slash typo; switch to English wiki URL LEMP fixes: - Title: "CentOS 7" → "Enterprise Linux (RHEL / Rocky Linux / AlmaLinux)" - TLS: remove TLSv1 and TLSv1.1 (RFC 8996 prohibited, fails OpenSSL 3.x); set ssl_protocols TLSv1.2 TLSv1.3 - Ciphers: remove DH+3DES (Sweet32 / CVE-2016-2183) - HTTP redirect: uncomment return 301 (comment claiming nginx lacks support for 'return' has been wrong since nginx 0.8 / 2009) - PHP location block: fix 'alias' → 'root' (alias breaks $document_root in fastcgi_param SCRIPT_FILENAME); add missing semicolon after index directive - Cron: poller path was /var/www/html/cacti but install target throughout this guide is /usr/share/nginx/html/cacti — align them - DB: split GRANT...IDENTIFIED BY into CREATE USER + GRANT (IDENTIFIED BY on GRANT removed in MySQL 8.0 / MariaDB 10.5.2) - Fix comment typo: "Compression increases performance0" → remove trailing 0 - SELinux URL: fix quadruple-slash typo README.md: - Update section 3.1 and 3.2 links to new filenames - Correct labels from "CentOS 7" to "Enterprise Linux" - Fix "Reports Admistrative Interface" → "Administrative" - Fix "requriments" (×2) → "requirements" * docs: remove Install-Under-CentOS_LAMP.md (superseded by Install-Under-Enterprise-Linux-LAMP.md) * docs: remove Install-Under-CentOS_LEMP.md (superseded by Install-Under-Enterprise-Linux-LEMP.md) * docs: update README ToC links and fix typos - Update 3.1 and 3.2 links from CentOS to Enterprise Linux filenames - Correct labels: "CentOS 7" → "Enterprise Linux (RHEL/Rocky/AlmaLinux)" - Fix "Reports Admistrative" → "Reports Administrative" - Fix "requriments" (×2) → "requirements" * docs: fix grammar, logic, and technical errors in remaining install/upgrade guides Installing-Under-Windows.md: - Replace php_mysql.dll with php_pdo_mysql.dll (php_mysql removed in PHP 7.0) - Remove IIS ISAPI steps referencing php8isapi.dll (ISAPI dropped in PHP 8.0); replace with FastCGI instructions via php-cgi.exe - Remove NO_AUTO_CREATE_USER from sql_mode (removed MySQL 8.0, breaks startup) - sort_buffer_size = 200M → 32M with caveat (per-session; 200M causes OOM under load) - Fix step numbering gaps: main list 5→8, IIS 3→5, Finishing 5→8 - "you will have to user 8.3 notation" → "use" - "c:cygwin" → "c:\cygwin" (missing backslash) - "it's subfolders" → "its subfolders" - "A anm example" → "An example" - "verify/udate" → "verify/update" Installing-Under-Ubuntu-Debian.md: - Cron user: apache → www-data (apache user does not exist on Ubuntu/Debian) - CREATE DATABASE: use utf8mb4 directly; remove redundant ALTER DATABASE - php8.1-mbstring listed twice in apt-get install; deduplicated - "may received" → "may receive" - Note php8.1 is EOL; recommend checking current supported release Upgrading-Cacti-Under-Windows.md: - Fix all steps numbered 1. → proper sequential numbering (1–10) - Remove hardcoded MySQL 5.7 path; use generic %MYSQL_HOME% note Upgrading-Cacti-Under-FreeBSD.md: - mysqldump: remove contradictory -l / --lock-tables=false flags; replace with --single-transaction (correct for InnoDB, no locking) How-To-SSH-Tunnels.md: - Add prominent note: SSH -L is TCP-only; standard SNMP uses UDP; this guide requires TCP transport configured on snmpd and does not work for most network devices - Fix unclosed code fence after ssh-keygen output block - Replace rc.local persistence with systemd unit (rc.local is deprecated and disabled by default on systemd distros: Ubuntu 16.04+, Debian 9+) - ssh-keygen: recommend ed25519 over RSA * docs: correct PHP 8.1 EOL date, Net-SNMP link, and grammar PHP 8.1 security support ended 31 December 2025, not November 2024. Point the snmpd.conf link at www.net-snmp.org (the sourceforge.io mirror is bot-blocked). Fix 'There a two ways extending' to 'There are two ways to extend'. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * ci: fix spelling workflow trigger to target develop, not main The repo's default branch is develop; main hasn't moved since 2023. The workflow's push/pull_request filters targeted main, so it never ran on any PR opened against develop. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
19 KiB
Variables
Graph Variables
Graphs Variables are special use replacement variables used to take information from the following objects and use them in the context of a Cacti Graph:
- Cacti Device - host information
- Data Query - input query meta data
- Data Input - input variables
- Nth Percentile - formulas
It also allows you additional one single use replacement variables like:
- Data Source Name - The name of your Data Source
- Date Time - The date and time the graph was rendered.
In the examples below, you will be able to see how to use these values. They can be used in:
- Graph and Graph Template - Titles
- Graph and Graph Template - Comments
- Data Query - Suggested names for Graphs and Data Sources
- Data Source - Min and Max Data Source Limits
- Aggregate Graphs and Templates - Prefixes
All Graph Variables are enclosed by pipe characters as shown in the examples below.
Date/Time
|date_time|
This variable will place the date and time of the last poller run on the graph. It can be used to replicate MRTG's "graph last updated" feature.
Data Source Title
|data_source_title|
This variable, |data_source_title|, gets replaced with the name of the data
source associated with a particular graph item in a graph template. This change
allows the creation of generic graph templates (2-variable line graph,
3-variable stack, etc.) which can be reused with large numbers of data sources.
See attached examples to understand usage.
The example graphs below, show how the output may look, but for a slightly different Case.
Data Query Fields
|query_field_name|
You can place the value of any data query field on the by including this variable. Make sure to substitute "field_name" with the actual data query field name.
|query_ifIP|
|query_dskPath|
Data Input Arguments
|input_hostname|
|input_ip_address|
Nth Percentile
|[0-9]:(bits|bytes):[0-9]:(current|total|max|total_peak|all_max_current|all_max_peak|aggregate_max|aggregate_sum|aggregate_current|aggregate):[0-9]|
Nth percentile is often used by hosting providers to bill customers based on their peak traffic usage while ignoring their top (100 - Nth) percent. This way if a customer has a fairly consistent traffic pattern and decides to download a huge file one day, the large spike will be ignored. Common Nth percentile is 95, which would cut off the top 5% of the traffic.
The Nth Percentile variables, when placed in Graph Comments will be detected and the syntax will be parsed and the resulting numeric value will replace the formula. They are used in both 95th Percentile and Bandwidth Traffic Graphs today.
In Cacti, Nth percentile works just like any other graph variable. To use this variable you must give it five arguments:
Table 15-1. Nth Percentile Argument Description
| Name | Description |
|---|---|
| [0-9] | The first argument is a number between 1 and 99. This number represents the Nth percentile that you would like to calculate. |
| (bits | bytes) | Choose whether you want to represent your Nth percentile in bits or bytes. The only valid values for this field are 'bits' and 'bytes'. |
| [0-9] | This field determines the power of 10 divisor that will be applied to your Nth percentile number. Enter '0' to leave the number alone, '3' for kilo or '6' for mega, etc. |
| ( current | total | max | total_peak | all_max_current | all_max_peak | aggregate_max | aggregate_sum | aggregate ) | Nth Percentile Type - Refer to Nth Types below |
| [0-9] | Enter the number of digits to use for floating point precision when printing out the final number. The default value for this field is two decimal places. |
Table 15-2. Nth Percentile Types
| Type | Description |
|---|---|
| current | Calculates the Nth percentile based off the selected data source on the graph item which the variable is used. This type requires a selected Data Source Item in the graph item in which it is defined. |
| total | Calculates the Nth percentile based off the selected data source on the graph item which the variable is used. But unlike current, this function totals the Nth percentile results of all same named data source names on the graph. Example, all traffic_in would have their Nth percentile calculated and then totaled. This type requires a selected Data Source Item in the graph item in which it is defined. |
| max | Calculates the Nth percentile based off the selected data source on the graph item which the variable is used, but it is important to note that it selects the higher of the values for each row in data source and then uses the resulting set to calculate the Nth percentile. Example, you have selected a interface data source for traffic_in, this will evaluate traffic_out and traffic_in for that selected data source (RRDtool file) and select the higher of the two values for each row of data. The resulting max values are used to calculate the Nth percentile value. This type requires a selected Data Source Item in the graph item in which it is defined. |
| total_peak | Calculates the Nth percentile based on the max for each data source defined on the graph. Example, the max is taken for each data source defined on the graph, but it's the max of traffic_in or traffic_out for that data source (RRDtool file). The resulting max values are summed and returned. |
| all_max_current | Calculates the Nth percentile based off the selected data source on the graph item which the variable is used, but it only selects the highest (max) value of all the data source items on the graph. Example, there are 3 data sources defined on the graph, the selected data source is traffic_in, all data sources for traffic_in will be compared against each other and the highest Nth value of all graph items will be selected as the result. This type requires a selected Data Source Item in the graph item in which it is defined. |
| all_max_peak | Calculates the Nth percentile by selecting the highest (max) calculated max Nth percentile value for each data source (RRDtool file) selected on the graph. Example, 3 data sources are defined on the graph, for each data source, the max Nth percentile is calculated, and out of the resulting set of values, the highest value is selected and returned. |
| aggregate_max | Calculates the Nth percentile by selecting the highest value for each summed value of like data sources and selecting the maximum value of that set to calculate the Nth percentile value. Example, you have a graph with 5 traffic_in and 18 traffic_out data sources. The traffic_in rows are summed together, then the traffic_out rows are summed together, then for each row, the higher of the 2 values is selected. The Nth percentile is calculated from the resulting maximum values. |
| aggregate_sum | Calculates the Nth percentile by summing all data sources on the graph row for row and calculates the Nth value on the resulting summed data. Example, you have a graph with 4 traffic_in and 3 traffic_out data sources defined. All the defined traffic_in and traffic_out are summed together and then the Nth percentile value is calculated from that set. |
| aggregate | Calculates the Nth percentile by summing like data source names row for row from each data source defined on the graph and then returning the highest Nth percent value calculated for like data source names. Example, you have a graph with 3 traffic_out and 5 traffic_in data sources defined. The traffic_in and traffic_out are summed then the Nth value is calculated and the higher of the 2 values is returned as the variable. |
Note
All data sources used in a graph MUST have the same RRA definitions. If the number of rows do not match when calculations are attempted, the results may produce errors and invalid results. Please also be aware the aggregate functions take more memory and processor power when used. Recommended minimum of 64 megs memory limit for PHP when querying large ranges or graphs with a large amount of aggregated data sources.
Example 15-3. Output in the following format, for 95th percentile: 42.58 mbit
|95:bits:6:max:2|
Bandwidth Summation
|sum:([0-9]|auto):(current|total):([0-9]):([0-9]+|auto)|
Bandwidth summation is useful for summing up all values in an RRDfile for a given time range. This is typically useful on traffic graphs where you can see a total of all traffic that has gone through an interface in a given time period.
In Cacti, bandwidth summation works just like any other graph variable. To use this variable you must give it three arguments:
Table 15-3. Bandwidth Summation Argument Description
| Name | Description |
|---|---|
| ([0-9] | auto) | This field determines the power of 10 divisor that will be applied to your number. Enter '0' to leave the number alone, '3' for kilo or '6' for mega, etc. You can also enter 'auto' for this field to have Cacti automatically scale the number and insert the appropriate label. |
| (current | total) | You can choose to calculate the summation based on the current data source or a total of all data sources used on the graph. The only valid values for this field are 'current' and 'total'. |
| [0-9] | Enter the number of digits to use for floating point precision when printing out the final number. The default value for this field is two decimal places. |
| ([0-9]+ | auto) | Enter the number of seconds in the past to perform the summation calculation for. For instance '86400' for 24 hours, '172800' for 48 hours, etc. You can also enter 'auto' for this field to have Cacti use the graph timespan. |
Example 15-4. Output in the following format: 36.47 GB
|sum:auto:current:2:auto|
Host Variables
Host variables represent host data and can be placed in graph or data source titles. The following table describes which host variables can be used and which host fields the correspond to.
Table 15-4. Host Variables
| Variable Name | Description |
|---|---|
| |host_availability| | Availability of host |
| |host_avg_time| | Average time for host |
| |host_cur_time| | Current time for host |
| |host_description| | Description |
| |host_external_id| | ID associated with external system |
| |host_hostname| | Hostname |
| |host_id| | Numerical ID of the Host as it is maintained in the MySQL Tables |
| |host_location| | Location |
| |host_max_oids| | SNMP Max OIDs for snmpbulkwalk |
| |host_notes| | Administrative Notes |
| |host_ping_retries| | Ping Retries (Downed Host Detection) |
| |host_polling_time| | Last polling time |
| |host_snmp_auth_protocol| | SNMP Authentication Protocol (v3) |
| |host_snmp_community| | SNMP Community |
| |host_snmp_context| | SNMP Context (v3) |
| |host_snmp_engine_id| | SNMP Engine Id (v3) |
| |host_snmp_password| | SNMP Password (v3) |
| |host_snmp_port| | SNMP Port |
| |host_snmp_priv_passphrase| | SNMP Privacy Passphrase (v3) |
| |host_snmp_priv_protocol| | SNMP Privacy Protocol (v3) |
| |host_snmp_sysContact| | SNMP Contact |
| |host_snmp_sysDescr| | SNMP Description |
| |host_snmp_sysLocation| | SNMP Location |
| |host_snmp_sysName| | SNMP System Name |
| |host_snmp_sysObjectID| | SNMP ObjectID |
| |host_snmp_sysUpTimeInstance| | SNMP Up Time |
| |host_snmp_timeout| | SNMP Timeout |
| |host_snmp_username| | SNMP Username (v3) |
| |host_snmp_version| | SNMP Version |
| |host_uptime| | SNMP Uptime |
Example Use
Below you can see the example in the SNMP - Interface Statistics Data Query of
how they are used for suggested names.
And in Bandwidth Graph Template.
In the images above, you can see both the Title of the Graph and the Comments showing the use of the bandwidth replacement variables.
Copyright (c) 2004-2026 The Cacti Group




