📄 readme
字号:
The Perl5 'SNMP' Extension Module for the Net-SNMP LibraryContents: Introduction: Availability: Contact: Supported Platforms: Release Notes: Installation: Operational Description: Trouble Shooting: Acknowledgments: History: Copyright:Introduction: ******************************NOTE NOTE NOTE************************** This module now relies on many other modules. Ideally, do not try to build it independently, as it won't work as well. Instead of running "perl Makefile.PL" in this directory, run it in the net-snmp/perl directory instead which has a global makefile used to build all the sub-modules in their proper order. ******************************NOTE NOTE NOTE************************** Note: The perl SNMP 5.x module which comes with net-snmp 5.0 and higher is different than previous versions in a number of ways. Most importantly, it behaves like a proper net-snmp application and calls init_snmp properly, which means it will read configuration files and use those defaults where appropriate automatically parse MIB files, etc. This will likely affect your perl applications if you have, for instance, default values set up in your snmp.conf file (as the perl module will now make use of those defaults). The docmuentation, however, has sadly not been updated yet (aside from this note). This is the Perl5 'SNMP' extension module. The SNMP module provides a full featured, tri-lingual SNMP (SNMPv3, SNMPv2c, SNMPv1) API. The SNMP module also provides an interface to the SMI MIB parse-tree for run-time access to parsed MIB data. The SNMP module internals rely on the Net-SNMP toolkit library (previously known as ucd-snmp). For information on the Net-SNMP library see the documentation provided with the Net-SNMP distribution or the project web page available on 'Source Forge': http://www.net-snmp.org/Availability: The most recent release of the Perl5 SNMP module can be found bundled with the latest Net-SNMP distibution available from: http://www.net-snmp.org/download.html (Note: The perl SNMP distribution obtained this way has the highest chance of being up to date and compatible with the Net-SNMP version with which it is bundled.) A seperately bundled package of the SNMP module can be obtained from CPAN. (Note: In previous releases this module was compatible with the CMU SNMP library. Starting with Perl5/SNMP-1.7 this module will *only* work with the Net-SNMP (aka ucd-snmp) library due to dependence on new features)Contact: The following mailing list should be consider the primary support mechanism for this module: net-snmp-users ATATAT lists.sourceforge.net mail list (see http://www.net-snmp.org/lists/users/ to subscribe)Supported Platforms: Linux 1.2.x, 2.x Solaris 2.x (see the net-snmp README.solaris file!) MS Windows Many other UNIX variants Let us know what it *doesn't* work on, as it should on most systemsRelease Notes: SNMP module version 5.x is being developed against NET-SNMP-5.0 see http://www.net-snmp.org/ for details. Compatibility with earlier or later versions of Net-SNMP or UCD-SNMP is not guaranteed due to the dynamic nature of open software development :). The perl module will check the version of net-snmp you have installed for a match and warn you if they don't match exactly.KNOWN BUGS: The make test suite likely won't work perfectly. It relies on running an existing Net-SNMP SNMP agent and various configuration which makes it very hard to ensure exact compatibility. If "make test" fails on you we suggest you install the module anyway. (none?) (HA!)*********************************************************************** the rest of this file is likely out of date ************************* the rest of this file is likely out of date ************************* the rest of this file is likely out of date **********************************************************************************************Installation: Build and install the Net-SNMP package - see Net-SNMP README and INSTALL docs. (Note: To ensure that any previous Net-SNMP, ucd-snmp or cmu snmp installation's library or headers are not used by mistake, use the -NET-SNMP-CONFIG directive to explicitly set the path to the net-snmp-config command that knows about the net-snmp installation you want to use.) NOTE: build all the perl modules at once using the Makefile.PL in the net-snmp/perl directory rather than the one in this directory. Unix: cd net-snmp/perl perl Makefile.PL [-NET-SNMP-CONFIG="sh ../../net-snmp-config"] [-NET-SNMP-IN-SOURCE=true] make make test make install FreeBSD: cd net-snmp/perl perl Makefile.PL -NET-SNMP-CONFIG="sh ../../net-snmp-config" -NET-SNMP-IN-SOURCE=true make make test make install Win32 (MSVC++) This section covers installation of the Perl modules for Microsoft Visual C++ 6.0 and Microsoft Microsoft Development Environment 2003/2003 (MSVC 7.0/7.1). See the following sections for Cygwin and MinGW. ActiveState Perl is required. Note: With ActiveState Perl (currently at 5.8.2 build 808) and possibly other versions of Perl on Windows, if a Perl script modifies a system environment variable and then calls a C function, the C function will not see the new environment variable. This problem can be seen with the failure of test #3 in the SNMP conf test (perl/SNMP/t/conf.t). The change to the SNMPCONFPATH env variable is not seen by the calls to the C SNMP module. Note: The source code should *not* be in a folder that contains a space. For example, compiling in your 'My Documents' or your Desktop (usually c:\Documents and Settings\xxxx\Desktop) is not supported. Automatic building / testing with nmakeperl.bat: 1. Ensure a static version of Net-SNMP has been compiled and installed. Also ensure the DLL version of snmplib has been compiled and installed. The Perl modules will not function correctly without a shared snmplib library or DLL. 2. Install the regex win32 package (gnu_regex.exe). It is available from http://people.delphiforums.com/gjc/gnu_regex.html a. Copy regex.h to the include folder of MSVC++ Example: "C:\Program Files\Microsoft Visual Studio .NET 2003\ Vc7\include\regex.h" b. Copy gnu_regex.lib to the lib folder of MSVC++ Example: "C:\Program Files\Microsoft Visual Studio .NET 2003\ Vc7\lib\gnu_regex.lib" c. Copy gnu_regex.dll to your %windir%\system32 folder Example: "C:\winnt\system32\gnu_regex.dll" 3. Set the environment PATH to locate "nmake", "cl", and "link". Visual Studio installs a VCVARS32.BAT batch file for this purpose. 4. Using a command prompt window, cd to the source base directory. 5. Invoke win32\nmakeperl.bat to build the Perl SNMP modules. If you see errors, review the "nmake.out" file first. If no errors there, then the modules built correctly, but the tests did not rigourously prove the mettle of the modules. Review "nmaketest.out". If the first three sections mostly pass, the modules are well formed. NOTE: If the tests fail, there may be a perl application left hanging. Use the Task Manager to remove any stale perl or snmp*.exe process. 6. The final step is to invoke "nmake install". If no errors occurred, then the SNMP modules are available for use by your Perl programs. Manual building / testing: 1. Ensure a static version of Net-SNMP has been compiled and installed. Also ensure the DLL version of snmplib has been compiled and installed. The Perl modules will not function correctly without a shared snmplib library or DLL. 2. Install the regex win32 package (gnu_regex.exe). It is available from http://people.delphiforums.com/gjc/gnu_regex.html a. Copy regex.h to the include folder of MSVC++ Example: "C:\Program Files\Microsoft Visual Studio .NET 2003\ Vc7\include\regex.h" b. Copy gnu_regex.lib to the lib folder of MSVC++ Example: "C:\Program Files\Microsoft Visual Studio .NET 2003\ Vc7\lib\gnu_regex.lib" c. Copy gnu_regex.dll to your %windir%\system32 folder Example: "C:\winnt\system32\gnu_regex.dll" 3. Set the environment PATH to locate "nmake", "cl", and "link". Visual Studio installs a VCVARS32.BAT for this purpose. 4. Using a command prompt window, cd to the perl directory. 5. Type: perl Makefile.PL CAPI=TRUE -NET-SNMP-IN-SOURCE=TRUE to compile against the RELEASE version of Net-SNMP, or: perl Makefile.PL CAPI=TRUE -NET-SNMP-IN-SOURCE=TRUE -NET-SNMP-DEBUG=TRUE to compile against the DEBUG version of Net-SNMP. nmake nmake test nmake install Note: The --NET-SNMP-IN-SOURCE=TRUE causes the Makefile to use the library files from the installed Net-SNMP directory. To specify the installed Net-SNMP directory, use: perl Makefile.PL CAPI=TRUE -NET-SNMP-PATH="c:\usr" Note: -NET-SNMP-DEBUG has no effect while compiling against an installed copy of Net-SNMP. Note: To include OpenSSL, see the net-snmp/README.win32 to compile libsnmp with libeay32 and see that libeay.lib is in the lib folder, or in the lib folder of the installed Net-SNMP if using -NET-SNMP-PATH. For example, c:\usr\lib Note: 'nmake test' will automatically start and stop the agent(snmpd) and trap receiver (snmptrapd) while testing the SNMP module. Win32 (Cygwin): cd net-snmp\perl perl Makefile.PL -NET-SNMP-IN-SOURCE=true make make test make install If you get an error saying your system can't compile, you are probably missing the regex library. Install regex from http://mirrors.sunsite.dk/cygwin/release/regex/regex-4.4-2-src.tar.bz2 Note: The source code should *not* be in a folder that contains a space. For example, compiling in your 'My Documents' or your Desktop (usually c:\Documents and Settings\xxxx\Desktop) is not supported. Win32 (MinGW): Note: As of February 25th, 2004, the MinGW build of Net-SNMP does not compile the DLL version of libsnmp. Some modules will not function correctly without a shared library / DLL. The OID module does not appear to work at all without the DLL, and some parts of other modules may not work. For example, sharing configurations between modules which is why the SNMP conf test fails. Note: The source code should *not* be in a folder that contains a space. For example, compiling in your 'My Documents' or your Desktop (usually c:\Documents and Settings\xxxx\Desktop) is not supported. These directions are for MinGW 3.1.0 with MSYS 1.0.9 and ActiveState Perl. Compiling the Perl modules using a MinGW built Perl environment has not been tested.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -