3、安装libart_lgpl
tar xf libart_lgpl-2.3.17.tar.gz
cd libart_lgpl-2.3.17
./configure
make
make install
/bin/cp -r /usr/local/include/libart-2.0 /usr/include/
cd ../
# 原理:利用rrdtool (轮询数据库工具)出图
4、安装rrdtool
tar xf rrdtool-1.2.14.tar.gz
cd rrdtool-1.2.14
./configure --prefix=/usr/local/rrdtool --disable-python --disable-ct1
##WARNING: The RRDs Perl Modules are not found on your System
#Using RRDs will speedup things in larger Installtions.
#configure后出现上面的提示可以不用理会。
make
make install
cd ..
#关注:ls /usr/local/rrdtool/bin/
rrdcgi rrdtool rrdupdate 表示成功
5、安装负责图形展示的pnp-0.4.14.tar.gz
tar zxf pnp-0.4.14.tar.gz
cd pnp-0.4.14
./configure \
--with-rrdtool=/usr/local/rrdtool/bin/rrdtool --with-perfdata-dir=/usr/local/nagios/share/perfdata/
问题:configure报错(一般不会发生)
checking for linker flags for loadable modules... -shared
checking for Perl Module Time::HiRes... no
configure: error: Perl Module Time::HiRes not available
解决:yum install perl-Time-HiRes -y
#################
# WARNING: The RRDs Perl Modules are not found on your System
# Using RRDs will speedup things in larger Installtions.
#####################
make all
make install
make install-config
make install-init
ll /usr/local/nagios/libexec/ |grep process #(用来搜集数据)
6、出图的配置
vi nagios.cfg +833
833 process_performance_data=1
#1记录数据,0不记录数据
837 # HOST AND SERVICE PERFORMANCE DATA PROCESSING COMMANDS
838 # These commands are run after every host and service check is
839 # performed. These commands are executed only if the
840 # enable_performance_data option (above) is set to 1. The command
841 # argument is the short name of a command definition that you
842 # define in your host configuration file. Read the HTML docs for
843 # more information on performance data.
844
845 host_perfdata_command=process-host-perfdata
#主机记录数据