nagios監控解決Perl指令碼問題

來源:互聯網
上載者:User

[root@test download]# ./check_memory.pl

Can't locate Nagios/Plugin.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 ./check_memory.pl line 26.

BEGIN failed--compilation aborted at ./check_memory.pl line 26.

解決:

[root@test download]# perl -MCPAN -e 'install Nagios::Plugin'

[root@test download]# ./check_memory.pl

CHECK_MEMORY OK - 1589M free | free=1666281472b;;

[root@test download]#

或者

cpan -i Nagios::Plugin


第一次安裝如果中間有報:

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退出.

===================================

[root@web-server1 download]# perl -MCPAN -e 'install Nagios::Plugin'

Can't locate CPAN.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 .).

BEGIN failed--compilation aborted.

解決:

wget http://search.cpan.org/CPAN/authors/id/A/AN/ANDK/CPAN-1.9800.tar.gz

解壓後執行:

perl Makefile.PL && make && make install

==================================================

Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains

解決:

wget http://search.cpan.org/CPAN/authors/id/M/MS/MSCHWERN/ExtUtils-MakeMaker-6.54.tar.gz

解壓後執行:

perl Makefile.PL && make && make install


==================================

Can't locate Time/HiRes.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 /gitecroot/download/CPAN-1.9800) at /usr/share/perl5/Net/Ping.pm line 313.

解決:

yum install perl-Time-HiRes

======================================

make裝好了卻編譯時間報錯:

make: *** No rule to make target `/usr/lib/perl5/CORE/config.h',needed by `Makefile'. Stop.

解決:

yum install -y perl-devel

=====================================

Can't locate local/lib.pm in @INC


執行命令:cpan -i Nagios::Plugin

perl -MCPAN -e 'install Nagios::Plugin'


如果沒有安裝成功,查看螢幕報錯:Can't locate Params/Validate.pm in @INC

================================

Can't locate Params/Validate.pm in @INC


yum install perl-Params-Validate

yum install perl-DateTime


==================================

Can't locate Regexp/Common.pm in @INC

cpan -i Regexp::Common


相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.