Files
Cactidocumentation/CDEFs.md
T
Thomas Vincent 741ad51355 docs: [1.2.x] refresh the front page, correct grammar and Markdown, and align plugin pages with their READMEs (#273)
* docs: [1.2.x] refresh the manual front page

The front page opened with version notes before saying what Cacti is,
used headings as sentences in the credits, and its table of contents
listed seven sections while the page has ten.

Open with a short description and a getting-started sequence, link the
website and forums, give the credits real headings, and list every
section in the table of contents in page order. Record Jeff Pasnak
under In Memoriam with a link to the 1.2.31 release announcement.
Correct label typos and wrap long entries with reference links.

Existing section anchors are unchanged, and every page is still linked.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* docs: [1.2.x] fix typos, unrendered headings and forum links

A check of every page linked from the front page found misspellings in
eleven pages, three Mactrack headings written without a space after the
hashes, which render as plain text, and two forum links still using
http.

Correct the spellings, add the missing space so the headings render,
and point the forum links at https, where they already redirect.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* docs: [1.2.x] align the plugin pages with the plugin READMEs

The supported plugins list and the Syslog and Mactrack pages had drifted
from the README and INFO files in the plugin repositories.

Update the descriptions that the READMEs contradict: Monitor's Thold
requirement, the Router Configs transfer methods, the ReportIt release
and Cacti versions, the WMI collection methods and its development
status, and NUT support in Apcupsd. Add the Syslog requirements, the
upgrade procedure, the dedicated database settings and the remote
collector settings, and correct the database grant and a misplaced
code fence. Add the Mactrack requirements and a short section on
history partitioning and ignored ports that links to the README.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* docs: [1.2.x] correct grammar, spelling and broken Markdown

A read of every page linked from the front page found grammar and
spelling errors throughout, and Markdown that does not render as
intended.

Correct grammar, spelling, punctuation and product-name capitalization
in 95 pages without changing headings, code blocks, link targets or
the meaning of the text. Repair the Markdown defects: a code fence in
the SSH tunnel how-to that never closed, malformed bold markers in the
user management and device defaults pages, a release notes table with
no blank line before it, split rows in the tree sorting table, and
LDAP list items missing their markers. Correct three interface labels
quoted with typos.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

* docs: [1.2.x] correct statements that differ from the 1.2.x source

Reviewers of the linked pages flagged statements that looked wrong.
Each was compared with the Cacti 1.2.x source at 1523aa04b, and only
those the source or the page itself settles are changed.

Correct interface labels and option names (Index Count Changed,
Permissive, Not Selected, Utilities, the BCC description, the gear
icon for plugin install), the default Maximum Value of U for a new
data source item, the sysDescr object name, the PHP floor wording in
the requirements table, the Mactrack wildcard character and the
snmptrapd -On option. Repair cross-references, example values that
disagree with their commands, two table captions, a split list and
several sentences with missing words.

Statements the source does not settle are left as written.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

---------

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
2026-11-24 00:58:06 -08:00

5.1 KiB

CDEFs

Background

CDEF's in Cacti are a one to one analog to CDEF's in RRDtool. Cacti simply provides an interface to create and manage them. Once the CDEF's are created in Cacti they can be imported and exported globally.

CDEF's are mathematical formulas that either modify the numeric data from one to many data sources or VNAMES that you have in your Graph Template.

The format of the mathematical formulas is called Reverse Polish Notation (RPN). RPN was and is an early form of how Engineers entered equations into early HP and other Calculators to solve Engineering problems. The reason we still use it today, is that it follows a simple Stack principle. In other words, it's not broken.

CDEF's can get very complex as there are several mathematical functions available in the RRDtool command set.

CDEF Interface

In the image below, you can see all the CDEF's that are included in Cacti by default. There are quite a few of them. Many of the formulas in use are quite simple. If you want to view Tutorials on how to work with CDEF's you should go to the RRDtool Tutorial. There is also documentation at the RRDtool Website.

In this image you can see that you have the ability to Delete or Duplicate a CDEF, but note you will not be able to Delete any CDEF that is associated with a Cacti Graph or Graph Template.

CDEFs

When you Click on the CDEF's name, you will enter into an Edit screen. From there you will see an ordered list of your Stack. It normally will begin with something like the CURRENT_DATA_SOURCE which means that when you Add a Graph Item to either a Graph Template or Graph, you can select a CDEF. The Data Source associated with that Graph Items is the CURRENT_DATA_SOURCE.

After that, you may see a numeric number, followed by a math operator. That is the simplest form of a CDEF. If you have drag & drop enabled, you can re-order the CDEF items using drag & drop. Otherwise you will see arrows that allow you to move the CDEF Items up and down.

CDEFs Edit

When editing a CDEF, the first decision is what Type of Data you want to put on the Stack, your options as shown in the image below. They include:

Name Description
Function A mathematical function that we will describe below
Operator Common mathematical operators including (+, -, *, /, and %)
Another CDEF Another Cacti CDEF. That could be confusing
Custom String Something like a number, a 'U' or 'Nan' for example

CDEFs Item Type Edit

Special Data Sources

In this next Image, you will find a CDEF Item in the process of being added. Note that when you pick Special Data Source you have a drop-down that appears with the flavor of Special Data Source. There are many. They include:

Name Description
Current Graph Item Data Source The value of the Data Source associated with the Graph Item
Current Graph Item Polling Interval This value is otherwise known as the Step in RRDtool terminology
All Data Sources (Do not Include Duplicates) The total of all Data Sources removing any duplicate DEF's
All Data Sources (Include Duplicates) Add the values from all the Data Sources whether or not they are duplicated
All Similar Data Sources (Do not Include Duplicates) Means all Data Sources with the same RRDtool Data Source name like traffic_in, and traffic_out
All Similar Data Sources (Do not Include Duplicates) Polling Interval The polling interval (the step) of the Data Source associated with the Graph Item
All Similar Data Sources (Include Duplicates) Add the values from all Data Sources with the same RRDtool Data Source name whether or not they are duplicated
Current Data Source Item: Minimum Value The RRDtool minimum value of the Current Data Source
Current Data Source Item: Maximum Value The RRDtool maximum value of the Current Data Source
Graph: Lower Limit The lower Limit of the Graph
Graph: Upper Limit The upper Limit of the Graph
Count of All Data Sources (Do not Include Duplicates) The total count of all Data Sources without Duplication
Count of All Data Sources (Include Duplicates) The total count of all Data Sources including Duplicates
Count of All Similar Data Sources (Do not Include Duplicates) The total count of Data Sources with the same RRDtool Data Source Name
Count of All Similar Data Sources (Include Duplicates) The total count of Data Sources with the same RRDtool Data Source Name

As you can see there is quite a bit of information that can be pulled from RRDtool for performing Graphical manipulation of Data.

CDEFs Item Edit

CDEF Functions

This list of CDEF functions is long and it's best to refer directly to the RRDtool Manual for meanings and examples of their use. Cacti supports all of them; if you find one that is not supported, open an Issue on GitHub.


Copyright (c) 2004-2026 The Cacti Group