Ubuntu的好處,咱不多說了就衝着他的apt-get 軟件豐富,安裝便捷。
一.
apt-get install build-essential
apt-get install flex
apt-get install libmysqlclient15-dev
apt-get install libtool
apt-get install libltdl3-dev
apt-get install libxml2-dev
二.
atp-get install mysql-server
一.安裝Apache 、PHP5
sudo apt-get install apache2
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
sudo apt-get install php5-gd
sudo apt-get install php5-dev
sudo /etc/init.d/apache2 restart
完了之後還要讓apache、php支持mysql
sudo apt-get install libapache2-mod-auth-mysql
sudo apt-get install php5-mysql
sudo /etc/init.d/apache2 restart
至此apache2+php 5+mysql5.0.51的環境就完成了
二.安裝Snmp
sudo apt-get install snmp
這個沒有什麼特別
三.安裝RRDTOOL
sudo apt-get install rrdtool
即可
不過這個RRD是不支持中文的,如果要支持,就只能用Src編譯安裝
安裝rrdtool 之前需要4個文件:
freetype-2.3.5.tar.gz libart_lgpl-2.3.17.tar.gz zlib-1.2.3.tar.gz libpng-1.2.18.tar.gz
rrdtool-1.2.27.tar.gz 這5個最好按照我給出的順序
tar -zxvf freetype-2.3.5.tar.gz
tar -zxvf libart_lgpl-2.3.17.tar.gz
tar -zxvf zlib-1.2.3.tar.gz
tar -zxvf libpng-1.2.18.tar.gz
cd freetype-2.3.5
./configure --prefix=/usr ; make ; make install
cd ../ libart_lgpl-2.3.17
./configure --prefix=/usr ; make ; make install
cd ../ zlib-1.2.3
./configure --prefix=/usr ; make ; make install
cd .. /libpng-1.2.18
./configure --prefix=/usr ; make ; make install
cd ..
然後開始安裝RRDTOOL
tar -zxvf rrdtool-1.2.27.tar.gz
cd rrdtool-1.2.27/src
修改裏面rrd_gfx..c 和rrd_graph.c
修改rrd_graph.c:
請刪除rrd_graph.c文件 3065和3067行
3065: setlocale(LC_TIME,"");
3067: setlocale(LC_CTYPE,"");
在原3067行增加以下內容:
setlocale(LC_ALL,"zh_CN.UTF-8");
修改rrd_gfx.c:
1).請在519行增加:
free(w_text);
2)請修改446行爲:
glyph->index = FT_Get_Char_Index( face, w_text[n]);
3)請417行處增加:
w_text = (wchar_t) calloc (string->count,sizeof(wchar_t));
mbstowcs(w_text,text,string->count);
4)請在387行處增加
wchar_t* w_text;
然後,
Cd ..
./configure --prefix=/usr --exec-prefix=/usr/rrd1.2.27 ; make ; make install
OK!
現在其它的都已經OK只差Cacti 去wysilly兄的Blog下載Cacti的中文版
[url]http://blog.chinaunix.net/u/4312/showart_478158.html[/url]
然後把文件解壓到 /var/www 裏面 在Apache裏設置主目錄即可。
文件夾裏有個cacti.sql 這個是數據庫文件
Useradd cactiuser
Passwd cactiuser
chown -R cactiuser rra/ log/ #要cd /var/www/html 進入文件夾
Mysql –uroot –p
Password:
Mysql>create database cacti;
Mysql>exit;
Mysql –uroot –p cacti< /var/www/html/cacti.sql #這是我的目錄
Password:
Mysql –uroot –p
Password:
mysql>grant all privileges on cacti.* to cactiuser@localhost identified by 'cactiuser';
mysql>flush privileges;
新增自動執行到 /etc/crontab 文檔裏:
shell>crontab -u cactiuser -e
*/5 * * * * cactiuser php /var/www/html/poller.php > /dev/null 2>&1
OK!
最後再裝一下Spine
[url]http://148.6.0.24/linux/debian/pool/main/c/cacti-spine/cacti-spine_0.8.7a-2_i386.deb[/url]
sudo dpkg -i cacti-spine_0.8.7a-2_i386.deb
再貼上幾張圖: