Cacti plugins extend the web interface and the polling process. The plugin architecture grew out of Jimmy Conner's work on the SquirrelMail project.
- Thold checks data source values against thresholds.
- Syslog collects log messages and matches them against rules that can trigger alerts.
- Monitor shows device status on a dashboard.
- Intropage displays Cacti metrics on a single page.
- Weathermap displays live data on network diagrams.
Read the plugin's installation and removal instructions before enabling it. To start a new plugin, see Creating Plugins.
Plugins written for Cacti 0.8.x need changes to run on Cacti 1.x. Cacti 1.x uses the Plugin Architecture (PIA) 2.x installation and setup conventions.
For an example of how a maintained plugin registers its hooks, see Graph Export. For a core page with list filters, pagination, and bulk actions, see vdef.php on the development branch. Use the corresponding file on the branch you support.
- Create an
INFOfile in the plugin directory and update the installation and setup functions insetup.php. See Creating Plugins. - Replace direct header includes with the function for the page. Use
top_header()for a console page,top_graph_header()for a graph page, orgeneral_header()for the general header. End the page withbottom_footer(). - Use the link classes from the corresponding core page so Cacti can attach
its navigation callbacks. When an AJAX request needs only the page content,
include
header=falsein the destination URL. - Keep form controls inside their form and use valid HTML table markup. For paginated tables, render the navigation bar above and below the table.
- Validate named request fields with
get_filter_request_var(). Its default filter checks integers. Choose a filter appropriate to the field. After validation, useget_request_var()to read the value. Useisset_request_var()andisempty_request_var()to check presence or emptiness, andset_request_var()to set a request value. - For bulk actions with dynamically named checkboxes, inspect the submitted
field names. For example,
vdef.phpmatcheschk_followed by digits and validates the extracted ID. Check the user's permission for each selected object before applying the action. - Remove hooks that load jQuery or jQuery UI into the page header. Cacti already supplies both libraries.
- Use Cacti's CSS classes for colors and alternating table rows. Remove
inline styles and references to the legacy
$colorsarray. - Use AJAX callbacks to refresh filtered results. For list pages that keep
filters between requests,
validate_store_request_vars()validates the fields and stores their values in the session when given a session prefix. - Use the table helpers for sortable headings, checkbox columns, tooltips,
and alignment. Use
html_nav_bar()to generate pagination links.
The INFO file uses INI syntax. Put the following keys in its [info]
section.
nameis the plugin's directory name.versionis the plugin's version number.longnameis the plugin's display name.author,email, andhomepageidentify the maintainer and provide contact information.compatspecifies the Cacti versions the plugin supports. A bare version sets the minimum. Use this form for plugins that support Cacti 1.2.x.requireslists plugin dependencies. Separate entries with a single space. Each entry gives the directory name and can include a colon followed by a minimum version. For example,thold:1.2.1 monitor:2.0requires Thold 1.2.1 or later and Monitor 2.0 or later.capabilitiesis a comma-separated list of flags that describe which operations the plugin supports on a remote data collector.nosyncis a comma-separated list of files or directories to skip at the top level of the plugin directory. An entry such as*.csvskips files with that extension at the top level. Throughout the directory tree, Cacti skips files ending intar,gz,zip,tgz,ttf,z,exe,pack,swp, andswo.
Monitor 3.0 declares Thold as a dependency. Cacti checks the installed version of Thold before it installs Monitor.
[info]
name = monitor
version = 3.0
longname = Device Monitoring
author = The Cacti Group
email =
homepage = http://www.cacti.net
compat = 1.2.29
requires = thold:1.2.1
capabilities = online_view:1, online_mgmt:1, offline_view:0, offline_mgmt:0, remote_collect:0Syslog 5.0 excludes its local configuration file from synchronization and declares which hooks it uses on a remote collector.
[info]
name = syslog
version = 5.0
longname = Syslog Monitoring
author = The Cacti Group
email =
homepage = http://www.cacti.net
compat = 1.2.23
nosync = config.php
capabilities = online_view:1, online_mgmt:1, offline_view:1, offline_mgmt:1, remote_collect:0, remote_poller:1With nosync = config.php, each collector can keep its own Syslog
configuration. The remote_poller:1 flag allows Cacti to run the plugin's
registered poller_bottom hook on a remote collector. Collection hooks such
as poller_top and poller_output use remote_collect, which Syslog sets
to 0. See the plugin hook reference for hook
descriptions.
The 1.3 development branch accepts a range in compat. Quote the value,
attach each operator to its version, and separate comparisons with a space.
The following example includes 1.3.0 and excludes 1.4.0. In requires, each
space starts a new dependency, so keep each plugin and its version together.
[info]
compat = ">=1.3.0 <1.4.0"
requires = thold:1.2.1 monitor:2.0For browser charts, Cacti includes billboard.js, D3, and Chart.js. Cacti 1.2.x also ships dygraphs and jQuery Sparklines. Check the JavaScript files on each branch your plugin supports before choosing a library.
On the development branch, open Configuration > Settings in the console. On the Logging tab, select the plugin under Selective Plugin Debug. Use Selective File Debug for individual files or Selective Device Debug to trace polling for specific device IDs. See Log Settings.
Copyright (c) 2004-2026 The Cacti Group