分类目录归档:技术

nagios pnp with MULTIPLE RRD

本文介绍nagios 3 with pnp 0.6 的安装配置

一 安装

1.nagios core

wget  http://sourceforge.net/projects/nagios/files/nagios-3.x/nagios-3.2.3/nagios-3.2.3.tar.gz/download
# ./configure   --prefix=/usr/local/nagios
#make all
#make install
#make install-init
#make install-config
#make install-commandmode
#make install-webconf
初次安装请添加nagios的用户和组,useradd nagios

2.nagios plug

wget  http://downloads.sourceforge.net/project/nagiosplug
#./configure --with-nagios-user=nagios --with-nagios-group=nagios --prefix=/usr/local/nagios
#make && make install

3.nagios pnp

wget  http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz/download
#./configure
#make all && make install
#make install-webconf

4. nagios nrpe

看需要安装吧

5. 需要的依赖包

Apache
net-snmp or ucd-snmp
perl
gd-devel
zlib-devel
libpng-devel
libjpeg-devel

二  PNP配置

1.  在nagios.cfg添加:

process_performance_data=1
host_perfdata_command=process-host-perfdata
service_perfdata_command=process-service-perfdata

2. 在监控机器的配置上添加(0.6pnp跟之前版本不同,请留意):

define host {
   name       host-pnp
   action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_
   register   0
}

define service {
   name       srv-pnp
   action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
   register   0
}

3. 配置command

define command{
command_name process-service-perfdata
command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl
}

4. MULTIPLE RRD

使用0.6版本的PNP就是为了MULTIPLE RRD,可以在脚本反馈变量更改的时候也能正确的新增数据,不至于覆盖搞混RRD
很简单,在pnp4nagios/etc/check_commands/ 添加以check_command 命令打头的.cfg文件,
# cat /usr/local/pnp4nagios/etc/check_commands/check_haproxy.cfg
RRD_STORAGE_TYPE = MULTIPL