一 安装
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
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. 需要的依赖包
Apachenet-snmp or ucd-snmpperlgd-develzlib-devellibpng-devellibjpeg-devel
二 PNP配置
1. 在nagios.cfg添加:
process_performance_data=1host_perfdata_command=process-host-perfdataservice_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-perfdatacommand_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.cfgRRD_STORAGE_TYPE = MULTIPL