怎样使用cacti与交换机配合监控linux主机?
以下为本人实施总结的步骤:<br>◎ 基本需求<br>您的Server基本上需要有下面這些套件<br>RedHat Linux+Apache + PHP + MySQL<br>shell>rpm -qa|grep php-snmp<br>shell>rpm -qa|grep php<br>shell>rpm -qa|grep net-snmp<br>shell>rpm -qa|grep php-gd<br>shell>rpm -qa|grep httpd<br>shell>rpm -qa|grep mysql<br>基本上您的php必須有開啟snmp、sockets、gd這三個函式庫<br><br>◎ 安裝Snmp<br><br>◎ 安裝RRDTool.<br>注意:由於rrdtool1.2版本已經不再自帶外部的lib庫,所以需要從<br>[url=http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/libs/]http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/libs/[/url]<br><br><br>◎配置snmp<br>#vi /etc/snmp/snmpd.conf<br>更改 1、com2sec notConfigUser default public<br>改为:com2sec notConfigUser 192.168.0.10 public(192.168.0.10为被监控端IP)<br>2、access notConfigGroup "" any noauth exact systemview none none<br>改为:access notConfigGroup "" any noauth exact all none none<br>3、#view all included .1 80<br>将前面的 # 注释 去掉。<br>保存退出 :wq<br><br>下載安裝,建議還是使用1.0.x的版本比較方便<br>目前1.0.x最新版本為1.0.50 <br>[url=http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/rrdtool-1.0.x/rrdtool-1.0.50.tar.gz]http://people.ee.ethz.ch/~oetike ... dtool-1.0.50.tar.gz[/url]<br>shell> tar zxvf rrdtool-1.0.50.tar.gz <br>shell> cd rrdtool-1.0.50<br>shell> ./configure --prefix=/usr/local/rrdtool <br>shell> make <br>shell> make install <br>shell>cp /usr/local/rrdtool/bin/* /usr/bin<br><br>◎ 開使安裝 Cacti 解壓縮檔案.<br>shell> tar xzvf cacti-version.tar.gz -C /var/www/html<br>shell> mv /var/www/html/cacti-version /var/www/html/cacti<br><br>◎ 建立 Cacti 用的 MySQL 資料庫:<br>shell>useradd cactiuser<br>shell>passwd cactiuser<br>shell> mysql<br>mysql>create database cacti;<br>mysql>grant all privileges on cacti.* to cactiuser@localhost identified by 'cactiuser';<br>mysql>flush privileges;<br><br>◎ 匯入預設的cacti資料庫:<br>shell>mysql cacti < cacti.sql<br><br>◎ 修改檔案 include/config.php 連接 MySQL 的使用者、密碼及資料庫名稱.<br>$database_default = "cacti";<br>$database_hostname = "localhost";<br>$database_username = "cactiuser";<br>$database_password = "cactiuser";<br><br>◎ 設定log及rra資料夾權限.<br>shell> chown -R cactiuser rra/ log/<br><br><br>◎ 新增自動執行到您的 /etc/crontab 檔案裡:<br>shell>crontab -u cactiuser -e<br>*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1<br><br>注意:請勿使用root執行上面命令,不然還要在執行一次第7步驟。<br>修改 /var/www/html/cacti/ 到您的 Cacti 安裝目錄.<br><br>◎ 打開您的瀏覽器輸入下面網址:<br>http://your-server/cacti/<br><br>◎ 登入的帳號密碼<br>登入的帳號密碼預設都是 admin.<br>登入後需立即更改您的密碼。之後這裡需輸入一寫資訊,如rrdtool、php、snmpwalk、snmpget的位置,使用ucd-snmp還是net-snmp等等。<br><br>◎ 怎样监控windows机器<br>1.安装snmp<br>2.打开服务,启动snmp,并指定snmp的接收IP和snmp接收的字符串<br><br>◎ 怎样监控PIX防火墙<br>1.在pix上设置<br>pix(conf)#snmp-server host inside 192.168.7.98 community top963<br>pix(conf)#snmp-server community top963<br>pix(conf)#snmp-server enable traps snmp<br>2.在监控主机上的cacti中添加pix内网IP,并指定相应的community<br>pix(conf)#snmp-server enable traps syslog<a href=[[[SQ]]][[[http://bbs.wendaedu.com/viewthread.php?tid=3783]]]></a>页:
[1]
