Configure CACTI in CENTOS 7
=> Configuring YUM Server through FTP:
- mount /dev/cd-rom/ /mnt/
- cd /mnt/Packages
- Packages# rpm -ivh vsftpd-3.0.2-9.el7.x86_64.rpm
- systemctl enable vsftpd
- systemctl start vsftpd
- Packages# rpm -ivh libxml2-python-2.9.1-5.el7.x86_64.rpm
- Packages# rpm -ivh deltarpm-3.6-3.el7.x86_64.rpm
- Packages# rpm -ivh python-deltarpm-3.6-3.el7.x86_64.rpm
-Packages#rpm -ivh createrepo-0.9.9-23.el7.noarch.rpm
-mkdir /var/ftp/pub/localrepo
-cp -ar /mnt/Packages/*.* /var/ftp/pub/localrepo/.
-vim /etc/yum.repos.d/local.repo
-add follwing line in this file:
[CENTOS]
name=Yum Server
baseurl=file:///var/ftp/pub/localrepo
gpgcheck=0
enabled=1
-createrepo -v /var/ftp/pub/localrepo/
- yum repolist
- yum clean all
- yum update
- yum install --disablerepo="*" --enablerepo="localrepo" httpd
=> Disable Selinux
1) vi /etc/sysconfig/selinux
- selinux=disabled
2) setenforce 0
=> Configuring Cacti :
- yum install httpd httpd-devel
- yum install mariadb-server
- yum install php-mysql php-pear php-common php-gd php-devel php
php-mbstring php-cli
- yum install php-snmp
- yum install net-snmp-utils net-snmp-libs
- yum install rrdtool
=> start and enable services:
- systemctl enable httpd.service
- systemctl enable mariadb.service
- systemctl enable snmpd.service
- systemctl start httpd.service
- systemctl start mariadb.service
- systemctl start snmpd.service
=> Install CACTI
- yum install epel-release
- yum install cacti
=> Configuring MySQL Server for Cacti Installation
- mysql_secure_installation
=> create Cacti database with user Cacti and password.
- mysql -u root -p
mysql> create database cacti;
mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY ‘Noc@123’;
mysql>FLUSH privileges;
mysql> quit;
=> Install Cacti Tables to MySQL:
- rpm -ql cacti | grep cacti.sql
- mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql
=> Configure MySQL settings for Cacti :
- vim /etc/cacti/db.php
- Make the following changes and save the file. Make sure you set password correctly. /*
ke sure these values reflect your actual database/host/user/password
*/
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";(username)
$database_password = "Noc@123";(Password)
$database_port = "3306";
$database_ssl = false;
=> Configuring Firewall for Cacti
- firewall-cmd --permanent --zone=public --add-service=http
- firewall-cmd --reload
=> Configuring Apache Server
- vi /etc/httpd/conf.d/cacti.conf
- In the latest version of Apache (ex: Apache 2.4), you may need to change the following.
<Directory /usr/share/cacti/>
<IfModule mod_authz_core.c>
# httpd 2.4
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
# httpd 2.2
Order deny,allow
Deny from all
Allow from all
</IfModule>
</Directory>
- systemctl restart httpd.service
=> Change timezone
- vim /etc/php.ini
-> search for date.timezone in this file
-> remove ‘;’ symbole from the line
- sample line :- date.timezone=Asia/Kolkata(IST,+0530)
=> Setting Cron for Cacti
- vi /etc/cron.d/cacti
- uncomment the following line
- #*/5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
Running Cacti Installer Setup :-
- http://YOUR-IP-HERE/cacti/