Solved

Net::SNMP

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

759 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

18 Experts available now in Live!

Get 1:1 Help Now