Friday, February 15, 2013

Error compiling Nagios-Plugins-1.4.16 on CentOS 6.3

System

  • Centos 6.3
  • Nagios-Plugins-1.4.16

Problem


After running the follwing commands to compile nagions-plugins
cd /usr/local/src
wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.16/nagios-plugins-1.4.16.tar.gz/download
tar -xzf nagios-plugins-1.4.16.tar.gz
cd nagios-plugins-1.4.16
./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl=/usr/bin/openssl --enable-perl-modules
make

Make crashes at the end with the following error:
Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 11.
BEGIN failed--compilation aborted at Makefile.PL line 11.
Can't run perl Makefile.PL at ../tools/build_perl_modules line 68.
make[2]: *** [all-local] Error 2
make[2]: Leaving directory `/usr/local/src/nagios-plugins-1.4.16/perlmods'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/nagios-plugins-1.4.16'
make: *** [all] Error 2

Solution


The package ExtUtils-MakeMaker has to be installed first. Additionally, perl-devel is also needed to compile it. Then, reconfigure nagios-plugins.


# install perl-devel
yum -y install perl-devel

# install ExtUtils-MakeMaker
cd /usr/local/src
wget http://search.cpan.org/CPAN/authors/id/M/MS/MSCHWERN/ExtUtils-MakeMaker-6.64.tar.gz
tar -xzf ExtUtils-MakeMaker-6.64.tar.gz
cd ExtUtils-MakeMaker-6.64
perl Makefile.PL
make
make install

# now reconfigure nagios-plugins
cd /usr/local/src
cd nagios-plugins-1.4.16
./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl=/usr/bin/openssl --enable-perl-modules
make
make install



You may want to check out my blog post on Installing Centreon 2.4 on CentOS 6.3 x64.

No comments:

Post a Comment