1st August 2021

What is Cacti and How to Install and Configure Cacti on Ubuntu.

Cacti is a complete server solution that graphically presents information such as memory (ram), disk, network and system load of your active devices on the network via a web interface. We will focus on the installation and configuration of cacti, which is one of the open-source and completely free network monitoring solutions. Although the history of Cacti goes back to the old years, it remains popular and up-to-date. It can produce solutions from large network structures to small structures.

Cacti Installation

The operating system we use for installation is Ubuntu. Although the system resource varies with the size of your environment, we know that 200K + devices can be managed with 4 core processors, 8Gb ram and 50 GB disk space.

Installation System Requirements

  • Apache (Web Server)
  • PHP
  • MariaDB (Database)
  • SNMP (Simple Network Management Protocol)
  • RRDTOOL (Round Robin Database Tool)

Apache (Web Server)

We continue with the Apache web server installation. We enter the following commands in the command line.

Apache (Web Server)
Apache (Web Server)

 

Php Package

We install PHP packages.

Php Package
Php Package

 

MariaDB (Database)

We set up MariaDB as a database.

MariaDB (Database)
MariaDB (Database)

 

Setting Up Database Security

After installation, we do the database security settings.

With this command, we make the basic MySQL settings of “mysql_secure_installation”. They start asking some questions like this.

Enter current password for root (enter for none): Just press the Enter “You press enter.”
Set root password? [Y / n]: Y “It asks you if you want to define a new password, I continue with Y because we will define a new password.”
New password: Enter the password “Enter your new password.”
Re-enter new password: Repeat password “Re-enter your new password.”
Remove anonymous users? [Y / n]: Y “Do you want to remove users from anonymous users?
Disallow root login remotely? [Y / n]: Y “A question about granting remote access for the root user, saying Y to disable remote access for the root user.”
Remove test database and access to it? [Y / n]: Y “I remove test databases and access with Y.”
Reload privilege tables now? [Y / n]: Y “We update the changes made, we say Y.”

Cacti Setting Up Database Security
Cacti Setting Up Database Security

 

LEARN MORE  What is BitLocker? How is it used?

Installing SNMP and RRDtoll Tools

We install the necessary tools SNMP and RRDtoll. You can install it using the command below.

Installing SNMP and RRDtoll Tools
Installing SNMP and RRDtoll Tools

 

Timezone Settings

Let’s set the timezone now. We make changes in the two files below.

apache2/php.ini
apache2/php.ini

 

We find the following fields in two files and arrange them in this way.

Timezone Setting
Timezone Setting

cacti memory limit and execution time
cacti memory limit and execution time

 

cli/php.ini
cli/php.ini

 

cli/php.ini
cli/php.ini

 

Now we need to make changes to MariaDB. We can configure MariaDB as follows.

Configure MariaDB
Configure MariaDB

 

We find the line starting with “collation-server” and make it inactive by adding the symbol “#” to the beginning.

collation-server
collation-server

 

Then we add the following lines under “[mysqld]”.

mysqld
mysqld

 

The changes we make on the file are firstly the “ctrl + x” command, secondly, we press the “y” key. Then we save by pressing the “Enter” key. Then we reset the database services with the following command.

restart mysql
restart MySQL

 

Create a Database

It’s time to create a database.

We log in to the database with the sudo “mysql -u root -p” command, then we create our database with the following commands.

Create a Database
Create a Database

 

Now we import the database file “mysql_test_data_timezone.sql” with the following command.

LEARN MORE  How to Install Wireshark?

database import
Database import

 

Then we reconnect to the database and enter the following commands in order.

 

After these processes, we came to the installation of cacti. First, we download the latest version of cacti.

cacti Download
cacti Download

 

We open the archive and enter it, then copy all the files under “/var/www/html/“.

 

We import the cacti database file into MariaDB.

import the cacti database
import the cacti database

 

We edit the following config file and enter the cacti database password.

Cacti Config
Cacti Config

cacti database password
cacti database password

 

We edit permissions to cacti with the following commands.

permissions to cacti
permissions to cacti

 

We create the necessary files under apache for web access.

apache for web access
apache for web access

 

We paste the following content into the file you opened and save the file.

 

Now we open the web browser and write the server’s IP address. After opening it in the web browser, we make the necessary settings as follows.

The default username and password: “admin/admin

Cacti installation Wizard
Cacti installation Wizard
Default automation Network
Default automation Network
Template Setup
Template Setup
Server Collation
Server Collation
confirm installation
confirm installation
installing cacti server
installing cacti server
cacti process log
cacti process log

 

After the Cacti installation is completed, we log in and the screen below welcomes us.

cacti web console
cacti web console

 

Finally, in the crontab, we create a schedule to refresh the data at certain intervals.

schedule cactipoller
schedule cactipoller
schedule cactipoller
schedule cactipoller

 

Leave a Reply

Your email address will not be published. Required fields are marked *