Cacti is a powerful and widely used open-source network monitoring and graphing tool. By default, Cacti often utilizes the cmd.php
poller, which, while functional, can become a bottleneck in larger environments or those requiring more frequent data collection. Spine is a C-based poller (written in native C language) for Cacti that offers significant performance improvements and scalability compared to cmd.php
.
Important Note: Before you begin this procedure, it is highly recommended to perform a comprehensive backup of your Cacti installation. This includes your Cacti configuration files (such as /etc/cacti/db.php
, config.php etc), your Cacti database, and if you are running Cacti in a virtual machine (VM) environment, consider taking a complete VM snapshot backup. These backups will provide a critical safety net, allowing you to revert to a working state if any unforeseen issues arise during the process.
This guide provides a comprehensive, step-by-step process for installing Spine and seamlessly switching your Cacti poller type from the default cmd.php
to the more robust and efficient Spine poller. By following these instructions carefully, you can enhance the data collection capabilities of your Cacti installation, leading to more responsive and detailed network monitoring. This guide walks you through the installation of Spine, its integration with Cacti, and the configuration of the poller system for improved performance and scalability.
📦 Phase 1: Installing Spine (We recommend installing via Package Manager)
Spine is a high-performance poller for Cacti, written in C, and is significantly faster than the default PHP-based poller (cmd.php
). You can install it via a package manager or compile it from source. But we recommend installing it via the package manager.
1. Open Terminal with Root Privileges
To perform system-level changes, you need administrative access. Either log in as root or prefix commands with sudo
.
2. Update Your System’s Package Index
This ensures you’re installing the latest available versions of packages.
# apt update # Debian/Ubuntu
# yum update # CentOS/RHEL
# dnf update # Fedora
3. Install Spine
Install the Spine package. The package name may vary depending on your distribution.
# apt install cacti-spine # Debian/Ubuntu
# yum install cacti-spine # CentOS/RHEL
# dnf install cacti-spine # Fedora
4. Verify Installation
Ensure the spine
binary is installed and accessible:
# which spine
This should return a path like /usr/bin/spine
or /usr/local/bin/spin
5. Configure spine.conf
Spine requires a configuration file with database credentials.
# nano /etc/spine.conf
Edit the file to include (Change the values for database, user and password according to your cacti setup):

Verify that the SPINE command is connecting to the DB and running without any errors:
# spine
SPINE: Using spine config file [/etc/spine.conf]
Version 1.2.30 starting
Time: 11.7618 s, Threads: 1, Devices: 16
🖥️ Phase 2: Configure Spine in the Cacti Web Interface
1. Log in to Cacti Web Portal
Open your browser and go to your Cacti URL (e.g., https://your_cacti_server/
). Log in with an admin account.
2. Access Settings
From the left menu:
- Click Console
- Under Configuration, click on Settings

3. Open the “Paths” Tab
Ensure the following fields are correctly filled, and Click on “Save“:
- Spine Binary File Location:
/usr/bin/spine
- Spine Config File Path:
/etc/spine.conf

4. Change Poller Type
- Click the “Poller” Tab
- Change the “Poller Type” from
cmd.php
tospine
using the dropdown - Click Save

Note:
If you’ve already configured Cacti to use Spine via the web interface, you do not need to change the cron job. The cron job still calls poller.php
, but Cacti internally uses Spine as the poller engine. So the cron job configuration below in /etc/cron.d/cacti is still valid:
*/5 * * * * root /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
No need to replace it with a direct call to spine
— Cacti handles that internally once you’ve selected Spine in the UI.
✅ Phase 3: Verify Spine is Working Fine
1. Monitor Cacti Logs
Check for successful polling and Spine execution:
# tail -f /var/log/cacti/cacti.log
Look for entries like:
SPINE: Poller[0] is running
2. Check Graph Updates
Return to the Cacti web interface and confirm that graphs are updating with fresh data.
Congratulations! You’ve successfully navigated the process of installing Spine and configuring your Cacti installation to use this powerful poller. By making this transition, you’ve significantly upgraded your Cacti’s data collection capabilities, moving from the potentially resource-intensive cmd.php
to the highly optimized C++ based Spine poller.
You should now be experiencing faster polling cycles, more reliable data collection, and ultimately, more accurate and up-to-date graphs within your Cacti web interface. Remember to regularly monitor your Cacti logs (/var/log/cacti/cacti.log
) for any new warnings or errors, and keep an eye on your system resources to ensure optimal performance.
A Critical Consideration for Existing Cacti Installations:
From experience, it’s important to note that activating the Spine poller after cmd.php
has been in use for a long time and has collected a significant amount of data can sometimes distort your existing graphs, especially aggregate graphs. This is due to subtle differences in how cmd.php
and Spine might process and store data. For this reason, it is highly recommended to activate the Spine poller from day one of your Cacti installation. This helps avoid the potential pain of graph distortion and ensures consistent data collection from the outset. Embracing Spine is a key step towards maintaining a robust and scalable monitoring solution, allowing you to keep a sharper eye on your network infrastructure with enhanced performance.