Solved

Net::SNMP

Posted on 2013-05-13
4
325 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now