Skip to content

Cacti

homepage-banner

What is Cacti?

Cacti is a robust performance and fault management framework and a frontend to RRDTool, a Time Series Database (TSDB). It stores all the necessary information to create performance management graphs in either MariaDB or MySQL, and then uses its various Data Collectors to populate the RRDTool-based TSDB with performance data.

Cacti is also a LAMP stack web application. Originally, LAMP stood for Linux, Apache, MySQL, and PHP, but over the years, the term has evolved. Cacti is now also supported on Windows, can use Nginx or IIS as its web server, and MariaDB is now the default database on many Linux platforms. The key concept of the LAMP stack remains consistent: structural data is stored in the relational database, time series data is stored in RRDTool’s Round Robin Archives (RRA), and the website is ultimately driven by PHP.

At the center of Cacti and its database are the Device and Device Template. You first create devices that have certain attributes associated with them such as a Device Template, SNMP community, and other meta information such as site, location, and GPS location. From that information, Cacti will create graphs and data sources appropriate for the device. These graphs can then be placed on trees that allow for a very organized and flexible layout, enabling users to drill into their organization’s operational ecosystem.

When Ian Berry first created Cacti in 2001, it was never intended to go beyond performance management. Over the years, a select community of plugin developers has extended Cacti to become a comprehensive operational management framework covering other areas of operations management. As of 2021, through these plugins, Cacti can be used not only as a performance management tool but also for fault management, log management, device discovery, router configuration backup, network mapping, NetFlow data collection and display, etc. Through its plugin architecture, Cacti has been extended well beyond its original intent.

Cacti can scale from just a few to tens of thousands of hosts. Its data collection framework is fully distributed and fault-tolerant. Its core services can be deployed behind load balancers with session management coming from its database, and its structural database can also be deployed in a fully fault-tolerant way. The RRDTool TSDB can be distributed using technologies such as GlusterFS, RRDProxy, and GPFS. There is literally no component in modern Cacti that cannot be made fault-tolerant.

High-Level Cacti Concepts

To understand how Cacti operates, it is important to understand a few key features first. They include:

Devices

Devices are at the center of the Cacti database. Devices are associated with Device Templates, which Cacti then uses to automatically create performance management graphs and data sources. Device support in Cacti is heavily biased towards SNMP-enabled hosts, but Cacti can use just about any data collection methodology to create performance graphs and data sources.

Data Sources

Data Sources store information about the composition of RRDTool’s Round Robin Archives (RRAs). RRAs are small time series databases that store and aggregate information about data inserted into them by Cacti’s Data Collectors. That data can come from SNMP-enabled hosts or from external scripts/commands executed by Cacti’s Data Collectors. The fact that Cacti supports gathering data from any external script or command makes it a very versatile performance management framework.

Data Sources can also be created to correspond to actual data on the graph. For instance, if a user wants to graph the ping times to a host, they could create a Data Source utilizing a script that pings a host and returns its value in milliseconds. After defining options for RRDTool such as how to store the data, you can define any additional information that the data input source requires, such as a host to ping in this case. Once a data source is created, it is automatically maintained at a data collection interval referred to as a Polling Interval.

Graphs

Once one or more Data Sources are defined and Cacti’s Data Collectors start storing that data in Round Robin Archives, the data can then be used to render graphs in Cacti. By default, Cacti uses the built-in graphing function provided by RRDTool, but the data in RRDTool’s TSDB can also be consumed by other visualization tools.

Cacti can create any imaginable RRDTool graph using all of the standard RRDTool graph types and consolidation functions. A color selection area and automatic text padding function also aid in making the graph creation process easier.

Not only can you create RRDTool-based graphs in Cacti, but there are many ways to display them. Along with a standard “list view” and a “preview mode,” which resembles the RRDTool frontend 14all, there is a “tree view,” which allows you to put graphs onto a hierarchical tree for organizational purposes.

Templates and Packages

Cacti can easily scale to a large number of Data Sources and Graphs through the use of Templates and Packages. Device Templates allow Cacti administrators to associate devices of a certain type or class with a collection of graphs that the host associated with the Device Template supports. All of Cacti’s templates can be exported from one Cacti installation and then imported on another either as template files or, more recently, package files.

Remote Data Collection

Remote Data Collectors are small Cacti installs that allow you to move Cacti’s Data Collection closer to the devices they are monitoring. They are connected to the core Cacti database through HTTPS and MySQL/MariaDB data connections and will continue to operate even when the connection to the core Cacti system is unavailable. In cases where the core Cacti database is not reachable, they will cache their data and then push updates to the core Cacti database once it returns online.

Discovery and Automation

Cacti includes a built-in distributed scheduler that allows the creation of one to many discovery rules to scan a network or networks for new devices and automatically add them to Cacti. When these devices are added, they can be automatically associated with a Device Template, be associated with a site or location, have all their relevant graphs created, and be placed onto trees for viewing by operations personnel. These automation rules can be rerun periodically, updating existing devices within those networks with new graphs throughout their lifecycle.

Users, User Groups, and Domains

Cacti provides three authentication and authorization methodologies to provide access to its features. It supports Local, LDAP, and Basic Authentication such as SAML2, TACCS+, etc., to verify a user’s identity. Once a user is authenticated, Cacti uses a hybrid Role/Realm-based authorization system to grant them access to its various components. Additionally, Cacti supports the creation of User Groups and Domains to simplify overall user administration. Cacti also supports “Remember Me” session management, allowing users to remain logged in for extended periods on trusted computers.

When using both LDAP and Basic authentication, Cacti will not store any user credentials either in its database or in memory, making the leakage of sensitive private data very limited. When using Local users in Cacti, it stores and periodically rehashes user passwords using PHP’s built-in strong password management libraries, further reducing potential private data exposure.

Plugins

Though Cacti is very robust as a standalone tool, it can be extended to perform other functions through the use of its Plugin Architecture. Originally derived from the SquirrelMail tools plugin architecture, Cacti’s Plugin Architecture has provided Cacti users around the world the ability to tailor their Cacti user experience for their intended audiences. The Cacti Group provides almost two dozen plugins that extend Cacti beyond its original boundaries via GitHub. Others have provided Cacti plugins that allow enterprises to monitor tens of thousands of devices from the single pane of glass that Cacti provides.

Themes, Skins, and Multiple Language Support

Cacti allows the personalization and branding of its user interface. It provides six standard themes out of the box, including the ‘Classic’ Cacti theme. These standard themes can then be modified by Cacti users to create their own user front end. Since Cacti is completely CSS-driven, using jQueryUI as its core user experience platform, it can be easily tailored to users’ needs.

Reference

  • https://www.cacti.net/
  • Document: https://docs.cacti.net/
  • Download: https://www.cacti.net/info/downloads
Feedback