How to install Cacti Overseer Debian 11 Bullseye

0

Take a look at the quick steps given in the tutorial to install Cacti on Debian 11 Bullseye server to monitor network devices.

Cacti is an open source tool for monitoring hosts in large networks using SNMP (Simple Network Management Protocol). It comes with many ready-to-use scripts and data models. Cacti is just as suitable for a server running Linux polling the remotely maintainable network switch as it is for recording and viewing any other measurement data that occurs regularly. It presents itself as an easily configurable framework via a browser. Cacti uses the MySQL database to save its settings and the Apache web server for interactive configuration and display of graphs.

Cacti manages templates for graphs, hosts and data sources that can be created using a browser. You save a lot of work if the same values ​​need to be monitored on multiple hosts. The visualization tool comes with ready-to-use templates for many systems (Linux/Unix computers, various router models).

Steps to install Cacti Server on Debian 11 Bullseye

1. Requirements

To complete this tutorial, we need the following:

Debian Server
RRDTool
MySQL, PHP
Web server supporting PHP, for example Apache, Nginx or IIS
A non-root user with sudo rights
Internet connection

2. Update your Debian 11 server

Before going any further in this tutorial, let’s first update our Debian 11 server to ensure that all available packages are up to date. This will also regenerate the APT package manager cache.

sudo apt update && sudo apt upgrade

3. Install Apache for Cacti

To access the Cacti monitoring server web interface, we must have a web server installed on our Debian 11. Here we choose the popular open source Apache.

sudo apt install apache2

Start and enable the Apache web server:

sudo systemctl enable --now apache2

4. Install PHP and MariaDB

To store data we use MySQL/MariaDB, while Cacti web UI is based on PHP, so we need this programming language installed on our system along with some extensions required by Cacti to work properly…

First, configure PHP:

sudo apt install  php php-{mysql,curl,net-socket,gd,intl,pear,imap,memcache,pspell,tidy,xmlrpc,snmp,mbstring,gmp,json,xml,common,ldap}
sudo apt install libapache2-mod-php

Configure PHP memory and execution time:

Edit the php.ini file:

sudo nano /etc/php/*/apache2/php.ini

hurry CTRL+W and type- memory_limit

And change its value from 128 to 512M

memory_limit = 512M

Similarly, find max_execution_time and change its value from 30 to 300.

max_execution_time = 300

To find: date.timezone and set the PHP time zone according to your country. If you don’t know the time zone format of your country, you can visit the PHP time zones page to find out.

date.timezone = Asia/Kolkata

to safeguard the file by pressing CTRL+O after that press the Enter key and use CTRL+X to leave.

Now edit the PHP CLI file php.ini as well and set the timezone there as well.

sudo nano /etc/php/*/cli/php.ini

Ends and Reset time zone:

date.timezone = Asia/Kolkata

to safeguard the file by pressing CTRL+O after that press the Enter key and use CTRL+X to leave.

Install MariaDB

Once the PHP is on our system, let’s install MySQL fork MariaDB Server available on Debian 11 Bullseye via its official repository using the APT package manager.

sudo apt install mariadb-server -y

Start and activate the database server:

sudo systemctl enable --now mariadb

To check its status:

sudo systemctl status mariadb

Create a MariaDB database for Cacti

sudo mysql -u root -p
CREATE DATABASE cacti DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
GRANT ALL PRIVILEGES ON cacti.* TO 'cacti_user'@'localhost' IDENTIFIED BY 'strongpassword';
GRANT SELECT ON mysql.time_zone_name TO [email protected];
ALTER DATABASE cacti CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
FLUSH PRIVILEGES;
EXIT;

5. Configure MariaDB for Cacti:

sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

Copy and add the following given line under[mariadb]

innodb_file_format=Barracuda
innodb_large_prefix=1
collation-server=utf8mb4_unicode_ci
character-set-server=utf8mb4
innodb_doublewrite=OFF
max_heap_table_size=128M
tmp_table_size=128M
join_buffer_size=128M
innodb_buffer_pool_size=1G
innodb_flush_log_at_timeout=3
innodb_read_io_threads=32
innodb_write_io_threads=16
innodb_io_capacity=5000
innodb_io_capacity_max=10000
innodb_buffer_pool_instances=9

Also, add the # tag in front of these two lines available in the same file to make them unreadable:

#character-set-server = utf8mb4
#collation-server = utf8mb4_general_ci

Save the file: CTRL+Opress the Enter key, then CTRL+X to leave.

Now set the timezone in MySQL

sudo mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

6. Install SNMP and other tools for Cacti

We need key tools for the proper functioning of Cacti monitoring systems such as SNMP and rrdtool. Therefore, in this step, we are going to install them.

sudo apt install snmp snmpd rrdtool

7. Configure Cacti software on Debian 11

Although Cacti can be installed using the APT package manager and the official Bullseye repository, the version available through it will not be the most recent.

Soclone the latest available on GithubGenericName:

sudo apt install git
git clone -b 1.2.x https://github.com/Cacti/cacti.git

Move the cloned Cacti files to your web directory:

sudo mv cacti /var/www/html

Use the Cacti SQL configuration file to pre-populate the database created for it.

sudo mysql -u root cacti < /var/www/html/cacti/cacti.sql

Create a PHP configuration file for Cacti:

Well, the setup The file is already present in the copied Cacti folder, we simply rename it.

cd /var/www/html/cacti/include
cp config.php.dist config.php

Now edit the config.php and add the database details you created for Cacti.

sudo nano config.php

Change database values ​​– Name of the data base, username, and the password.

Save the file CTRL+Opress the Enter key, and exit: Ctrl+x.

Grant the Apache user permission to access the Cacti folder in the web root directory.

sudo chown -R www-data:www-data /var/www/html/cacti

8. Create the Cacti Systemd service

To run the Cacti polling service in the background, create a Cacti system service using the given commands.

sudo nano /etc/systemd/system/cactid.service

Add the following lines:

[Unit]
Description=Cacti Daemon Main Poller Service
After=network.target

[Service]
Type=forking
User=www-data
Group=www-data
EnvironmentFile=/etc/default/cactid
ExecStart=/var/www/html/cacti/cactid.php
Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target

Save the file CTRL+Ohurry Enter key, then exit CTRL+X.

Create an environment file:

sudo touch /etc/default/cactid

Start and activate the Cacti service

sudo systemctl daemon-reload
sudo systemctl enable cactid
sudo systemctl restart cactid

Check Cacti system service status

9. Connect to Cacti monitoring on Debian 11

Once the installation is complete, go to your system’s browser and enter the IP address of your server on which you installed the Cacti Monitoring software.

Point your browser to:

http://your-server-IP-address/cacti/

Login to Cacti with the default username – administrator and password – administrator.

Login Cactus on Debian 11

10. Start Cacti web installation

In the first step, the installation wizard will check that all the things necessary for Cacti to work are in place. If any of the conditions are not met, the same will appear on your screen. And we have to do the same, only then can we move on.

Checks before installation

In the next step, the system will ensure that all the necessary permissions required by Cacti to access the files are set.

File permission

By default, leave the “New Primary Server” selected as this is an initial server that will monitor other devices.

Local database connection information

Locations and version of Cacti binaries

Finally you will have the Cacti dashboard installed on your Debian 11 Bullseye

Cacti web installation Debian Dashboard 11

Endnotes:

This was the quick tutorial to setup Cacti Monitoring Service on Debian 11 Bullseye, for more information about this tool and how to use it refer to official documents.

Other Items:

4 Ways to Check MySQL or MariaDB Version on Linux
3 Ways to Install DBeaver on Debian 11
2 Ways to Install XFCE Desktop on Debian 11 Bullseye
How to Install and Use Rust on Debian 11 Linux
How to install Prometheus in Debian 11

Share.

Comments are closed.