>_ DevTrendsen

Language

Home

Languages

Sections

Frontend Backend Mobile DevOps AI / ML GameDev Blockchain Embedded Security
PHP

The Legendary Cacti and Network Infrastructure Monitoring

If you worked in systems administration about fifteen years ago, you probably remember those distinctive green traffic graphs. Years passed. Prometheus, Grafana, VictoriaMetrics, and a bunch of other systems emerged. Nevertheless, the classic Cacti project is still alive. Developers regularly push commits, adapt the code for PHP 8, develop a new C-based polling engine, and are preparing the 1.3 branch release.

Why does a tool from the 2000s stay afloat? The answer is simple: network equipment doesn't change as fast as frontend or cloud services. Switches, routers, UPS units, and server racks still expose metrics via the SNMP protocol.

What the platform consists of

Cacti works as a visual layer on top of RRDtool's round-robin database. Unlike conventional time-series databases, RRDtool doesn't grow indefinitely. The file size is fixed at creation time. Old data is automatically averaged and compressed according to specified rules.

The project consists of three main parts:

  • PHP web interface for system configuration and graph viewing
  • Relational MySQL or MariaDB database for storing templates and users
  • Device polling subsystem running on a schedule

Metrics are collected every few minutes. You can use the basic PHP poller or connect Spine. The Spine engine is written in C and runs much faster thanks to multithreading. For a network of a thousand devices, this is the only adequate solution, otherwise the process simply won't finish in time.

Platform capabilities

Templates are created for working with hardware. You don't need to manually search for the right OIDs in vendor documentation. You take a ready-made template for Cisco, Juniper, MikroTik, or D-Link, attach it to a device, and get a ready set of graphs.

Network scanning runs on a schedule. New device found? The system recognizes it by SNMP responses and applies the appropriate automation rule.

Role-based access control is provided for team collaboration. You can give an on-call engineer access to graphs for a specific rack, blocking other sections.

Graphs in the interface are interactive. You can select the desired time interval with the mouse, switch scales, view data in real time, and export metrics in CSV format.

Support for IPv6 and SNMPv3 protocols opens the way to monitoring modern infrastructure while meeting security requirements.

System requirements and building from source

To run, you'll need a web server with PHP 8.1 support. MariaDB version 10.2 or higher (or MySQL 8.0 or higher). From system utilities, you need RRDtool version 1.8 and the Net-SNMP package.

Project dependencies are deployed using Composer:

git clone https://github.com/Cacti/cacti.git
cd cacti
composer install

When working with the development branch develop, database tables need to be updated regularly. For this, the project includes command-line utilities:

sudo -u cacti php -q cli/upgrade_database.php --forcever=`cat include/cacti_version`

Checking table structure integrity after each change is helped by the built-in audit:

php cli/audit_database.php --report

Where to use in practice

Network channel monitoring remains the project's main niche. When you need to track port utilization on a hundred switches, spinning up a heavy stack of scrapers and exporters can be excessive. The system deploys in half an hour and consumes minimal resources.

Engineering systems accounting in data centers is another common scenario. Monitoring temperature in racks, UPS phase loads, and interface errors. The tool has been refined for decades precisely for such tasks.

The architecture supports plugins. If standard features aren't enough, you can install modules for sending notifications or building geographic network maps.

Cacti doesn't try to compete with Prometheus in the world of containers and dynamic pods. It's a tool for good old physical infrastructure.

If you need to deploy understandable and undemanding monitoring of network equipment, Cacti still remains a practical choice. It saves memory, works stably for years, and doesn't require constant fixing of configuration files.

Related projects