http://www.perlmonks.org?node_id=993351

joe_tseng has asked for the wisdom of the Perl Monks concerning the following question:

I am setting up an instance of portable Strawberry Perl (Win32) on my flash key and want to write SNMP utility scripts. When I tried to install the SNMP module with CPAN I got this message:

The Net-SNMP library (netsnmp.lib) could not be found.
Please enter the directory where it is located:

After some googling around I found that I need to install Net-SNMP on my computer before I could install the module. When I ran ppm install NetSNMP.ppd I got an incorrect architecture error.

Has anyone successfully installed Net-SNMP on portable Strawberry Perl? Where do I get the correct module and how do I install it?

Thank you ahead of time,

- Joe

Replies are listed 'Best First'.
Re: Installing SNMP in Strawberry Perl
by syphilis (Archbishop) on Sep 13, 2012 at 03:24 UTC
    PPM packages for that module, and its dependencies, are available from the bribes repo.

    For a ppm install, I think you just need to:
    ppm repo add bribes ppm install http://www.bribes.org/perl/ppm/Net-SNMP.ppd
    I'm assuming that your Strawberry Perl has a functional ppm utility - which I think is the case for the 5.16 builds, at least.

    Cheers,
    Rob

      I downloaded the PPD file from the URL you provided and I also downloaded an archive the PPD was looking for (the Strawberry Perl PPM doesn't seem to like using repos), and I got it installed.

      However I still got the same message saying the Net-SNMP library can't be found.

      FYI the results of the install are as follows:

      G:\perl>ppm install G:\downloads\Net-SNMP.ppd
      Installing package 'G:\downloads\Net-SNMP.ppd'...
      Use of chdir('') or chdir(undef) as chdir() is deprecated at G:/perl/perl/vendor/lib/PPM.pm line 393.
      Installing G:\perl\perl\site\lib\Net\SNMP.pm
      Installing G:\perl\perl\site\lib\Net\SNMP\Dispatcher.pm
      Installing G:\perl\perl\site\lib\Net\SNMP\Message.pm
      Installing G:\perl\perl\site\lib\Net\SNMP\MessageProcessing.pm
      Installing G:\perl\perl\site\lib\Net\SNMP\PDU.pm
      Installing G:\perl\perl\site\lib\Net\SNMP\Security.pm
      Installing G:\perl\perl\site\lib\Net\SNMP\Transport.pm
      Installing G:\perl\perl\site\lib\Net\SNMP\Security\Community.pm
      Installing G:\perl\perl\site\lib\Net\SNMP\Security\USM.pm
      Installing G:\perl\perl\site\lib\Net\SNMP\Transport\IPv4.pm
      Installing G:\perl\perl\site\lib\Net\SNMP\Transport\IPv6.pm
      Installing G:\perl\perl\site\lib\Net\SNMP\Transport\IPv4\TCP.pm
      Installing G:\perl\perl\site\lib\Net\SNMP\Transport\IPv4\UDP.pm
      Installing G:\perl\perl\site\lib\Net\SNMP\Transport\IPv6\TCP.pm
      Installing G:\perl\perl\site\lib\Net\SNMP\Transport\IPv6\UDP.pm
      Installing G:\perl\perl\bin\snmpkey
      Installing G:\perl\perl\bin\snmpkey.bat
      

      PS - I also had to download Net-SNMP-v6.0.1-PPM516.tar.gz

        After some more googling I don't think I can use portable Strawberry Perl for what I want to do. None of the other modules supports SNMPv3 (which is a requirement for me), and the one that does has external dependencies that I can't put on my flash key. I'm stuck sharing space on a RHEL server. Oh well.
Re: Installing SNMP in Strawberry Perl
by Anonymous Monk on Sep 13, 2012 at 03:24 UTC

    After some googling around I found that I need to install Net-SNMP on

    ?? those are two different modules

    SNMP requires a c-library, netsnmp.lib , which won't be found on cpan, and like the README says, you get it from http://www.net-snmp.org/

    Net::SNMP doesn't need ppm, you can install it with  perl -MCPAN -e "install Net::SNMP"