The scripts outputs "Can't locate Net/SNMP.pm in @

简介: Q:   Can't locate Net/SNMP.pm in @INC....." [root@nagios libexec]# . /check_snmp_int.
Q:
 
Can't locate Net/SNMP.pm in @INC....."

[root@nagios libexec]# . /check_snmp_int.pl  -H 192.168.0.1 -C public -n eth
Can't locate Net/SNMP.pm in @INC (@INC contains: /usr b/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr b/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr b/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr b/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr b/perl5/site_perl/5.8.8 /usr b/perl5/site_perl/5.8.7 /usr b/perl5/site_perl/5.8.6 /usr b/perl5/site_perl/5.8.5 /usr b/perl5/site_perl /usr b/perl5 endor_perl/5.8.8/i386-linux-thread-multi /usr b/perl5 endor_perl/5.8.7/i386-linux-thread-multi /usr b/perl5 endor_perl/5.8.6/i386-linux-thread-multi /usr b/perl5 endor_perl/5.8.5/i386-linux-thread-multi /usr b/perl5 endor_perl/5.8.8 /usr b/perl5 endor_perl/5.8.7 /usr b/perl5 endor_perl/5.8.6 /usr b/perl5 endor_perl/5.8.5 /usr b/perl5 endor_perl /usr b/perl5/5.8.8/i386-linux-thread-multi /usr b/perl5/5.8.8 .) at . eck_snmp_int.pl line 16.
BEGIN failed--compilation aborted at . eck_snmp_int.pl line 16.
[root@nagios libexec]#
 
 
 
 
A:
The scripts outputs "Can't locate Net/SNMP.pm in @INC....."

You don't have Net::SNMP installed, see below

How do I install Net::SNMP perl module ?

There are 2 ways of doing this

1) By CPAN (best)

on command line, as root :

[your_host]# perl -MCPAN -e shell
cpan shell -- CPAN exploration and modules installation (v1.76)
ReadLine support enabled
cpan> install Net::SNMP


If it's the first time you run CPAN, it will probably ask you some (simple) questions.

CPAN will also ask you to satisfy some dependencies (Crypt::DES, Digest::MD5, etc..).

2) "By hand"


Get the folowings modules (tar.gz format) on www.cpan.org

- Crypt::DES
- Digest::MD5
- Digest::SHA1
- Digest::HMAC
- Net::SNMP

for each one (you must install Net::SNMP at the end) :
tar zxf .tar.gz
cd
perl Makefile.pl
make test
make install
 
 
相关文章
|
4月前
|
开发框架 .NET API
C#/.NET/.NET Core推荐学习书籍(24年8月更新)
C#/.NET/.NET Core推荐学习书籍(24年8月更新)
|
7月前
|
开发框架 .NET API
C#/.NET/.NET Core推荐学习书籍(23年12月更新)
C#/.NET/.NET Core推荐学习书籍(23年12月更新)
662 0
|
开发框架 .NET API
C#/.NET/.NET Core推荐学习书籍
C#/.NET/.NET Core推荐学习书籍
124 0
成功解决virsh -r net-dhcp-leases default | grep -i 00:16:3e:2d:95:85 | awk ‘{ print $5 }
成功解决virsh -r net-dhcp-leases default | grep -i 00:16:3e:2d:95:85 | awk ‘{ print $5 }
|
网络协议 数据库 数据安全/隐私保护
|
数据安全/隐私保护 Windows 网络协议