rrdtool 介绍
(http://www.rrdtool.org)
RRDtool是指Round Robin Database 工具(环状数据库)。Round robin是一种处理定量数据、以及当前元素指针的技术。想象一个周边标有点的圆环--这些点就是时间存储的位置。从圆心画一条到圆周的某个点的箭头--这就是指针。就像我们在一个圆环上一样,没有起点和终点,你可以一直往下走下去。过来一段时间,所有可用的位置都会被用过,该循环过程会自动重用原来的位置。这样,数据集不会增大,并且不需要维护。
RRDtool源自MRTG(多路由器流量绘图器)。MRTG是有一个大学连接到互联网链路的使用率的小脚本开始的。MRTG后来被当作绘制其他数据源的工具使用,包括温度、速度、电压、输出量等等。
参考地址
RRDtool中英文翻译使用手册
http://leftleg.hzpub.com/post/634/
rrdtool 教學
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 \
FONTCONFIG_CFLAGS=-I/usr/local/rrdtool/include FONTCONFIG_LIBS=”-L/usr/local/rrdtool/lib -lfontconfig ” \
FREETYPE_CFLAGS=-I/usr/local/rrdtool/include/freetype2 FREETYPE_LIBS=”-L/usr/local/rrdtool/lib -lfreetype”
pixman_CFLAGS=-I/usr/local/rrdtool/include/pixman-1 pixman_LIBS=”-L/usr/local/rrdtool/lib -lpixman-1″ \
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
thinks!
你好 按照此教程按部就班 但是到了cairo那里就是Configure:error: Cairo requires at least on font backend. 但是之前的freetype和fontconfig都装了啊。