Home Linux & Systems Cybersecurity Cloud & DevOps Networks & Infrastructure SIEM & Monitoring DFIR & Threat Intel Development & Other All categories Projects About Tools

Install Cacti in GNU/Linux

Leer en espanol
Install Cacti in GNU/Linux

Table of contents

Cacti is a complete solution for generating graphics in grid, designed to take advantage of the storage power and graphics functionality that applications have RRDtool. This tool, developed in PHP, provides an agile pooler, templates advanced graphics, multiple methods for data collection, and user management. has a interface easy-to-use user interface, which is convenient for installations the size of a LAN, as well as for networks complex with hundreds of device

More information…

We install the necessary packages for Cacti to work.
Bash
root@red-orbita:~# apt-get install php5 php5-gd php5-mysql  php5-gd php5-imap php5-ldap bapache2-mod-perl2 libxml2  apache2  mysql-server rrdtool snmp snmpd
We create the user
Bash
root@red-orbita:~# useradd cactiuser
We create the database and assign the user cactiuser root permissions.
Bash
root@red-orbita:~# mysql -u root -p
Bash
mysql>

mysql> set password for root@localhost=password(‘redorbita’);

Query OK, 0 rows affected (0.00 sec)
mysql> create database cactidb;

Query OK, 1 row affected (0.00 sec)
mysql> grant all on cactidb.* to root;

Query OK, 0 rows affected (0.00 sec)
mysql> grant all on cactidb.* to root@localhost;

Query OK, 0 rows affected (0.00 sec)
mysql> grant all on cactidb.* to cactiuser;

Query OK, 0 rows affected (0.00 sec)
mysql> grant all on cactidb.* to cactiuser@localhost;

Query OK, 0 rows affected (0.00 sec)
mysql> set password for cactiuser@localhost=password(‘redorbita’);

Query OK, 0 rows affected (0.00 sec)
mysql>
Next we go to the cacti website and download the latest version.
http://cacti.net/download_cacti.php
We download…
Bash
root@red-orbita:~# wget http://www.cacti.net/downloads/cacti-0.8.8a.tar.gz
We decompress
Bash
root@red-orbita:~# tar xzvf cacti0.8.7.tar.gz -C /var/www
We rename the folder
Bash
root@red-orbita:~# mv /var/www/cacti-0.8.8a/ /var/www/cacti

We access the folder

Bash
root@red-orbita:~# cd /var/www/cacti/

We import the cacti.sql file to the database we created earlier

Bash
root@red-orbita:/var/www/cacti/# mysql -u root -p
mysql> use cactidb
mysql> mysql -h localhost -u root -p cacti.sql
mysql> exit
we put cactiuser as the owner of the rra and log folders
Bash
root@red-orbita:/var/www/cacti/# chown -R cactiuser /log rra/
We edit the cacti configuration file.
Bash
vi /var/www/cacti/include/config.php
And we leave it as follows
text
$database_type = «mysql»;

$database_default = «cactidb»;

$database_hostname = «localhost»;

$database_username = «cactiuser»;

$database_password = «redorbita»;  #Aquí la password que le hayáis puesto

$database_port = «3306»;

$database_ssl = false;

We create a scheduled task telling it to run every 5 minutes.

Bash
root@red-orbita:/var/www/cacti/# vi /etc/cron.d/cacti

*/5 * * * * cactiuser /usr/bin/php /var/www/cacti/poller.php > /dev/null 2>&1

We access cacti with our browser.

http://192.168.1.102/cacti/

And it shows us the installation wizard.  Following

Pantallazo

We tell you that we want a new installation.

Pantallazo 1

We check that the configuration is correct and we finish.

Pantallazo 2

It shows us the login… by default it is: user: admin password: admin

Pantallazo 3

We already have our Cacti installed. I will upload more manuals about cacti.

Pantallazo 4
Greetings, rokitoh!

Comments