1.安裝PNPios
2.配置PNP
3.修改nagios配置文件
4.測試pnp功能
5.報錯修改
Deprecated: Function eregi() is deprecated in /usr/local/nagios/share/pnp/include/function.inc.php on line 1541
Deprecated: Function eregi() is deprecated in /usr/local/nagios/share/pnp/include/function.inc.php on line 1541
Deprecated: Function eregi() is deprecated in /usr/local/nagios/share/pnp/include/function.inc.php on line 1541
終於搞定搞定,中間安裝的時候還報了不少次錯誤,大部分都是你的包沒有裝徹底,只要按照錯誤提示把相應的包安裝好就OK了,先確認是否有如下rpm包:
-----------
[root@localhost pnp4nagios-0.6.16]#ln -s /usr/local/rrdtool-1.4.7/lib/perl/5.8.8/x86_64-linux-thread-multi/RRDs.pm /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/
2.此檢查模塊是否存在:
[root@localhost pnp4nagios-0.6.16]# perl -MRRDs -le 'print q(ok!)'
Can't locate loadable object for module RRDs in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at -e line 0
Compilation failed in require.
BEGIN failed--compilation aborted.
[root@localhost pnp4nagios-0.6.16]# ln -s /usr/local/rrdtool-1.4.7/lib/perl/5.8.8/x86_64-linux-thread-multi/auto/RRDs/RRDs.so /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/
3.這次檢查模塊是否存在:
[root@localhost pnp4nagios-0.6.16]# perl -MRRDs -le 'print q(ok!)'
ok!
----
若是解決了PNPNagios軟件的依賴性,那麼它仍是比較好安裝的,所以在具體的安裝中,首先要根據下面提到的「軟件依賴性」安裝相關的軟件或者模塊,而後再安裝PNPNagios軟件。
要安裝使用pnp4nagios須要如下軟件:
u Perl >= 5.x,不須要其它額外的模塊;
u RRDtool >= 1.x,1.2版本更好,可是並不強制使用這個版本;
u PHP >=
u Nagios >= 2.x 或者是Icinga;
u Kohana須要啓用「mod_rewrite」模塊
注意:安裝RRDtool沒有安裝包管理器可能會致使丟失dejavu字體,若是查看圖像沒有字體時,那麼多是因爲這個問題引發的。
首先來安裝rrdtool,在這裏比較簡單的節選了部分安裝過程:
[root@ff ~]# tar -zxvf rrdtool-
[root@ff ~]# cd rrdtool-
[root@ff rrdtool-
----------------------------------------------------------------
Config is DONE!
With MMAP IO: yes
Perl Modules: perl_piped perl_shared
Perl Binary: /usr/bin/perl
Perl Version:
Perl Options: PREFIX=/usr/local/rrdtool-
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-
... 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 <tobi@oetiker.ch>
----------------------------------------------------------------
[root@ff rrdtool-
[root@ff rrdtool-
|
由於下面的安裝中須要rrdtool的安裝目錄,所以在這裏有必要提一下,下面來下載並安裝PNP4Nagios。
點擊上面的圖標下載最新版本的安裝包,下面是命令行的下載:
[root@s10 ~]# wget http://jaist.dl.sourceforge.net/project/pnp4nagios/PNP-0.6/pnp4nagios-
--16:03:19-- http://jaist.dl.sourceforge.net/project/pnp4nagios/PNP-0.6/pnp4nagios-
=> `pnp4nagios-
正在解析主機 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-
[root@s10 ~]#
|
解壓安裝包:
[root@ff ~]# tar -zxvf pnp4nagios-
[root@ff ~]# cd pnp4nagios-
|
執行configure:
[root@ff pnp4nagios-
*** Configuration summary for pnp4nagios-0.6.17
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-
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-
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-
> --with-rrdtool=/usr/local/rrdtool-
> --with-perl_lib_path=/usr/local/rrdtool-
>
*** Configuration summary for pnp4nagios-0.6.17
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-
RRDs Perl Modules: FOUND (Version 1.2015)
RRDs Perl search path:
/usr/local/rrdtool-
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. |