Solved

Net::SNMP

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

806 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