cacti簡單部署 php
常見的服務器監控軟件 html
cacti,流量與性能監測爲主----http://www.cacti.net/ mysql
nagios,服務與性能監測爲主---http://www.nagios.org/ ios
其餘相關工具 web
RRDtool,輪詢數據工具 算法
類別sql |
標號vim |
所包含的信息瀏覽器 |
system服務器 |
(1) |
主機或路由器的操做系統 |
interfaces |
(2) |
各類網絡接口及它們的測定通訊量 |
address transiation |
(3) |
地址轉換(例如ARP映射) |
ip |
(4) |
internet軟件(IP分組統計) |
icmp |
(5) |
ICMP軟件(已收到ICMP消息的統計) |
tcp |
(6) |
TCP軟件(算法、參數和統計) |
udp |
(7) |
UDP軟件(UDP通訊量統計) |
egp |
(8) |
EGP軟件(外部網關協議通訊量統計) |
C/S模式,採集監控數據
B/S模式,管理監測平臺
環境:主機A和主機B的操做系統爲CentOS6.6 x86_64,最小化安裝,均關閉SELINUX和防火牆,主機A做爲監控端,主機B做爲被進口歐冠端,IP地址分別爲192.168.131.138和192。168.131.139。
# yum -y install httpd mysql mysql-server mysql-devel php php-mysql
# yum -y install zlib freetype libjpeg fontconfig libxml2 gd php-gd
# yum -y install rrdtool
# yum -y install net-snmp net-snmp-utils
# service httpd start
# chkconfig httpd on
# service mysqld start
# chkconfig mysqld on
# service snmpd start
# chkconfig snmpd on
# tar xf cacti-0.8.7g.tar.gz -C /var/www/html/
# cd /var/www/html/
# mv cacti-0.8.7g/ cacti
# vim cacti/include/config.php
# mysql
mysql> create database cacti;
mysql> grant all on cacti.* to 'cactiuser'@'localhost' identified by '123456';
mysql> flush privileges;
mysql> exit
# chown -R root:root /var/www/html/cacti/
# useradd cacti
# chown -R cacti:cacti /var/www/html/cacti/log/
# chown -R cacti:cacti /var/www/html/cacti/rra/
# mysql cacti < /var/www/html/cacti/cacti.sql
在瀏覽器輸入http://192.168.131.138/cacti/install/,進入cacti安裝嚮導
# yum -y install net-snmp
# vim /etc/snmp/snmpd.conf
com2sec notConfigUser 192.168.131.138 public123
access notConfigGroup "" any noauth exact all none none
view all included .1 80
# service snmpd start
# vim /etc/snmp/snmpd.conf
# service snmpd restart
在cacti web界面
添加圖像樹
監控端操做
# su – cacti
$ php /var/www/html/cacti/poller.php #開始同步數據
# crontab –e
*/5 * * * * /usr/bin/php /var/www/html/cacti/poller.php
設置crond任務,使其每隔5分鐘執行一次
# chkconfig crond on
圖像顯示出來了