CentOS6安裝Cacti

很久沒有寫文檔了,上次安裝了nagios,這次我安裝了cacti。給出了文檔。希望看了回帖

安裝cacti需要的環境包 [root@localhost ]# yum install -y gcc
[root@localhost ]# yum install -y httpd mysql mysql-server php php-mysql
[root@localhost ]# yum install -y net-snmp net-snmp-utils
[root@localhost ]# yum install -y rrdtool
為cacti創建庫和用戶
[root@localhost ]# service mysqld start
[root@localhost ]# /usr/bin/mysqladmin --user=root create cacti
[root@localhost ]# mysql -e "GRANT ALL ON cacti.* TO xiaoxingmi IDENTIFIED BY 'xingge'"
下載cacti包並且解壓(可以用CRT上傳)
[root@localhost ]# cd /var/www/html/
[root@localhost html]# tar xf cacti-0.8.7g.tar.gz
[root@localhost cacti-0.8.7g]# cd cacti-0.8.7g/
[root@localhost cacti-0.8.7g]# mv * ../
[root@localhost cacti-0.8.7g]# cd ..
[root@localhost html]# rm -rf cacti-0.8.7g cacti-0.8.7g.tar.gz
導入cacti庫
[root@localhost html]# mysql -ucactiuser -xingye cacti < /var/www/html/cacti.sql
修改php配置文件
[root@localhost html]# vi /var/www/html/include/config.php
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "xingge";
$database_port = "3306";
設置crontab定時任務
[root@localhost /]# echo '*/5 * * * * root /usr/bin/php /var/www/html/poller.php' >> /etc/crontab
設置服務開機自動啟動
[root@localhost ]# chkconfig snmpd on
[root@localhost ]# chkconfig httpd on
[root@localhost ]# chkconfig mysqld on
[root@localhost ]# chkconfig crond on
[root@localhost ]# service httpd restart
[root@localhost ]# service snmpd restart
[root@localhost ]# service mysqld restart
[root@localhost ]#service crond restart
WEB頁面完成安裝 http://ip/index.php

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章