Can't locate Net/SNMP.pm in @INC
If you get error "Can't locate Net/SNMP.pm in @INC" while executing a perl script, and in your script syntax is as below, where Net::SNMP module is in use.
use strict;
use Net::SNMP;
use Getopt::Long;
Then use the following step to install Net SNMP
Solution :-- Login as a Super user (root) user on machine.
Login to CPAN shell with following command.
#perl -MCPAN -e shell
cpan> install Bundle::CPAN
cpan[1]> reload cpan
cpan[1]> reload index
cpan[1]> install Net::SNMP
cpan[1]> install Getopt::Long
After all this try to execute your script ..hopefully your problem will be resolved.
use strict;
use Net::SNMP;
use Getopt::Long;
Then use the following step to install Net SNMP
Solution :-- Login as a Super user (root) user on machine.
Login to CPAN shell with following command.
#perl -MCPAN -e shell
cpan> install Bundle::CPAN
cpan[1]> reload cpan
cpan[1]> reload index
cpan[1]> install Net::SNMP
cpan[1]> install Getopt::Long
cpan> exit
Terminal does not support GetHistory.
Lockfile removed.
#
Comments