150. How to Install Cacti Server on Centos7


You can contact me: plus.google.com/+PhallaCCMT; youtube.com/phallaccmt; facebook.com/Phalla.CCMT; twitter.com/PhallaCCMT and Phalla.CCMT@gmail.com

Command:

yum install update

**Install Apache
yum install httpd httpd-devel

**Install MySQL
yum install mariadb-server -y

**Install PHP
yum install php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli

**Install PHP-SNMP
yum install php-snmp

**Install NET-SNMP
yum install net-snmp-utils net-snmp-libs

*Install RRDTool
yum install rrdtool

**Staring Apache, MySQL and SNMP Services
systemctl start httpd.service
systemctl start mariadb.service
systemctl start snmpd.service

**Configure System Start-up Links:
systemctl enable httpd.service
systemctl enable mariadb.service
systemctl enable snmpd.service

**Enable EPEL Repository
yum install wget
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm

**Install Cacti
yum install cacti

**Configuring MySQL Server for Cacti Installation
mysqladmin -u root password [YOUR-PASSWORD-HERE]

**Create MySQL Cacti Database
mysql -u root -p
> create database cacti;
> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'SQLadmin123';
> FLUSH privileges;
> 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

vi /etc/cacti/db.php
------------
/* make sure these values reflect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "your-password-here";
$database_port = "3306";
$database_ssl = false;
-----------

**Configuring Firewall for Cacti
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --reload

**Configuring Apache Server for Cacti Installation
vi /etc/httpd/conf.d/cacti.conf
-----------
Alias /cacti    /usr/share/cacti

<Directory /usr/share/cacti/>
Order Deny,Allow
Deny from all
Allow from [ Allow IP Address]
</Directory>
-----------

Alias /cacti    /usr/share/cacti
<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>
----------------

**Restart the Apache service
systemctl restart httpd.service

**Setting Cron for Cacti
vi /etc/cron.d/cacti
---------
*/5 * * * *    cacti   /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
---------

**Running Cacti Installer Setup
http://YOUR-IP-HERE/cacti/




Ref:
https://www.tecmint.com/install-cacti-network-monitoring-on-rhel-centos-6-3-5-8-and-fedora-17-12/
https://nerd.h8u.net/2017/09/25/granting-cacti-access-to-the-mysql-timezone-database-on-freebsd/



-----------------------------------
Fix Error:

mysql -u root -p mysql
> GRANT SELECT ON mysql.time_zone_name TO cacti@localhost;
> flush privileges;
> exit

cd /usr/share/mysql
ls -ltr | grep mysql
mysql -u root -p mysql < mysql_test_data_timezone.sql

vi /etc/php.ini
---
date.timezone = Asia/Phnom_Penh
---

Ref: https://my-techie-guy.blogspot.com/2017/09/error-your-cacti-database-login-account.html

Previous
Next Post »

1 comments:

Write comments
Unknown
AUTHOR
May 19, 2019 at 2:41 PM delete

I get blank graph of local host . HOW CAN I SOLVE IT?

Reply
avatar