Files
Cactidocumentation/Plugin-Reference.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

145 lines
4.7 KiB
Markdown

# Reference Plugins
FIXME The reference plugin is under development. Nothing to see here yet.
The Reference Plugin(s) are generic plugins that implement key pieces of the
Plugin Architecture.
They are broken down into several separate plugins, each covering different
portions of the [Hook API Reference](Plugin-Hook-API-Ref.md).
## Standard Files
The following files should be included in every plugin
* CHANGELOG
* INFO
* LICENSE
* index.php
* README.md
* setup.php
In general, the index.php file example below should be included in every plugin
directory as it prevents remote file browsing of your Cacti site.
```php
<?php
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
| |
| This program is free software; you can redistribute it and/or |
| modify it under the terms of the GNU General Public License |
| as published by the Free Software Foundation; either version 2 |
| of the License, or (at your option) any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
+-------------------------------------------------------------------------+
| Cacti: The Complete RRDtool-based Graphing Solution |
+-------------------------------------------------------------------------+
| This code is designed, written, and maintained by the Cacti Group. See |
| about.php and/or the AUTHORS file for specific developer information. |
+-------------------------------------------------------------------------+
| https://www.cacti.net/ |
+-------------------------------------------------------------------------+
*/
header("Location:../index.php");
?>
```
## File Structure
All plugin files should reside under their own respective plugin directory. The
example below is for a plugin called 'myplugin'.
```console
myplugin/
images/
myimage.png
index.php
lib/
index.php
functions.php
include/
index.php
settings.php
CHANGELOG
INFO
LICENSE
README.md
index.php
setup.php
```
## Contents of Files
The four core sub-directories included in your plugin should be docs, images,
lib, and include. As previously mentioned, each of these directories should
include an index.php that points to its parent directory index.php. This way
we prevent people from randomly browsing the contents of our web site.
The two main files required for every plugin are the INFO and the setup.php
file. Without these two files, the plugin directory will not be recognized as a
valid plugin and will be skipped.
The INFO file is formatted as a Microsoft standard INI file. It contains
information about the plugin including its version, author, dependencies,
functions, and minimum version of Cacti and other plugins required. Below, you
can see a reference INFO file for the myplugin plugin.
```console
[info]
name = myplugin
version = 1.0
longname = My First Plugin
author = Depeche Mode
email = somewhere@outthere.com
homepage = http://www.outthere.com
compat = 1.2
requires = thold monitor
capabilities = online_view:1, online_mgmt:1, offline_view:0, offline_mgmt:0, remote_collect:0
```
The setup file includes key plugin functions that allow the plugin to be
installed, uninstalled, upgraded, etc. Those core functions include:
```php
<?php
function plugin_myplugin_install() {
}
function plugin_myplugin_uninstall() {
}
function plugin_myplugin_check_config() {
}
function plugin_myplugin_upgrade() {
}
function plugin_myplugin_version() {
}
?>
```
Without these core functions, in your setup.php, your plugin will not fully
operate. We will document those functions and what they should include as we
continue to document the plugin design principles.
Any core plugin functions should always be placed in the lib/functions.php file,
and settings should go into the include/settings.php file. The plugin
architecture allows hooks to be defined that reach into the include/settings.php
file. Having those hooks point to the include version of the file will keep
Cacti page loads fast. Including too much in the setup.php slows Cacti and
should be avoided.
---
Copyright (c) 2004-2026 The Cacti Group