標籤:監視軟體cacti之安裝
1.安裝系統依賴包和搭建LAMP環境
[[email protected] ~]# yum install rrdtool net-snmp net-snmp-libs net-snmp-utils -y
[[email protected] ~]# yum install httpd php php-mysql php-snmp php-xml php-gd mysql-server mysql -y
[[email protected] ~]# vim /etc/httpd/conf/httpd.conf
ServerName localhost
DirectoryIndex index.php index.html index.html.var
AddType application/x-httpd-php .php
[[email protected] ~]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[[email protected] ~]# vim /var/www/html/index.php
<?php
phpinfo();
?>
[[email protected] ~]#
測試:
650) this.width=650;" title="1.jpg" alt="wKioL1Ucq8vwPKXzAASBx88kjfc343.jpg" src="http://s3.51cto.com/wyfs02/M01/5C/33/wKioL1Ucq8vwPKXzAASBx88kjfc343.jpg" />
2.安裝cacti監視軟體
[[email protected] ~]# wget http://www.cacti.net/downloads/cacti-0.8.8c.tar.gz
[[email protected] ~]# tar xvf cacti-0.8.8c.tar.gz
[[email protected] ~]# mv cacti-0.8.8c /var/www/html/cacti
[[email protected] ~]# cd /var/www/html
[[email protected] html]# chown -R apache:apache cacti/
[[email protected] html]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.21-log MySQL Community Server (GPL)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.
mysql> grant all privileges on cacti.* to [email protected]‘localhost‘ identified by ‘system‘;
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
mysql> create database cacti;
mysql> \u cacti
mysql> source /var/www/html/cacti/cacti.sql ;
mysql> exit
Bye
[[email protected] html]# vim cacti/include/config.php
$database_type = "mysql";
$database_default = "cacti"; --指定資料庫
$database_hostname = "localhost"; --資料庫伺服器主機
$database_username = "cacti"; --使用者名稱
$database_password = "system"; --密碼
$database_port = "3306"; --連接埠
$database_ssl = false;
[[email protected] html]# crontab -e --rrdtool繪圖
*/5 * * * * /usr/bin/php /var/www/html/cacti/poller.php >/dev/null 2>&1
[[email protected] html]# /etc/init.d/crond restart
Stopping crond: [ OK ]
Starting crond: [ OK ]
[[email protected] html]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[[email protected] html]#
3.測試
650) this.width=650;" title="2.jpg" style="float:none;" alt="wKioL1UcsaPzeiOjAAUiT4i3SoY733.jpg" src="http://s3.51cto.com/wyfs02/M00/5C/34/wKioL1UcsaPzeiOjAAUiT4i3SoY733.jpg" />
650) this.width=650;" title="3.jpg" style="float:none;" alt="wKiom1UcsGXy3aDYAAKm8GNBbDY187.jpg" src="http://s3.51cto.com/wyfs02/M00/5C/39/wKiom1UcsGXy3aDYAAKm8GNBbDY187.jpg" />
650) this.width=650;" title="4.jpg" style="float:none;" alt="wKioL1UcsaTjiSzjAAMt9sUqBj0797.jpg" src="http://s3.51cto.com/wyfs02/M00/5C/34/wKioL1UcsaTjiSzjAAMt9sUqBj0797.jpg" />
初使密碼:admin
650) this.width=650;" title="5.jpg" style="float:none;" alt="wKioL1UcsaSDOaMeAAI-cYVEYVk810.jpg" src="http://s3.51cto.com/wyfs02/M01/5C/34/wKioL1UcsaSDOaMeAAI-cYVEYVk810.jpg" />
修改密碼:system
650) this.width=650;" title="6.jpg" style="float:none;" alt="wKiom1UcsGbQRRPcAAJQoyjMVDs842.jpg" src="http://s3.51cto.com/wyfs02/M00/5C/39/wKiom1UcsGbQRRPcAAJQoyjMVDs842.jpg" />
650) this.width=650;" title="7.jpg" style="float:none;" alt="wKioL1UcsaXx8gCkAAOo7Ve-Nj0160.jpg" src="http://s3.51cto.com/wyfs02/M01/5C/34/wKioL1UcsaXx8gCkAAOo7Ve-Nj0160.jpg" />
本文出自 “一起走過的日子” 部落格,請務必保留此出處http://tongcheng.blog.51cto.com/6214144/1627590
監視軟體cacti之安裝