loading...

27/07/2023

CACTI

====================== Basic Configuration ======================
 
# timedatectl set-timezone Asia/Dhaka
# timedatectl
 
 
# vi /etc/selinux/config
 
SELINUX=disabled
😡
 
# chkconfig firewalld on
#reboot
 
# hostnamectl set-hostname graph.nmslab.net
# logout
 
# hostname
 
# nmtui
# nmcli connection down enp0s3
# nmcli connection up enp0s3
# ifconfig
 
# vim /etc/hosts
 
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
103.110.59.150 graph.nmslab.net graph
😡
 
# hostname
 
# adduser sysadmin
# passwd sysadmin
 
# dnf -y install openssh-clients openssh-server
or yum install openssh-clients openssh-server
 
# cd /etc/ssh/
 
#vi sshd_config
 
Port 4422
PermitRootLogin no
AllowUsers sysadmin
😡
 
# firewall-cmd –permanent –add-port=4422/tcp
# firewall-cmd –reload
 
# systemctl enable sshd
# systemctl status sshd
# systemctl restart sshd
 
Try to login remotely
#ssh sysadmin@103.110.59.150 –p 4422
 
========================== CACTI Configuration ====================
 
# yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
# yum install -y net-snmp net-snmp-utils net-snmp-libs rrdtool
# yum install -y mariadb-server mariadb
# 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
 
# systemctl start httpd
# systemctl start snmpd
# systemctl start mariadb
 
# systemctl enable httpd
# systemctl enable snmpd
# systemctl enable mariadb
 
# vi /etc/my.cnf.d/mariadb-server.cnf
Add variables in the [mysqld] section.
 
collation-server=utf8mb4_unicode_ci
character-set-server=utf8mb4
max_heap_table_size=32M
tmp_table_size=32M
join_buffer_size=64M
# 25% Of Total System Memory
innodb_buffer_pool_size=1GB
# pool_size/128 for less than 1GB of memory
innodb_buffer_pool_instances=10
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
 
# systemctl restart mariadb
 
# mysql -u root -p
 
create database cacti;
 
GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY ‘cactipassword’;
flush privileges;
exit
 
# mysql -u root -p mysql < /usr/share/mariadb/mysql_test_data_timezone.sql
 
# mysql -u root -p
 
GRANT SELECT ON mysql.time_zone_name TO cactiuser@localhost;
flush privileges;
exit
 
# yum install -y cacti
 
# mysql cacti < /usr/share/doc/cacti/cacti.sql -u cactiuser -p
 
/*
* Make sure these values reflect your actual database/host/user/password
*/
$database_type = ‘mysql’;
$database_default = ‘cacti’;     —-> Edit Here
$database_hostname = ‘localhost’;
$database_username = ‘cactiuser’;   —-> Edit Here
$database_password = ‘cactipassword’;  —-> Edit Here
$database_port = ‘3306’;
 
# vi /etc/cron.d/cacti
 
Uncomment the below line.
*/5 * * * * apache /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
 
# vi /etc/httpd/conf.d/cacti.conf
 
Alias /cacti /usr/share/cacti
<Directory /usr/share/cacti/>
<IfModule mod_authz_core.c>
# httpd 2.4
Require all granted—> Edit Here
</IfModule>
<IfModule !mod_authz_core.c>
# httpd 2.2
Order deny,allow
Deny from all
Allow from localhost
</IfModule>
</Directory>
 
# vi /etc/php.ini
 
Update the PHP parameters.
 
date.timezone = Asia/Dhaka
memory_limit = 512M
max_execution_time = 300
 
# systemctl restart httpd
# systemctl restart php-fpm
 
# firewall-cmd –permanent –add-service=http
# firewall-cmd –reload
 
http://your-ip-address/cacti
 
The initial login details:
Username: admin
Password: admin [new password will be Security@321]
 
=================== Password Reset ==============================
 
To reset the admin account password back to the default of ‘admin’, connect to your Cacti database at the command line.
 
shell> mysql -u root -p cacti
 
Now execute the following SQL:
 
mysql> update user_auth set password=md5(‘admin’) where username=’admin’;
Posted in LinuxTaggs: