configure: error: Perl Module Time::HiRes not available错误解决方法

configure: error: Perl Module Time::HiRes not available错误解决方法

编译安装pnp4nagios-0.6.21的时候提示如下错误信息:

checking for getloadavg... yes

checking for stdlib.h... (cached) yes

checking for GNU libc compatible malloc... yes

checking whether lstat dereferences a symlink specified with a trailing slash... yes

checking whether stat accepts an empty string... no

checking for an ANSI C-conforming const... yes

checking for perl... /usr/bin/perl

checking for rrdtool... /usr/local/rrdtool/bin/rrdtool

checking rrdtool path /usr/local/rrdtool/bin/rrdtool... yes

checking for executable Bit on /usr/local/rrdtool/bin/rrdtool... yes

checking for linker flags for loadable modules... -shared

checking for Perl Module Time::HiRes... no

configure: error: Perl Module Time::HiRes not available

需要安装一个perl-Time-HiRes扩展包的支持,我们运行如下命令:

[root@localhost pnp4nagios-0.6.21]# yum install perl-Time-HiRes

重新编译pnp4nagios-0.6.21:

[root@localhost pnp4nagios-0.6.21]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-rrdtool=/usr/local/rrdtool/bin/rrdtool --with-perfdata-dir=/usr/local/nagios/share/perfdata

*** Configuration summary for pnp4nagios-0.6.21 03-24-2013 ***

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/bin/rrdtool Version 1.4.8

RRDs Perl Modules: FOUND (Version 1.3008)

RRD Files stored in: /usr/local/nagios/share/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.

编译完成,问题解决。