How Do I Install Net-SNMP on Windows??? (without visual studio)

I downloaded the file from sourceforge and unzipped it with 7-zip. When I open the folder there is no "install.exe" or anything like that. Believe it or not there are no tutorials on this that I can find online. I went into the win32 folder and ran build.pl but it gave me this message

Please run VCVARS32.BAT first to set up the Visual Studio build environment.

There is no file called vcvars32.bat, all I have is the Visual Studio 2005 Remote Debugger. I opened up a command prompt and ran install-net-snmp.bat in the win32 folder and it seemed to be successful but it doesn't show in my installed programs in Control Panel.

Basically my question is... How do I get net-snmp up and running on Windows 7?

Thanks.

EDIT: The reason I want to use Net-SNMP is because I need to use SNMPv3 and the Windows agent doesn't support it.


Sounds like you downloaded the source code, but what you really want is the Win32 binaries.

Version 5.5 is the last version that has Windows x86 and x64 binaries precompiled by the project developers. http://sourceforge.net/projects/net-snmp/files/net-snmp%20binaries/5.5-binaries/

But even if you install the 5.5 binaries on Windows, I do not think it shows up in the control panel or start menu. It's not going to have a window you can open and click things in.


Yeah, I really don't know why Net-SNMP doesn't distribute prebuilt binaries with their code. It's bizarre.

Anyways, I recently built 5.7.3 for Windows 64-bit (with full support for SSL, IPv6, and SNMP extension DLLs). You can download the binaries here: http://www.mediafire.com/download/5b6xs5u3lajl3s2/net-snmp-windows-x64-5.7.3.7z

Because I compiled this with Visual Studio 2015, you will also have to install the Visual C++ Redistributable for Visual Studio 2015 from here: https://www.microsoft.com/en-us/download/details.aspx?id=48145

Unzip the archive to C:\Program Files\Net-SNMP. You should be able to run the bin\snmpd.exe file to launch the agent. Edit etc\snmp\snmpd.conf (or run bin\snmpconf) to configure the agent. You can run:

snmpd.exe -register <add arguments to snmp.exe here>

to install the agent as a Windows service. Remember to add an exception to your Windows firewall for the snmpd.exe executable. And that's how you install Net-SNMP for Windows x64.

I'll also provide you with the exact steps I used to compile the binaries, so at least this can be documented concisely somewhere on the Internet. The official documentation for how to do this is incredibly lengthy, erroneous, and outdated.

Prerequisites: Active Perl x64, Visual Studio Community Edition (I used 2015). Note that the version of Visual Studio you use will effect the paths used below in the compilation instructions, so modify the path below accordingly if you're using something other than the 2015 edition.

First, compile OpenSSL for Windows x64. Unzip the source code, and in the same directory:

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
perl Configure VC-WIN64A --prefix=C:\OpenSSL-Win64
ms\do_win64a
nmake -f ms\nt.mak
nmake -f ms\nt.mak install
move C:\OpenSSL-Win64\lib\libeay32.lib C:\OpenSSL-Win64\lib\libeay32MD.lib

That last step renames the OpenSSL static library to something that Net-SNMP expects.

Now, compile Net-SNMP. Unzip the source code, and in the win32 directory:

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
set Platform=x64
set TARGET_CPU=x64
set INCLUDE=%INCLUDE%;C:\OpenSSL-Win64\include
set LIB=%LIB%;C:\OpenSSL-Win64\lib
perl Configure --with-sdk --with-winextdll --with-ssl --with-ipv6 --config=release --linktype=static --prefix="c:/Program Files/Net-SNMP"
manual step: edit net-snmp\net-snmp-config.h, comment out #define snprintf (this is fixed in their git repository)
nmake clean
nmake
nmake install

One you've installed Net-SNMP, you can uninstall and delete everything else just fine (Active Perl, Visual Studio, OpenSSL, etc.) and Net-SNMP will still work. Obviously make sure you keep the VC++ redistributable installed.

I hope this helps somebody out there.


There is an unofficial build of 5.7 here:

http://www.elifulkerson.com/articles/net-snmp-windows-binary-unofficial.php


I was able to use the above to help compile net-snmp 5.8 on Windows 10.

I installed VS Community 2017, Win64OpenSSL 1_1_0i, and Active Perl 5.26.1.2601-MSWin32-x64-404865.

OpenSSL was precompiled from here: https://slproweb.com/products/Win32OpenSSL.html

I could not get OpenSSL to compile the needed LIB/VC DLLs. I had to change the LIB statement to include the "VC" directory.

When making, it said it could not find "rc.exe". Seems the newer VS doesn't install in the tree for VS but in the "Windows Kits" tree. I ended up using:

PATH=%PATH%C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64

*Note I did not put a ";" in the statement as my current machine's path has a trailing ";" in it already. Use "echo %PATH%" to check yours.

Here is what I ended up after installing VS Community 2017, OpenSSL1.1.0i & AvtivePerl_5.26_1201:

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
set Platform=x64
set TARGET_CPU=x64
set INCLUDE=%INCLUDE%;C:\OpenSSL-Win64\include
set LIB=%LIB%;C:\OpenSSL-Win64\lib;C:\OpenSSL-Win64\lib\VC
PATH=%PATH%C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64
perl Configure --with-sdk --with-winextdll --with-ssl --with-ipv6 --config=release --linktype=static --prefix="c:/usr"
nmake clean
nmake
nmake install

Hope this helps someone...

Later, Jeff