2016年8月12日 星期五

CentOS7安裝Cacti

REF:http://www.phpini.com/linux/rhel-centos-7-install-cacti
http://www.tecmint.com/install-cacti-network-monitoring-on-rhel-centos-6-3-5-8-and-fedora-17-12/

yum install httpd httpd-devel
yum install mariadb-server -y       
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
systemctl start httpd.service
systemctl start mariadb.service
systemctl start snmpd.service
systemctl enable httpd.service
systemctl enable mariadb.service
systemctl enable snmpd.service
yum install epel-release
yum install cacti
mysqladmin -u root password '密碼'       
mysql -u root -p
create database cacti;
GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY '密碼';  //密碼不能包含"\"
FLUSH privileges;
quit;
rpm -ql cacti | grep cacti.sql -> /usr/share/doc/cacti-0.8.8h/cacti.sql
mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.8h/cacti.sql
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;
*/
vi /etc/httpd/conf.d/cacti.conf
/*
Alias /cacti    /usr/share/cacti


# httpd 2.4
Require all granted                //修改


# httpd 2.2
Order deny,allow
Deny from all
Allow from all                    //修改

*/
service httpd restart       
systemctl restart httpd.service
vi /etc/cron.d/cacti
#*/5 * * * *    cacti   /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1    //取消註解

沒有留言:

張貼留言