Solved

Net::SNMP

Posted on 2013-05-13
4
331 Views
Last Modified: 2013-05-13
When I run my perl script, I get the following error.

Can't locate Net/SNMP.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at ./myscript.pl line 3.
BEGIN failed--compilation aborted at ./myscript.pl line 3.


Here is line 3 of my script:

#!/usr/bin/perl

use Net::SNMP qw(:snmp);    #  Line 3 of myscript.pl
use Net::Ping;

Open in new window



Seems like there is problem with finding the Net/SNMP.  Please advice what should I need to do.  Thanks!
0
Comment
Question by:natalie_n
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 28

Expert Comment

by:FishMonger
ID: 39161548
Did you install the Net::SNMP module?  If so, it wasn't installed correctly.

You need to install the module.
0
 
LVL 23

Accepted Solution

by:
nemws1 earned 500 total points
ID: 39161554
You need to install that module.

What OS are you running?  Do you have root access on your workstation?

The short answer, run:

sudo cpan Ne::SNMP

And when asked if to use default settings, just say "yes"
0
 

Author Comment

by:natalie_n
ID: 39162079
Thanks for your helps.  I run "sudo cpan Net::SNMP", and it works.
0
 
LVL 23

Expert Comment

by:nemws1
ID: 39162085
Glad to help. ;-)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question