Chinaunix首页 | 论坛 | 博客
  • 博客访问: 313180
  • 博文数量: 103
  • 博客积分: 1590
  • 博客等级: 上尉
  • 技术积分: 1075
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-02 10:17
文章分类

全部博文(103)

文章存档

2013年(32)

2012年(7)

2010年(64)

我的朋友

分类: LINUX

2010-02-19 22:08:30

一、安装RRDTOOL:

#tar zxvf rrdtool-1.2.14.tar.gz   下载地址:

#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

访问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
就可以看到监控的主机旁边多出了“小太阳”图标了。点击“小太阳”图标,就可以看到监控图了
阅读(468) | 评论(0) | 转发(0) |
0

上一篇:[zz] nagios图形

下一篇:python class

给主人留下些什么吧!~~