#Cacti installation on Centos/Redhat/Rocky 8 /With Notes in the Description/
Installation and Configuration of Cacti Monitoring Tool on Rocky Linux8/centos8/rhel8 //With no errors//
server IP: 192.168.19.10
hostname : server.example.com
1.disable selinux https://youtu.be/lwaogoTfEl8
2.install LAMP (apache,mariadb,php) https://youtu.be/BILAT520170
2.install epel repository
# yum install epel-release -y
3.install snmp and rrdtool.
# yum install -y net-snmp net-snmp-utils net-snmp-libs rrdtool
Install the required php extensions.
# yum install -y php php-xml php-session php-sockets php-ldap php-gd php-json php-mysqlnd php-gmp php-mbstring php-posix php-snmp php-intl
Now start the services that have installed already installed
# systemctl start httpd
# systemctl start snmpd
# systemctl start mariadb
Enable the services to start at system start-up
# systemctl enable httpd
# systemctl enable snmpd
# systemctl enable mariadb
Database tuning:
Cacti recommend changing mysql variables seetings for better performance.
# vi /etc/my.cnf.d/mariadb-server.cnf
Here I added the following variables in the [mysqld] section.
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
max_heap_table_size=128M
tmp_table_size=128M
join_buffer_size=128M
innodb_buffer_pool_size=1024M
innodb_doublewrite=ON
innodb_flush_log_at_timeout=3
innodb_read_io_threads=32
innodb_write_io_threads=16
innodb_buffer_pool_instances=10
innodb_file_format=Barracuda
innodb_large_prefix=1
innodb_io_capacity=5000
innodb_io_capacity_max=10000
Restart the service.
# systemctl restart mariadb
# systemctl status mariadb
Create cacti database:
# mysql -u root -p
type database password here.
if you havent set password
# mysql_secure_installation
MariaDB [(none)]
Now create a database for cacti installation
create database cacti;
grant all on cacti. * to cactiuser@localhost IDENTIFIED BY ‘happyday123’;
flush privileges;
exit
The newly created database user (cactiuser) should have access to the mysql.time_zone_name table. To do that, import the mysql_test_data_timezone.sql to mysql database.
# mysql -u root -p mysql (angled bracket here,because youtube is not allowing me to use symbol please watch video) /usr/share/mariadb/mysql_test_data_timezone.sql
type database password here not cacti password
Then, log in to mysql.
# mysql -u root -p
Now grant the permission to cactiuser.
grant select on mysql.time_zone_name to cactiuser@localhost;
Flush privileges;
Exit;
Now it’s time to install and configure cacti:
# yum install -y cacti
After the installation of cacti, import the default database to the cacti database.
# mysql cacti (angled bracket) /usr/share/doc/cacti/cacti.sql -u cactiuser -p
It prompts a password
Here, I set the password that I had set for cacti.
Edit the config file to specify the database type,name,hostname,user and password information.
# vi /usr/share/cacti/include/config.php
Make the changes accordingly.
Here,
/*
* Make sure these values reflect your actual database/host/user/password
*/
$database type = ‘mysql’;
$database_default = ‘cacti’;
$database_hostname = ‘localhost’;
$database_username = ‘cactiuser’;
$database_password = ‘happyday123’;
$database_port = ‘3306’;
Now edit the cacti’s cron entry in the crontab file to poll every five minutes.
# vi /etc/cron.d/cacti
Uncomment the line.
Edit the apache configuration file to perform the remote installation.
# vi /etc/httpd/conf.d/cacti.conf
Modify the first directory stanza.
Here I removed the Require host localhost line and add Require all granted line in the directory stanza.
Now set the timezone by editing /etc/php.ini file
# vi /etc/php.ini
Update the php parameters.
date.timezone = Asia/Kathmandu type yours according to you timezone no problem
memory_limit = 512M
max_execution_time = 60
restart the services.
# systemctl restart httpd
# systemctl restart php-fpm
And lastly check firewall and Selinux.In my case no need to do anything here.
Now it’s time to setup cacti web interface:
I went to the browser and just typed
http://my-ip-address/cacti
The initial login details:
Username:admin
Password:admin
now change this password to another password
here i will be setting Laxman@123
I changed the admin user’s password.
Now accept the license agreement on this page and clicked on next to continue.
The cacti installer now performs pre-installation checks to determine whether the system meets the requirements for the cacti installation.
Ensure all checks are green. Consider fixing any warning the installer reports on this page. moved to the next step by clicking the next button located at the left bottom of the page.
Here in my case. Everything looks fine.
here we have configured everyting without one error
Since, everything is looking fine. click…to the next page
The cacti installation is now complete. Click get started to access the cacti dashboard
Waited at least 15-30 minutes to let cacti populate the usage graph of my device.
follow every steps manually.
centos 8
I LOVE U DUDEEEEE
TE AMO CABROOON
👍👍♥️