官方介绍:

https://exchange.nagios.org/directory/Addons/Graphing-and-Trending/nagiosgraph/details#_ga=1.41004834.1827091096.1474275709

下载地址:

http://nagiosgraph.sourceforge.net/

下载Nagiosgraph

[root@vnagios tmp]# wget http://nchc.dl.sourceforge.net/project/nagiosgraph/nagiosgraph/1.5.2/nagiosgraph-1.5.2.tar.gz

解压

[root@vnagios tmp]# tar vzxf nagiosgraph-1.5.2.tar.gz

按照readme安装环境软件包

[root@vnagios nagiosgraph-1.5.2]# yum install perl-rrdtool perl-GD

检查环境

[root@vnagios nagiosgraph-1.5.2]# ./install.pl --check-prereq
checking required PERL modules
  Carp...1.26
  CGI... ***FAIL***
  Data::Dumper...2.145
  Digest::MD5... ***FAIL***
  File::Basename...2.84
  File::Find...1.20
  MIME::Base64...3.13
  POSIX...1.30
  RRDs...1.4008
  Time::HiRes...1.9725
checking optional PERL modules
  GD...2.49
  Nagios::Config... ***FAIL***
checking nagios installation
  found nagios exectuable at /usr/local/nagios/bin/nagios
  found nagios init script at /etc/init.d/nagios
checking web server installation
  found apache executable at /usr/sbin/httpd

*** one or more problems were detected!
第一个错误
CGI... ***FAIL***

直接yum 安装

[root@vnagios nagiosgraph-1.5.2]# yum -y install perl-CGI

再次运行检查

[root@vnagios nagiosgraph-1.5.2]# ./install.pl --check-prereq
checking required PERL modules
  Carp...1.26
  CGI...3.63                                     /修复
  Data::Dumper...2.145
  Digest::MD5... ***FAIL***
  File::Basename...2.84
  File::Find...1.20
  MIME::Base64...3.13
  POSIX...1.30
  RRDs...1.4008
  Time::HiRes...1.9725
checking optional PERL modules
  GD...2.49
  Nagios::Config... ***FAIL***
checking nagios installation
  found nagios exectuable at /usr/local/nagios/bin/nagios
  found nagios init script at /etc/init.d/nagios
checking web server installation
  found apache executable at /usr/sbin/httpd

*** one or more problems were detected!

接下来修复

Digest::MD5... ***FAIL***
[root@vnagios nagiosgraph-1.5.2]# yum install perl-Digest-MD5

再次检查下:

[root@vnagios nagiosgraph-1.5.2]# ./install.pl --check-prereq
checking required PERL modules
  Carp...1.26
  CGI...3.63
  Data::Dumper...2.145
  Digest::MD5...2.52
  File::Basename...2.84
  File::Find...1.20
  MIME::Base64...3.13
  POSIX...1.30
  RRDs...1.4008
  Time::HiRes...1.9725
checking optional PERL modules
  GD...2.49
  Nagios::Config... ***FAIL***
checking nagios installation
  found nagios exectuable at /usr/local/nagios/bin/nagios
  found nagios init script at /etc/init.d/nagios
checking web server installation
  found apache executable at /usr/sbin/httpd

还有一个错误

Nagios::Config... ***FAIL***

参考文档:http://superuser.com/questions/744152/nagiosgraph-installation-error

先运行yum -y install perl-CPAN
然后运行cpan Nagios::Config

发现无法成功,查询文档先要运行

cpan Module::Build

再次检查

[root@vnagios nagiosgraph-1.5.2]# ./install.pl --check-prereq
checking required PERL modules
  Carp...1.26
  CGI...3.63
  Data::Dumper...2.145
  Digest::MD5...2.52
  File::Basename...2.84
  File::Find...1.20
  MIME::Base64...3.13
  POSIX...1.30
  RRDs...1.4008
  Time::HiRes...1.9725
checking optional PERL modules
  GD...2.49
  Nagios::Config...36
checking nagios installation
  found nagios exectuable at /usr/local/nagios/bin/nagios
  found nagios init script at /etc/init.d/nagios
checking web server installation
  found apache executable at /usr/sbin/httpd

已经没有错误了,可以进行下一步了

将nagiosgraph 安装到/usr/local/nagiso目录

[root@vnagios nagiosgraph-1.5.2]# ./install.pl --prefix=/usr/local/nagios