Setting up Cacti Monitoring on a VPS

Server monitoring is a crucial step in ensuring its stable operation. One popular tool for monitoring Linux-based servers is Cacti. This article will guide you through setting up monitoring using Cacti on a VPS.

Before starting the monitoring setup, ensure that Apache web server, PHP, and MySQL database are installed and running on your server. You’ll also need to install the necessary packages for Cacti to function.

1. Installing Cacti:

To install Cacti, execute the following commands:

VPS Hosting

Servidores virtuales con recursos garantizados

Elegir VPS

sudo apt update

sudo apt install cacti cacti-spine

2. Database Configuration:

Create a new MySQL database and user for Cacti. Then, import the database schema from the cacti.sql file:

mysql -u root -p

CREATE DATABASE cacti;

GRANT ALL PRIVILEGES ON cacti.* TO 'cactiuser'@'localhost' IDENTIFIED BY 'password';

FLUSH PRIVILEGES;

USE cacti;

SOURCE /usr/share/doc/cacti/cacti.sql;

3. Cacti Configuration:

Edit the Cacti configuration file to specify the database connection parameters:

sudo nano /etc/cacti/db.php

Make the following changes:

$database_type = 'mysql';

$database_default = 'cacti';

$database_hostname = 'localhost';

$database_username = 'cactiuser';

$database_password = 'password';

4. Web Server Configuration:

Create a new virtual host for Cacti:

sudo nano /etc/apache2/sites-available/cacti.conf

  • Insert the following configuration file:

Alias /cacti /usr/share/cacti/site

Require all granted Order deny,allow Allow from all

service apache2 restart

5. Running Cacti:

Open a web browser and enter your server’s address followed by «/cacti». Go through the Cacti installation process, following the on-screen instructions.

After completing the installation, go to the «Devices» section and add your servers for monitoring. Setting up monitoring with Cacti will help you track your server’s performance and react promptly to any issues.

Remember to regularly update Cacti and monitor its operation to ensure the reliability of your server.