0.安裝準備
確認已經安裝好apache,mysql,php,redhat中已安裝了如下rpm包:zlib,libpng,freetype,libart_lgpl,
1.下載軟件包
cacti: http://www.cacti.net/downloads/cacti-0.8.7b.tar.gz
rrdtool:
http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.2.14.tar.gz
2.安裝數據庫
在mysql里創建一個用戶cactiuser,新建一個schema名為cacti,然后給用戶cactiuser授權從localhost訪問cacti
在mysql console里執行source /usr/local/cacti/cacti.sql,創建cacti需要的表
3.安裝rrdtool
我是從源代碼安裝的,./configure --prefix=/usr/local/rrdtool/ --disable-python --disable-tcl && make && make install
如果不加上--disable-python --disable-tcl ,編譯會有錯誤的,應該是對linux上安裝的tcl有版本要求吧,反正我不需要,先這樣過去吧
4.安裝snmp
直接從redhat的安裝盤中安裝net-snmp-perl-5.0.9-2.30E.6.i386.rpm,net-snmp-utils-5.0.9-2.30E.6.i386.rpm這兩個rpm包,這樣在/usr/bin目錄下就有了snmpwalk,snmpget,snmpbulkwalk等幾個cacti需要的文件
5.安裝cacti
在瀏覽器里訪問
http://localhost/cacti/install/index.php
確認snmp及rddtool,php的路徑
6.修改snmp.conf配置
com2sec notConfigUser
default public \\將default改為安裝cacti服務的機器ip,public是snmp默認的Community,可以改成自己設定的團體名稱
access notConfigGroup "" any noauth exact
systemview none none
\\將systemview改成all
#view all included .1 80 \\去掉注釋符
重啟snmpd服務:service snmpd restart
7.修改crotab
#crontab -u cactiuser -e
*/5 * * * * /usr/local/bin/php /usr/apache/htdocs/cacti/poller.php > /dev/null 2>&1
ok,安裝結束.