Cacti is a network monitoring software that uses the RRDtool which implies the data logging using the graphical method for the system using various shells on AlmaLinux / Rocky Linux / Amazon Linux. It provides advanced graphs with a data monitoring using the user management analysis and provides all features using the Graphical user Interfaces.

Step-1: Install the Prerequisites packages
  • Cacti
  • Apache / Httpd
  • net-snmp
  • MySQL / MariaDB
  • php-snmp
# dnf install cacti mariadb-server mariadb httpd php-snmp net-snmp
Step-2: Create Database for Cacti and Configure as below

Configuration Path : /var/www/cacti/include/config.php

# vim /var/www/cacti/include/config.php
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "techbrown";
$database_username = "cacti";
$database_password = "cacti";
$database_port = "3306";
$database_ssl = false;

The Cacti SQL file

You will find cacti.sql file in /var/www/cacti/cacti.sql, you need to restore it.

# mysql
mysql> use cactidb
mysql> source /var/www/cacti/cacti.sql
Step-3: Check with Apache Configuration.

Configuration Path : /etc/httpd/conf.d/cacti.conf

# vim /etc/httpd/conf.d/cacti.conf
Alias /cacti/ /var/www/cacti/
<Directory /var/www/cacti/>
DirectoryIndex index.php
Options -Indexes
AllowOverride all
order deny,allow
deny from all
allow from
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc on
php_flag track_vars on
Step-4: View the Cacti Portal

Add your IP to view Cacti Portal using URL: http://IPADDRESS/cacti
It will prompt you for username and password
By default it would be Username: admin and Password: admin

Once get login follow the given steps

Go to setting and find the path of command which should match with your system path as below.
snmpwalk Binary Path: /usr/bin/snmpwalk
snmpget Binary Path : /usr/bin/snmpget
snmpbulkwalk Binary Path: /usr/bin/snmpbulkwalk
snmpgetnext Binary Path: /usr/bin/snmpgetnext
RRDTool Binary Path: /usr/bin/rrdtool
PHP Binary Path: /usr/bin/php
Cacti Log File Path: /var/www/cacti/log/cacti.log

Before Creating host please import Percona Templates

Percona Templates are available on web.

Step-5 : Install script from percona downloaded plugins

Default Path : percona-monitoring-plugins-1.0.0/cacti/scripts
Copy these script into /var/www/cacti/scripts in Linux.

Now Login into Cacti Portal and select import template option

Browse your templates from Percona Directory path : percona-monitoring-plugins-1.0.0/cacti/templates

Before adding device please check if your device is behind firewall then allow port 161 with UDP protocol.

# firewall-config
Step-6 : Try to add Host with monitoring templates.

Click on Devices from Management tab –> Add from left—> Add Description and Host-name —-> Select Templates —> Click on Create.

Once done please check with SNMP information for any error

It should be as follows:

SNMP Information
Uptime: 309909770
Location: Unknown

Wait for some time it will it will show the device will be UP and started generating Graphs.

For adding MySQL Template you need to create MySQL User without any permission on destination host server.

Congratulation now you have configured Cacti with Percona template on AlmaLinux / Rocky Linux / Amazon Linux.