備註:只所以升級rrdtool版本,是因爲據說rrdtool 1.3x 以下安裝cacti會出現中文亂碼(SuSe 10 測試通過)
rrdtool 介紹
(http://www.rrdtool.org)
RRDtool是指Round Robin Database 工具(環狀數據庫)。Round robin是一種處理定量數據、以及當前元素指針的技術。想象一個周邊標有點的圓環--這些點就是時間存儲的位置。從圓心畫一條到圓周的某個點的箭頭--這就是指針。就像我們在一個圓環上一樣,沒有起點和終點,你可以一直往下走下去。過來一段時間,所有可用的位置都會被用過,該循環過程會自動重用原來的位置。這樣,數據集不會增大,並且不需要維護。
RRDtool源自MRTG(多路由器流量繪圖器)。MRTG是有一個大學連接到互聯網鏈路的使用率的小腳本開始的。MRTG後來被當作繪製其他數據源的工具使用,包括溫度、速度、電壓、輸出量等等。
參考地址
RRDtool中英文翻譯使用手冊
http://leftleg.hzpub.com/post/634/
http://www.study-area.org/tips/rrdtool/rrdtool.html
安裝注意
在安裝rrdtool時需要cairo包的支持,而cairo又需要pkg-config、glib、pixman、pang、freetype、fontconfig包的支持
支持包下載地址
http://oss.oetiker.ch/rrdtool/pub/libs/
前面安裝失敗記錄
http://blog.c1gstudio.com/archives/446
下載完rrdtool解壓後可以查看它的安裝文檔
http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.7.tar.gz
tar zxvf rrdtool-1.3.7.tar.gz
cat rrdtool-1.3.7/doc/rrdbuild.txt
開始安裝
設置環境變量
安裝臨時目錄爲/tmp/rrdbuild,安裝目錄爲/usr/local/rrdtool
- export BUILD_DIR=/tmp/rrdbuild
- export INSTALL_DIR=/usr/local/rrdtool
- mkdir -p $BUILD_DIR
- cd $BUILD_DIR
- export CFLAGS="-O3 -fPIC"
- export LDFLAGS="-Wl,--rpath -Wl,${INSTALL_DIR}/lib"
- export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/pkgconfig
- export PATH=$INSTALL_DIR/bin:$PATH
- export PKG_CONFIG=$INSTALL_DIR/bin/pkg-config
- cd $BUILD_DIR
- wget -c http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.7.tar.gz
- tar zxvf rrdtool-1.3.7.tar.gz
- wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz
- tar zxvf pkg-config-0.23.tar.gz
- cd pkg-config-0.23
- ./configure --prefix=$INSTALL_DIR
- make
- make install
- cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz
- tar zxvf zlib-1.2.3.tar.gz
- cd zlib-1.2.3
- ./configure --prefix=$INSTALL_DIR --shared
- make
- make install
- cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz
- tar zxvf libpng-1.2.18.tar.gz
- cd libpng-1.2.18
- ./configure --prefix=$INSTALL_DIR
- make
- make install
- cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.3.5.tar.gz
- tar zxvf freetype-2.3.5.tar.gz
- cd freetype-2.3.5
- ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
- make
- make install
- cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-2.6.32.tar.gz
- tar zxvf libxml2-2.6.32.tar.gz
- cd libxml2-2.6.32
- ./configure --prefix=$INSTALL_DIR
- make
- make install
- cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz
- tar zxvf fontconfig-2.4.2.tar.gz
- cd fontconfig-2.4.2
- ./configure --prefix=$INSTALL_DIR --with-freetype-config=$INSTALL_DIR/bin/freetype-config
- make
- make install
- cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/pixman-0.10.0.tar.gz
- tar zxvf pixman-0.10.0.tar.gz
- cd pixman-0.10.0
- ./configure --prefix=$INSTALL_DIR
- make
- make install
- cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz
- tar zxvf cairo-1.6.4.tar.gz
- cd cairo-1.6.4
- ./configure --prefix=$INSTALL_DIR \
- --enable-xlib=no \
- --enable-xlib-render=no \
- --enable-win32=no
- make
- make install
- cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/glib-2.15.4.tar.gz
- tar zxvf glib-2.15.4.tar.gz
- cd glib-2.15.4
- ./configure --prefix=$INSTALL_DIR
- make
- make install
#gconvert.c:51:2: #error GNU libiconv not in use but included iconv.h is from libiconv
需帶上–with-libiconv
- cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.bz2
- bunzip2 pango-1.21.1.tar.bz2
- tar xf pango-1.21.1.tar
- cd pango-1.21.1
- ./configure --prefix=$INSTALL_DIR --without-x
- make
- make install
- cd $BUILD_DIR/rrdtool-1.3.7
- ./configure --prefix=$INSTALL_DIR --disable-tcl --disable-python
#和nagios結合時增下下面參數
–with-rrdtool=/usr/local/rrdtool/bin/rrdtool –with-perfdata-dir=/usr/local/nagios/share/perfdata
- Find 3rd-Party Libraries
- checking for cairo_font_options_create in -lcairo... no
- checking for pkg-config... pkg-config
- configure: WARNING:
- ----------------------------------------------------------------------------
- * I found a copy of pkgconfig, but there is no cairo-png.pc file around.
- You may want to set the PKG_CONFIG_PATH variable to point to its
- location.
- ----------------------------------------------------------------------------
- configure: WARNING:
- ----------------------------------------------------------------------------
- * I could not find a working copy of cairo-png. Check config.log for hints on why
- this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately
- so that compiler and the linker can find libcairo and its header files. If
- you have not installed cairo-png, you can get it either from its original home on
- http://cairographics.org/releases/
- You can find also find an archive copy on
- http://oss.oetiker.ch/rrdtool/pub/libs
- The last tested version of cairo-png is 1.4.6.
- LIBS=-lm
- LDFLAGS=
- CPPFLAGS=
- ----------------------------------------------------------------------------
- checking for cairo_svg_surface_create in -lcairo... no
- checking for pkg-config... (cached) pkg-config
有以上信息請檢查cairo安裝和環境變量
- checking in... and out again
- ordering CD from http://tobi.oetiker.ch/wish .... just kidding ;-)
- ----------------------------------------------------------------
- Config is DONE!
- With MMAP IO: yes
- Build rrd_getopt: no
- Static programs: no
- Perl Modules: perl_piped perl_shared
- Perl Binary: /usr/bin/perl
- Perl Version: 5.8.5
- Perl Options: PREFIX=$(DESTDIR)/usr/local/rrdtool LIB=$(DESTDIR)/usr/local/rrdtool/lib/perl/5.8.5
- Ruby Modules:
- Ruby Binary: no
- Ruby Options: sitedir=$(DESTDIR)/usr/local/rrdtool/lib/ruby
- Build Tcl Bindings: no
- Build Python Bindings: no
- Build rrdcgi: yes
- Build librrd MT: yes
- Link with libintl: yes
- Libraries: -lxml2 -lcairo -lcairo -lcairo -lm -lcairo -lpng12 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
- Type 'make' to compile the software and use 'make install' to
- install everything to: /usr/local/rrdtool.
- ... that wishlist is NO JOKE. If you find RRDtool useful
- make me happy. Go to http://tobi.oetiker.ch/wish and
- place an order.
出現以上信息表明離成功不遠了哈。
- make
- make install
=========================
2010-7-22更新
RRDtool 1.4.4 安裝
http://blog.c1gstudio.com/archives/1057