cacti安裝備忘

kumu_linux發表於2012-10-09

這是基於LAMP架構基礎上的,LAMP安裝之前已經介紹,這裡不再討論

net-snmp

 # yum install net-snmp* -y
 # vim /etc/snmp/snmpd.conf 
 # grep -Ev '^#|^$' /etc/snmp/snmpd.conf 
 com2sec notConfigUser  192.168.0.0/255.255.255.0       public
 group   notConfigGroup v1           notConfigUser
 group   notConfigGroup v2c           notConfigUser
 view    systemview    included   .1.3.6.1.2.1.1
 view    systemview    included   .1.3.6.1.2.1.25.1.1
 access  notConfigGroup ""      any       noauth    exact  all none none
 view all    included  .1                               80
 syslocation Unknown (edit /etc/snmp/snmpd.conf)
 syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
 dontLogTCPWrappersConnects yes
 disk /
 # 
 ============================================================================
 修改snmpd.conf
 1.查詢以下欄位:
 #    sec.name         source     community 
 com2sec notConfigUser default    public
 將"comunity"欄位改為你要設定的密碼.比如"bizcnpublic". 
 將“default”改為你想哪臺機器可以看到你的snmp資訊,如10.10.10.10。授權伺服器IP
 2.查詢以下欄位:
 #### 
 # Finally, grant the group read-only access to the systemview view. 
 #    group     context sec.model sec.level prefix read  write notif 
 access notConfigGroup ""   any    noauth  exact systemview none none 
 將"read"欄位改為 all. 
 程式碼: 
 #access notConfigGroup ""   any    noauth  exact all none none 
 3.查詢以下欄位:
 ##      incl/excl subtree             mask 
 #view all  included .1                80 
 將該行前面的"#"去掉.
 
 disk /
 儲存、關閉
 ============================================================================
 # /etc/init.d/snmpd restart
 停止 snmpd:                                               [確定]
 正在啟動 snmpd:                                           [確定]
 #
 
 cacti
 rrdtool

 # yum localinstall rrdtool-devel-1.3.8-6.el6.i686.rpm 
 # tar xf php_rrdtool.tar.gz
 # cd rrdtool
 # phpize 
 Configuring for:
 PHP Api Version:         20090626
 Zend Module Api No:      20090626
 Zend Extension Api No:   220090626
 # ./configure --with-php-config=/usr/local/bin/php-config --with-rrdtool=/usr
 # make && make install
 # vim /usr/local/lib/php.ini
 # grep rrdtool -B 1 /usr/local/lib/php.ini 
 extension_dir="/usr/local/lib/php/extensions/no-debug-non-zts-20090626/"
 extension="rrdtool.so"
 # /etc/init.d/apache restart
 
 cacti

 # tar xf cacti-0.8.8a.tar.gz -C /www/
 # mv /www/cacti-0.8.8a /www/cacti
 # mysql -u root -p
 Enter password: 
 mysql> create database cacti;
 mysql> use cacti;
 mysql> source /www/cacti/cacti.sql;
 mysql> grant all on cacti.* to 'cacti'@'localhost' identified by '123';
 mysql> flush privileges;
 
 # vim /www/cacti/include/config.php
 $database_type = "mysql";
 $database_default = "cacti";
 $database_hostname = "localhost";
 $database_username = "cacti";
 $database_password = "123";
 $database_port = "3306";
 
 瀏覽器登入http://x.x.x.x/cacti/
 預設使用者名稱和密碼如下(登入後提示修改)
 user:admin
 password:admin
 
 # crontab -e
 */5 * * * *  /usr/local/bin/php /www/cacti/poller.php > /dev/null 2>&1

相關文章