主要是为ping值及丢包率绘图
1、download
2、
- ./configure --prefix=/usr/local/pnp4nagios \
- --with-nagios-user=nagios \
- --with-nagios-group=nagios \
- --with-rrdtool=/usr/local/rrdtool-1.3.8/bin/rrdtool \
- --with-perl_lib_path=/usr/local/rrdtool-1.3.8/lib/perl/5.8.8/i386-linux-thread-multi
- *** Configuration summary for pnp4nagios-0.6.11 01-15-2011 ***
-
-
General Options:
-
------------------------- -------------------
-
Nagios user/group: nagios nagios
-
Install directory: /usr/local/pnp4nagios
-
HTML Dir: /usr/local/pnp4nagios/share
-
Config Dir: /usr/local/pnp4nagios/etc
-
Location of rrdtool binary: /usr/local/rrdtool-1.3.8/bin/rrdtool Version 1.3.8
-
RRDs Perl Modules: FOUND (Version 1.3008)
-
RRDs Perl search path: /usr/local/rrdtool-1.3.8/lib/perl/5.8.8/i386-linux-thread-multi
-
RRD Files stored in: /usr/local/pnp4nagios/var/perfdata
-
process_perfdata.pl Logfile: /usr/local/pnp4nagios/var/perfdata.log
-
Perfdata files (NPCD) stored in: /usr/local/pnp4nagios/var/spool
-
-
Web Interface Options: ------------------------- -------------------
-
HTML URL:
-
Apache Config File: /etc/httpd/conf.d/pnp4nagios.conf
-
-
-
Review the options above for accuracy. If they look okay,
-
type 'make all' to compile.
- make all
-
make install
-
make install-config
- cp ./scripts/process_perfdata.pl /usr/local/nagios/libexec/
- chown nagios.nagios /usr/local/nagios/libexec/process_perfdata.pl
- chmod u+x /usr/local/nagios/libexec/process_perfdata.pl
3、/usr/local/nagios/etc/nagios.cfg
- process_performance_data=1
-
service_perfdata_command=process-service-perfdata #取消该行注释
取消不需要的监控对象(service.cfg或host.cfg)添加以下定义:
(这个定义应该在定义每个service时就添加,否则默认为1)
- define service {
...
process_perf_data 0
...
}
替换掉command定义中的“process-service-perfdata”,定义为使用pnp所提供的脚本
- define command{
-
command_name process-service-perfdata
-
command_line /usr/local/nagios/libexec/process_perfdata.pl
-
}
- cp pnp4nagios-0.6.11/scripts/process_perfdata.pl /usr/local/nagios/libexec/process_perfdata.pl
-
chown nagios.nagios /usr/local/nagios/libexec/process_perfdata.pl
-
chmod u+x /usr/local/nagios/libexec/process_perfdata.pl
4、拷贝nginx的配置文件
- cp ./sample-config/nginx.pnp4nagios.conf /usr/local/nginx/pnp4nagios.conf
5、访问:注意index.php后面要添加“/”
6、关于删除DiskFree,loadblance等不需要的图:
- cd /usr/local/pnp4nagios/var/perfdata
-
for i in `find . -name DiskFree* -or -name LoadAverage*`;do mv $i $i.bak;done
阅读(4287) | 评论(0) | 转发(1) |