ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 使用PNPNagios图形化Nagios数据 1

使用PNPNagios图形化Nagios数据 1

原创 Linux操作系统 作者:nginx_web 时间:2012-06-11 17:19:12 0 删除 编辑

     要实现Nagios数据的图像化需要使用第三方的软件,PNPNagios可以完成这个任务,PNPNagios的原名为php,下载地址为http://sourceforge.net/projects/pnp4nagios/,它利用RRDTool工具将Nagios的数据生成图形,以便更直观的查看,而且可以查看历史记录。

 

PNPNagios的安装与设置

 

如果解决了PNPNagios软件的依赖性,那么它还是比较好安装的,因此在具体的安装中,首先要根据下面提到的“软件依赖性”安装相关的软件或者模块,然后再安装PNPNagios软件。

软件依赖性

 

    要安装使用pnp4nagios需要以下软件:

 

u       Perl >= 5.x,不需要其它额外的模块;

u       RRDtool >= 1.x1.2版本更好,但是并不强制使用这个版本;

u       PHP >= 5.1.6 基于Kohanaweb前端的需要;

u       Nagios >= 2.x 或者是Icinga

u       Kohana需要启用“mod_rewrite”模块

 

    注意:安装RRDtool没有安装包管理器可能会导致丢失dejavu字体,如果查看图像没有字体时,那么可能是由于这个问题引起的。

 

下载安装

 

首先来安装rrdtool,在这里比较简单的节选了部分安装过程:

 

 

[root@ff ~]# tar -zxvf rrdtool-1.2.15.tar.gz

[root@ff ~]# cd rrdtool-1.2.15

[root@ff rrdtool-1.2.15]# ./configure

 

 

----------------------------------------------------------------

Config is DONE!

 

          With MMAP IO: yes

          Perl Modules: perl_piped perl_shared

           Perl Binary: /usr/bin/perl

          Perl Version: 5.8.5

          Perl Options: PREFIX=/usr/local/rrdtool-1.2.15 LIB=/usr/local/rrdtool-1.2.15/lib/perl/5.8.5

    Build Tcl Bindings: yes

 Build Python Bindings: yes

          Build rrdcgi: yes

       Build librrd MT: yes

 

 

Type 'make' to compile the software and use 'make install' to

install everything to: /usr/local/rrdtool-1.2.15.

 

       ... that wishlist is NO JOKE. If you find RRDtool useful

make me happy. Go to http://people.ee.ethz.ch/oetiker/wish and

place an order.

 

                               -- Tobi Oetiker

----------------------------------------------------------------

[root@ff rrdtool-1.2.15]# make

[root@ff rrdtool-1.2.15]# make install

 

因为下面的安装中需要rrdtool的安装目录,因此在这里有必要提一下,下面来下载并安装PNP4Nagios

 

 

点击上面的图标下载最新版本的安装包,下面是命令行的下载:

 

[root@s10 ~]# wget http://jaist.dl.sourceforge.net/project/pnp4nagios/PNP-0.6/pnp4nagios-0.6.17.tar.gz

--16:03:19--  http://jaist.dl.sourceforge.net/project/pnp4nagios/PNP-0.6/pnp4nagios-0.6.17.tar.gz

           => `pnp4nagios-0.6.17.tar.gz'

正在解析主机 jaist.dl.sourceforge.net... 150.65.7.130

正在连接 jaist.dl.sourceforge.net[150.65.7.130]:80... 已连接。

已发出 HTTP 请求,正在等待回应... 200 OK

长度:3,006,338 [application/x-gzip]

 

100%[===========================>] 3,006,338    709.85K/s    ETA 00:00

 

16:03:25 (649.88 KB/s) - `pnp4nagios-0.6.17.tar.gz' saved [3,006,338/3,006,338]

 

[root@s10 ~]#

 

解压安装包:

 

[root@ff ~]# tar -zxvf pnp4nagios-0.6.17.tar.gz

[root@ff ~]# cd pnp4nagios-0.6.17

 

    执行configure

 

[root@ff pnp4nagios-0.6.17]#  ./configure --prefix=/usr/local/pnp4nagios --with-rrdtool=/usr/local/rrdtool-1.2.15/bin/rrdtool

 

*** Configuration summary for pnp4nagios-0.6.17 03-25-2012 ***

 

  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.2.15/bin/rrdtool Version 1.2.15

  RRDs Perl Modules:                *** NOT FOUND ***

  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:                         http://localhost/pnp4nagios

  Apache Config File:               /etc/httpd/conf.d/pnp4nagios.conf

 

 

  Review the options above for accuracy.  If they look okay,

  type 'make all' to compile.

 

 

  WARNING: The RRDs Perl Modules are not found on your system

           Using RRDs will speedup things in larger installations.

   

注意提示,这个错误的原因是没有找到RRD perl模块,查看RRDTool的安装包,确实是在下面的路径中存在:

 

[root@ff ~]# ll /usr/local/rrdtool-1.2.15/lib/perl/5.8.5/i386-linux-thread-multi/

total 16

-r--r--r--  1 root root 3850 Jul 14  2006 RRDs.pm

drwxr-xr-x  4 root root 4096 Jun  8 16:34 auto

-r--r--r--  1 root root 1215 Jul 14  2006 ntmake.pl

-rw-r--r--  1 root root  456 Jun  8 16:34 perllocal.pod

[root@ff ~]#

   

    解决方法使用--with-perl_lib_path选项:

   

[root@ff pnp4nagios-0.6.17]#  ./configure --prefix=/usr/local/pnp4nagios  \

> --with-rrdtool=/usr/local/rrdtool-1.2.15/bin/rrdtool  \

> --with-perl_lib_path=/usr/local/rrdtool-1.2.15/lib/perl/   \

> 5.8.5/i386-linux-thread-multi/

 

*** Configuration summary for pnp4nagios-0.6.17 03-25-2012 ***

 

  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.2.15/bin/rrdtool Version 1.2.15

  RRDs Perl Modules:              FOUND (Version 1.2015)

  RRDs Perl search path:

                /usr/local/rrdtool-1.2.15/lib/perl/5.8.5/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:                         http://localhost/pnp4nagios

  Apache Config File:               /etc/httpd/conf.d/pnp4nagios.conf

 

 

  Review the options above for accuracy.  If they look okay,

  type 'make all' to compile.

 

   

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27043155/viewspace-732480/,如需转载,请注明出处,否则将追究法律责任。

上一篇: JWS与Nginx的结合
请登录后发表评论 登录
全部评论

注册时间:2012-06-06

  • 博文量
    52
  • 访问量
    417933