Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3055937
  • 博文数量: 535
  • 博客积分: 15788
  • 博客等级: 上将
  • 技术积分: 6507
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-07 09:11
文章分类

全部博文(535)

文章存档

2016年(1)

2015年(1)

2014年(10)

2013年(26)

2012年(43)

2011年(86)

2010年(76)

2009年(136)

2008年(97)

2007年(59)

分类: 系统运维

2011-03-14 17:01:38

主要是为ping值及丢包率绘图


1、download

2、
  1. ./configure --prefix=/usr/local/pnp4nagios \
  2. --with-nagios-user=nagios \
  3. --with-nagios-group=nagios \
  4. --with-rrdtool=/usr/local/rrdtool-1.3.8/bin/rrdtool \
  5. --with-perl_lib_path=/usr/local/rrdtool-1.3.8/lib/perl/5.8.8/i386-linux-thread-multi

  1. *** Configuration summary for pnp4nagios-0.6.11 01-15-2011 ***
  2. General Options:
  3. ------------------------- -------------------
  4. Nagios user/group: nagios nagios
  5. Install directory: /usr/local/pnp4nagios
  6. HTML Dir: /usr/local/pnp4nagios/share
  7. Config Dir: /usr/local/pnp4nagios/etc
  8. Location of rrdtool binary: /usr/local/rrdtool-1.3.8/bin/rrdtool Version 1.3.8
  9. RRDs Perl Modules: FOUND (Version 1.3008)
  10. RRDs Perl search path: /usr/local/rrdtool-1.3.8/lib/perl/5.8.8/i386-linux-thread-multi
  11. RRD Files stored in: /usr/local/pnp4nagios/var/perfdata
  12. process_perfdata.pl Logfile: /usr/local/pnp4nagios/var/perfdata.log
  13. Perfdata files (NPCD) stored in: /usr/local/pnp4nagios/var/spool
  14. Web Interface Options: ------------------------- -------------------
  15. HTML URL:
  16. Apache Config File: /etc/httpd/conf.d/pnp4nagios.conf
  17. Review the options above for accuracy. If they look okay,
  18. type 'make all' to compile.

  1. make all
  2. make install
  3. make install-config

  1. cp ./scripts/process_perfdata.pl /usr/local/nagios/libexec/
  2. chown nagios.nagios /usr/local/nagios/libexec/process_perfdata.pl
  3. chmod u+x /usr/local/nagios/libexec/process_perfdata.pl

3、/usr/local/nagios/etc/nagios.cfg
  1. process_performance_data=1
  2. service_perfdata_command=process-service-perfdata #取消该行注释
取消不需要的监控对象(service.cfg或host.cfg)添加以下定义:
(这个定义应该在定义每个service时就添加,否则默认为1)
  1. define service { ... process_perf_data 0 ... }
替换掉command定义中的“process-service-perfdata”,定义为使用pnp所提供的脚本
  1. define command{
  2. command_name process-service-perfdata
  3. command_line /usr/local/nagios/libexec/process_perfdata.pl
  4. }
    1. cp pnp4nagios-0.6.11/scripts/process_perfdata.pl /usr/local/nagios/libexec/process_perfdata.pl
    2. chown nagios.nagios /usr/local/nagios/libexec/process_perfdata.pl
    3. chmod u+x /usr/local/nagios/libexec/process_perfdata.pl

4、拷贝nginx的配置文件
  1. cp ./sample-config/nginx.pnp4nagios.conf /usr/local/nginx/pnp4nagios.conf

5、访问:注意index.php后面要添加“/”

6、关于删除DiskFree,loadblance等不需要的图:
  1. cd /usr/local/pnp4nagios/var/perfdata
  2. for i in `find . -name DiskFree* -or -name LoadAverage*`;do mv $i $i.bak;done



阅读(4287) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~