HOW To Install and configure Cacti v1 2 22 on ubuntu 22 04



HOW To Install and configure Cacti v1 2 22 on ubuntu 22 04

HOW To Install and configure Cacti v1 2 22 on ubuntu 22 04

How to setup cati v1.2.22 on ubuntu 22.04
Cati is a collects network bandwidth untilization and monitor the network traffic
– router
– switch

They using SNMP protocol to polling
1. update system packages
sudo apt update && sudo apt upgrade -y
2. Install PHP and some modules need
sudo apt install libapache2-mod-php php-mysql php-xml php-gd php-snmp php-json php-intl php-mbstring php-ldap php-gmp -y

we will change some configuration on our PHP.ini both apache2 and cli

vi /etc/php/*/apache2/php.ini
vi /etc/php/*/cli/php.ini

date.timezone = Asia/phnom_penh
memory_limit = 512M
max_execution_time = 60

3. Configure Apache webserver

vi /etc/apache2/sites-available/cacti.conf

Alias /cacti /var/www/html/cacti

systemctl reload apache2
sudo a2ensite cacti

sudo systemctl restart apache2
sudo systemctl enable apache2

4. Install and configure MariaDB Server

sudo apt install mariadb-server -y
vi /etc/mysql/mariadb.conf.d/50-server.cnf

Comment out the following lines
# collation-server = utf8mb4_general_ci
# character-set-server=utf8mb4
Then add the lines;

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

sudo systemctl restart mariadb

5. Create Cacti Database
sudo mysql -u root -p
CREATE DATABASE cacti;
GRANT ALL PRIVILEGES ON cacti.* TO ‘helptech’@’localhost’ IDENTIFIED BY ‘helptech2022’;
FLUSH PRIVILEGES;

EXIT;

import timezone data to the mySQL database

login to database again

sudo mysql -u root -p

GRANT SELECT ON mysql.time_zone_name TO helptech@localhost;

FLUSH PRIVILEGES;

EXIT;

6. Install and configure SNMP
sudo apt install snmp snmpd snmp-mibs-downloader rrdtool

edit configure
vi /etc/snmp/snmp.conf

Remove the comment from
mibs

sudo systemctl restart snmpd

7. Install Cacti on Ubuntu 22.04
wget https://www.cacti.net/downloads/cacti-latest.tar.gz

sudo tar -zxvf cacti-latest.tar.gz

sudo mv cacti-1* /var/www/html/cacti
Move the extracted folder to /var/www/html/cacti directory

let import default cacti database to the our
new create cacti database

we don’t found file cacti.sql on folder opt
so let download cacti.sql

we saw cacti.sql on directory
/var/www/html/cacti/cacti.sql

we download and extra and move to var directory
we i think we can using this

update username passsword to config.php
vi /var/www/html/cacti/include/config.php
Create a file for logging
sudo touch /var/www/html/cacti/log/cacti.log
Grant the cacti directory read and write permissions and ownership:

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

add the entry below so that cacti for polling after an interval
of 5 minues

restart service apache2

8. Start and setup Cacti website
http://10.20.17.13/cacti

Log in using admin as your username and password and click login.

username: admin
password: admin

we need to install PHP required so let me check now
we try to reinstall

apt install php-cli

sudo -u www-data php -q /path/to/cacti/install/cli_check.php extensions

sudo apt install libapache2-mod-php
for this error we just go to
vi /etc/php/8.1/apache2/php.ini

look the message error Web – No ( Installed )

so we go to open extension on apache2 php.ini and enable the extension that they need.

service apache2 reload

Now we can see real-time graph so the graph will generate soon.

Comments are closed.