解决Can't locate Nagios/Plugin.pm in @INC错误
今天给测试服务器安装nagios监控rabbitmq的插件的时候,报下面这个错误:
#./check_rabbitmq_objects -H rabbitmqservername
Can't locate Nagios/Plugin.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./check_rabbitmq_objects line 11.
BEGIN failed--compilation aborted at ./check_rabbitmq_objects line 11.
记录下解决这个错误的方法.
系统:centos 5.5
需要的软件包:rpmforge-release-0.5.2-2.el5.rf.i386.rpm
1.下载rpmforge-release
wget http://download.slogra.com/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
rpm -ivh rpmforge-release-0.5.2-2.el5.rf.i386.rpm
2.安装perl组件
yum -y install perl-Params-Validate perl-Math-Calc-Units perl-Regexp-Commonperl-Class-Accessor perl-Config-Tiny perl-Nagios-Plugin.noarch
3.验证
./check_rabbitmq_objects -H rabbitmqservername
好了,没有报上面的错误了,但又报下面这个错误:
Can't locate LWP/UserAgent.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./check_rabbitmq_objects line 12.
BEGIN failed--compilation aborted at ./check_rabbitmq_objects line 12.
输入:
perl -MCPAN -eshell
cpan> install Bundle::LWP
或
perl -MCPAN -e 'install Bundle::LWP'
如果中间有报:
Do you want to modify/update your configuration (y|n) ? [no] no
这里提示要不要对原有网络配置进行更新修改,我们选择no
Shall I follow them and prepend them to the queue of modules we are processing right now? [yes] yes
这里提示须跟随他们和他们预队列中我们现在正在处理的模块吗,直接输入yes.
好了,下面就是等待了,可能会有上面几次的重复提示,都安装上吧,安装完后,出现
cpan>
输入exit退出.
#./check_rabbitmq_objects -H rabbitmqservername
Can't locate Nagios/Plugin.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./check_rabbitmq_objects line 11.
BEGIN failed--compilation aborted at ./check_rabbitmq_objects line 11.
记录下解决这个错误的方法.
系统:centos 5.5
需要的软件包:rpmforge-release-0.5.2-2.el5.rf.i386.rpm
1.下载rpmforge-release
wget http://download.slogra.com/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
rpm -ivh rpmforge-release-0.5.2-2.el5.rf.i386.rpm
2.安装perl组件
yum -y install perl-Params-Validate perl-Math-Calc-Units perl-Regexp-Commonperl-Class-Accessor perl-Config-Tiny perl-Nagios-Plugin.noarch
3.验证
./check_rabbitmq_objects -H rabbitmqservername
好了,没有报上面的错误了,但又报下面这个错误:
Can't locate LWP/UserAgent.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./check_rabbitmq_objects line 12.
BEGIN failed--compilation aborted at ./check_rabbitmq_objects line 12.
输入:
perl -MCPAN -eshell
cpan> install Bundle::LWP
或
perl -MCPAN -e 'install Bundle::LWP'
如果中间有报:
Do you want to modify/update your configuration (y|n) ? [no] no
这里提示要不要对原有网络配置进行更新修改,我们选择no
Shall I follow them and prepend them to the queue of modules we are processing right now? [yes] yes
这里提示须跟随他们和他们预队列中我们现在正在处理的模块吗,直接输入yes.
好了,下面就是等待了,可能会有上面几次的重复提示,都安装上吧,安装完后,出现
cpan>
输入exit退出.
评论: