Assalamu’alaikum Warahmatullahi Wabarakatuh, Selamat pagi sobat blogger sekalian, apa kabar semuanya... Pada kesempatan kali ini saya akan share bagaimana Cara Install Cacti di Centos 8 dan bagaimana cara konfigurasinya.
Cacti menggunakan RRDtool sebagai penyimpanan data dan pembuatan grafik. dan untuk memonitor lalu lintas pada jaringan menggunakan protokol SNMP. Dengan cacti, sobat dapat melihat cpu usage, memory yang dipakai untuk proses, pengelola user, perolehan multiple data dll.
[root@cacti ~]# getenforce
Disabled
Step 1 - Install Httpd
Jalankan perintah berikut untuk install Httpd[root@cacti ~]# dnf install -y httpd
Jalankan service Httpd[root@cacti ~]# systemctl start httpdTambahkan service Httpd di Firewalld
[root@cacti ~]# systemctl enable httpd
[root@cacti ~]# systemctl status httpd
[root@cacti ~]# firewall-cmd --add-service=http --permanent
[root@cacti ~]# firewall-cmd --reload
Step 2- Install PHP 7.4
Jalankan perintah berikut untuk Installasi PHP versi 7.4
[root@cacti ~]# dnf install epel-release -y
[root@cacti ~]# dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm -y
[root@cacti ~]# dnf module list php
[root@cacti ~]# dnf module enable php:remi-7.4
[root@cacti ~]# dnf install php php-cli php-common php-pdo php-pecl-zip php-json php-mbstring php-mysqlnd php-json php-mbstring
[root@cacti ~]# systemctl start php-fpm
[root@cacti ~]# systemctl enable php-fpm
[root@cacti ~]# systemctl status php-fpm
Jalankan perintah berikut untuk Installasi Database MariaDB
[root@cacti ~]# dnf install -y mariadb-serverEnable service Database MariaDB
[root@cacti ~]# systemctl start mariadb
[root@cacti ~]# systemctl enable mariadb
[root@cacti ~]# systemctl status mariadb
[root@cacti ~]# mysql_secure_installation
Step 4 - Install Cacti & SNMP
Jalankan perintah berikut untuk Installasi Cacti dan Snmp
[root@cacti ~]# dnf install -y cacti net-snmp net-snmp-utils php-mysqlnd php-snmp php-bcmath rrdtoolEnable service SNMP
[root@cacti ~]# systemctl start snmpdTambahkan service snmp di Firewalld
[root@cacti ~]# systemctl enable snmpd
[root@cacti ~]# firewall-cmd --add-service=snmp --permanent
[root@cacti ~]# firewall-cmd --reload
Step 5 - Konfigurasi SNMP
Sebelum kita mengkonfigurasi Snmp ada baiknya kita backup dahulu file default setting Snmp
[root@cacti ~]# cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.oriEdit File snmp.conf
[root@cacti ~]# vi /etc/snmp/snmpd.confRestart Service SNMP
# baris 41: kasih tanda #
#com2sec notConfigUser default public
# baris 74,75: hapus tanda # lalu ganti network & community
## sec.name source community
com2sec local localhost cacti
com2sec mynetwork 192.168.0.0/24 cacti
# baris 78,79: hapus tanda # lalu ganti any menjadi v2c
## group.name sec.model sec.name
group MyRWGroup v2c local
group MyROGroup v2c mynetwork
# baris 85: Hapus tanda #
## incl/excl subtree mask
view all included .1 80
# baris 93,94: Hapus tanda #
## context sec.model sec.level prefix read write notif
access MyROGroup "" v2c noauth exact all none none
access MyRWGroup "" v2c noauth exact all all all
# baris 162, 163 edit syslocation & syscontact
syslocation Jakarta Data Center
syscontact sysadmin sysadmin@yourdomain.com
[root@cacti ~]# systemctl restart snmpd
[root@cacti ~]# snmpwalk -v2c -c cacti localhost system
Step 6 - Konfigurasi Database Mariadb
Edit file mariadb-server.cnf lalu Tambahkan Script dibawah [mysqld]
[root@cacti ~]# vi /etc/my.cnf.d/mariadb-server.cnf
[mysqld]
.....
.....
default-time-zone='Asia/Jakarta'
character-set-server=utf8mb4
character_set_client=utf8mb4
collation-server=utf8mb4_unicode_ci
max_heap_table_size=128M
tmp_table_size=128M
join_buffer_size=256M
innodb_file_format=Barracuda
innodb_large_prefix=1
innodb_buffer_pool_size=2048M
innodb_flush_log_at_timeout=3
innodb_read_io_threads=32
innodb_write_io_threads=16
innodb_buffer_pool_instances=17
innodb_io_capacity=5000
innodb_io_capacity_max=10000
[root@cacti ~]# mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysqlResrtart service mariadb
Enter password: [Masukan password database mariadb]
Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
[root@cacti ~]# systemctl restart mariadb
Step 7 - Buat Database cacti
Tahap selanjutnya kita buat Database untuk Cacti
[root@cacti ~]# mysql -u root -pImport Database
create database cacti;
grant all privileges on cacti.* to cacti@'localhost' identified by 'password';
grant select on mysql.time_zone_name to cacti@'localhost';
flush privileges;
exit
[root@cacti ~]# mysql -u cacti -p cacti < /usr/share/doc/cacti/cacti.sql
Enter password: [Masukan password database cacti]
Step 8 - Konfigurasi Cacti
Edit File cacti lalu hilangkan tanda #
[root@cacti ~]# vi /etc/cron.d/cactiEdit File config.php ganti user dan password database cacti
# Hapus tanda #
*/5 * * * * apache /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
[root@cacti ~]# vi /usr/share/cacti/include/config.phpEdit file php.ini seperti dibawah ini
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "password";
$database_port = "3306";
$database_ssl = false;
[root@cacti ~]# vi /etc/php.iniEdit file cacti.conf lalu tambahkan IP Network
# baris 383
max_execution_time = 60
# baris 404
memory_limit = 512M
# baris 902
date.timezone = Asia/Jakarta
[root@cacti ~]# vi /etc/httpd/conf.d/cacti.conf
# baris 17
Require host localhost
Require ip 10.0.0.0/24
Step 10 - Restart service
Restart service Httpd, php-fpm, Mariadb dan snmp[root@cacti ~]# systemctl restart httpd
[root@cacti ~]# systemctl restart php-fpm
[root@cacti ~]# systemctl restart mariadb
[root@cacti ~]# systemctl restart snmpd
Step 11 - Install Cacti
Untuk Installasi Cacti silahkan akses melalui browser lalu masukan pada url http://ip_address/cacti lalu masukan User dan password default yaitu admin admin.
Ganti Password default cacti
Pilih Accept GPL License lalu Klik Begin
Klik Next
Klik Next
Klik Next
Klik Next
Pilih I have read statement lalu Klik Next
Klik Next
Klik Next
Klik Next
Pilih Confirm Installation
Proses Installasi Cacti
Klik Get Started
Versi cacti
Klik pada menu Management lalu Klik Device
Tunggu beberapa saat untuk Up
Cacti membutuhkan beberapa saat untuk membuat Graph
Ok demikian cara intuk install Cacti di Centos 8, pada artikel selanjutnya saya akan membuat beberapa setingan pada cacti dan menambahkan beberapa Plugin pada cacri server. Terimakasih semoga bermanfaat.