Nagios性能数据的采集和展示方法测试

[size=medium]一、安装RRDTOOL:

#tar zxvf rrdtool-1.2.14.tar.gz 下载地址:[url]http://oss.oetiker.ch/rrdtool/pub/[/url]
#cd rrd-1.2.4
#./configure --with-rrdtool=/usr/local/rrdtool/bin/rrdtool --with-perfdata-dir=/usr/local/nagios/share/perfdata
#make
#make install

二、安装PNP:
#tar zxvf pnp-0.4.10.tar.gz
#cd pnp-0.4.10
#./configure
#make
#make install

当时安装Nagios时,PHP没有安装GD库支持,因此需要对PHP重新编译:
三、安装GD库:
#tar zxvf gd-2.0.33.tar.gz
#cd gd-2.0.33
#./configure --freetype --libpng --?
#make
#make intall

四、编译PHP:
#cd php-5.2.4.tar.gz
#./configure --prefix=/usr/local/php/ --with-apxs2=/usr/local/apache/bin/apxs --with-gd2 --with-zlib --with-freetype
#make
#make install

访问http://localhost/nagios/pnp/index.php?host=localhost 看到图形即表示OK。

五、修改Nagios.cfg文件:

process_performance_data=1

service_perfdata_command=process-service-perfdata #默认此句被注释掉了

六、修改service.cfg,在末尾处加入:
define service {
name srv-pnp
register 0
action_url /nagios/pnp/index.php?host=$HOSTNAME$&srv=$SERVICEDESC$
}

七、修改localhost.cfg,加入:

define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name localhost
alias localhost
address 127.0.0.1
process_perf_data 1
action_url /nagios/pnp/index.php?host=$HOSTNAME$
}

然后

#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

校验下,看配置是否有错,重新启动nagios:
#/etc/init.d/nagios restart
就可以看到监控的主机旁边多出了“小太阳”图标了。点击“小太阳”图标,就可以看到监控图了。[/size]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值