Chinaunix首页 | 论坛 | 博客
  • 博客访问: 384004
  • 博文数量: 87
  • 博客积分: 2810
  • 博客等级: 少校
  • 技术积分: 825
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-28 22:34
文章分类

全部博文(87)

文章存档

2010年(25)

2009年(43)

2008年(19)

分类: LINUX

2009-05-12 15:05:12

PHP Install for Nagios
 
1.Download
wget
 
2.Install
 
tar xzvf pnp-0.4.14.tar.gz
cd pnp-0.4.14
./configure
Some lines run across the screen. The output at the end is important.
 
*** Configuration summary for pnp 0.4.14 05-02-2009 ***
  General Options:
  -------------------------         -------------------
  Nagios user/group:                nagios nagios
  Install directory:                /usr/local/nagios
  HTML Dir:                         /usr/local/nagios/share/pnp
  Config Dir:                       /usr/local/nagios/etc/pnp
  Location of rrdtool binary:       /usr/bin/rrdtool Version 1.2.23
  RRDs Perl Modules:                FOUND (Version 1.2023)
  RRD Files stored in:              /usr/local/nagios/share/perfdata
  process_perfdata.pl Logfile:      /usr/local/nagios/var/perfdata.log
  Perfdata files (NPCD) stored in:  /usr/local/nagios/var/spool/perfdata/

  Review the options above for accuracy.  If they look okay,
  type 'make all' to compile.
 
这里比较重要的一点就是rrdtool的路径一定要出现,那首先我们就要安装好rrdtool,安装好了再执行./configure,如果还没有出一rrdtool的路径,那我们就在编译的时候指定rrdtool的路径,如:./configure --with-rrdtool=/usr/local/rrdtool-1.2.xx/bin/rrdtool
 
make all
 
make install----安装

*** Main program, Scripts and HTML files installed ***
Please run 'make install-config' to install sample
configuration files
Please run 'make install-init' if you want to use
BULK Mode with NPCD
 
make install-config----安装配置文件
 
 
make install-init-----安装脚本
 
上面几步也可以用make fullinstall代替
 

After installation some components of PNP were copied to the appropriate places in the file system. These are

the 这种模式,独立进程

修改nagios.cfg,
process_performance_data=1  设置为1
在nagios.cfg里添加一些新的指令:
#
# service performance data
#
service_perfdata_file=/usr/local/nagios/var/service-perfdata
service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$\tSERVICEOUTPUT::$SERVICEOUTPUT$
service_perfdata_file_mode=a
service_perfdata_file_processing_interval=15
service_perfdata_file_processing_command=process-service-perfdata-file

#
# host performance data starting with Nagios 3.0
# 
host_perfdata_file=/usr/local/nagios/var/host-perfdata
host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tHOSTOUTPUT::$HOSTOUTPUT$
host_perfdata_file_mode=a
host_perfdata_file_processing_interval=15
host_perfdata_file_processing_command=process-host-perfdata-file
这些指令的意思就是:
  • service_perfdata_file path to the temporary file which should contain the performance data.
  • service_perfdata_file_template of the temporary file. Data will be defined using nagios macros.
  • service_perfdata_file_mode option “a” specifies that data is to be appended to the file.
  • service_perfdata_file_processing_interval the interval is 15 seconds
  • service_perfdata_file_processing_command the command to be called during the interval.
  • 修改commands.cfg

    添加新的命令:

    define command{
            command_name    process-service-perfdata-file
            command_line    /bin/mv /usr/local/nagios/var/service-perfdata /usr/local/nagios/var/spool/perfdata/service-perfdata.$TIMET$
    }

    define command{
            command_name    process-host-perfdata-file
            command_line    /bin/mv /usr/local/nagios/var/host-perfdata /usr/local/nagios/var/spool/perfdata/host-perfdata.$TIMET$
    }

    启动:

    /usr/local/nagios/bin/npcd -d -f /usr/local/nagios/etc/pnp/npcd.cfg

     

    4.配置PNP

    [root@Nagios pnp]# cp npcd.cfg-sample npcd.cfg
    [root@Nagios pnp]# cp process_perfdata.cfg-sample process_perfdata.cfg
    [root@Nagios pnp]# cp rra.cfg-sample rra.cfg

    只需要把npcd.cfg里面定义log的配置更改为文件就可以了。其它不需要更改。

    5.启动

    /usr/local/nagios/bin/npcd -d -f /usr/local/nagios/etc/pnp/npcd.cfg

    启动pnp

    service nagios restart

    重启nagios

    访问

    就可以了

    配置小太阳的文章在前面已经写出了。这里就不重复了。

     

    阅读(1504) | 评论(0) | 转发(0) |
    0

    上一篇:mail.pl

    下一篇:禁用系统里不需要的服务

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