解决Can't locate Nagios/Plugin.pm in @INC错误

post by rocdk890 / 2012-12-10 11:27 Monday linux技术
  今天给测试服务器安装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退出.
夜空- 本站版权
1、本站所有主题由该文章作者发表,该文章作者与夜空享有文章相关版权
2、其他单位或个人使用、转载或引用本文时必须同时征得该文章作者和夜空的同意
3、本帖部分内容转载自其它媒体,但并不代表本站赞同其观点和对其真实性负责
4、如本帖侵犯到任何版权问题,请立即告知本站,本站将及时予与删除并致以最深的歉意
5、原文链接:blog.slogra.com/post-294.html

标签: 模块 rabbitmq nagios perl 组件

评论: