Zabbix Documentation 5.0

3.04.04.45.0 (current)| In development:5.2 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


manual:installation:install:win_agent

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
manual:installation:install:win_agent [2018/11/20 09:29]
martins-v created; how to build Windows agent binaries with/without TLS
manual:installation:install:win_agent [2019/04/08 08:53]
martins-v adding 'libressl' support
Line 1: Line 1:
-==== Building ​Windows ​agent binaries with/​without TLS ====+==== Building ​Zabbix ​agent on Windows ​====
  
 === Overview === === Overview ===
  
-This section demonstrates how to build Windows agent binaries from sources with or without TLS.+This section demonstrates how to build Zabbix ​Windows agent binaries from sources with or without TLS.
  
 === Compiling OpenSSL === === Compiling OpenSSL ===
Line 39: Line 39:
 === Compiling PCRE === === Compiling PCRE ===
  
-  - Download PCRE library (new mandatory library ​for Zabbix 4.0) from pcre.org, version 8.XXnot pcre2 (ftp://​ftp.csx.cam.ac.uk/​pub/​software/​programming/​pcre/​pcre-8.41.zip)+  - Download PCRE library (mandatory library ​since Zabbix 4.0) from pcre.org, version 8.XXnot pcre2 (ftp://​ftp.csx.cam.ac.uk/​pub/​software/​programming/​pcre/​pcre-8.41.zip)
   - Extract to directory //​E:​\pcre-8.41//​   - Extract to directory //​E:​\pcre-8.41//​
   - Install CMake from https://​cmake.org/​download/,​ during install select: and ensure that cmake\bin is on your path (tested version 3.9.4).   - Install CMake from https://​cmake.org/​download/,​ during install select: and ensure that cmake\bin is on your path (tested version 3.9.4).
   - Create a new, empty build directory, preferably a subdirectory of the source dir. For example, //​E:​\pcre-8.41\build//​.   - Create a new, empty build directory, preferably a subdirectory of the source dir. For example, //​E:​\pcre-8.41\build//​.
-  - Open a commandline window e.g. the x64 Native Tools Command Prompt for VS 2017 and from that Shell environment run cmake-gui. Do not try to start Cmake from the Windows Start menu, as this can lead to errors.+  - Open a commandline window e.g. the x64 Native Tools Command Prompt for VS 2017 and from that shell environment run cmake-gui. Do not try to start Cmake from the Windows Start menu, as this can lead to errors.
   - Enter //​E:​\pcre-8.41//​ and //​E:​\pcre-8.41\build//​ for the source and build directories,​ respectively.   - Enter //​E:​\pcre-8.41//​ and //​E:​\pcre-8.41\build//​ for the source and build directories,​ respectively.
-  - Hit the "​Configure"​ button. +  - Hit the %%"%%Configure%%"%% button. 
-  - When specifying the generator for this project select "NMake Makefiles"​.+  - When specifying the generator for this project select ​%%"%%NMake Makefiles%%"%%.
   - Create a new, empty install directory. For example, //​E:​\pcre-8.41-install//​.   - Create a new, empty install directory. For example, //​E:​\pcre-8.41-install//​.
   - The GUI will then list several configuration options. Make sure the following options are selected:   - The GUI will then list several configuration options. Make sure the following options are selected:
Line 52: Line 52:
     * **PCRE_SUPPORT_UTF** ON     * **PCRE_SUPPORT_UTF** ON
     * **CMAKE_INSTALL_PREFIX** ​               //​E:​\pcre-8.41-install//​     * **CMAKE_INSTALL_PREFIX** ​               //​E:​\pcre-8.41-install//​
-  - Hit "​Configure"​ again. The adjacent "​Generate"​ button should now be active. +  - Hit %%"%%Configure%%"%% again. The adjacent ​%%"%%Generate%%"%% button should now be active. 
-  - Hit "​Generate"​. +  - Hit %%"%%Generate%%"%%
-  - In the event that errors ​do occur, it is recommended that you delete the CMake cache before attempting to repeat the CMake build process. In the CMake GUI, the cache can be deleted by selecting "File > Delete Cache"​.+  - In the event that errors occur, it is recommended that you delete the CMake cache before attempting to repeat the CMake build process. In the CMake GUI, the cache can be deleted by selecting ​%%"%%File > Delete Cache%%"%%.
   - The build directory should now contain a usable build system - //​Makefile//​.   - The build directory should now contain a usable build system - //​Makefile//​.
-  - Open a commandline window e.g. the //x64 Native Tools Command Prompt for VS 2017// and navigate to the //​Makefile//​ mentioned above.+  - Open a commandline window e.g. the x64 Native Tools Command Prompt for VS 2017 and navigate to the //​Makefile//​ mentioned above.
   - Run NMake command: <​code>​   - Run NMake command: <​code>​
 E:​\pcre-8.41\build>​ nmake install E:​\pcre-8.41\build>​ nmake install
Line 68: Line 68:
  
   - On a Linux machine check out the source from SVN:<​code>​   - On a Linux machine check out the source from SVN:<​code>​
-$ svn co svn://​svn.zabbix.com/​tags/​4.2.0 +$ svn co svn://​svn.zabbix.com/​tags/​4.4.0 
-$ cd 4.2.0/+$ cd 4.4.0/
 $ ./​bootstrap.sh $ ./​bootstrap.sh
 $ ./configure --enable-agent --enable-ipv6 --prefix=`pwd` $ ./configure --enable-agent --enable-ipv6 --prefix=`pwd`
Line 75: Line 75:
 $ make dist $ make dist
 </​code>​ </​code>​
-  - Copy and unpack the archive, e.g. zabbix-4.2.0.tar.gz, on a Windows machine. +  - Copy and unpack the archive, e.g. zabbix-4.4.0.tar.gz, on a Windows machine. 
-  - Let's assume that sources are in e:​\zabbix-4.2.0. Open a commandline window e.g. the x64 Native Tools Command Prompt for VS 2017 RC. Go to E:​\zabbix-4.2.0\build\win32\project.+  - Let's assume that sources are in e:​\zabbix-4.4.0. Open a commandline window e.g. the x64 Native Tools Command Prompt for VS 2017 RC. Go to E:​\zabbix-4.4.0\build\win32\project.
   - Compile zabbix_get, zabbix_sender and zabbix_agent.   - Compile zabbix_get, zabbix_sender and zabbix_agent.
     * without TLS: <​code>​     * without TLS: <​code>​
-E:​\zabbix-4.2.0\build\win32\project>​ nmake /K PCREINCDIR=E:​\pcre-8.41-install\include PCRELIBDIR=E:​\pcre-8.41-install\lib+E:​\zabbix-4.4.0\build\win32\project>​ nmake /K PCREINCDIR=E:​\pcre-8.41-install\include PCRELIBDIR=E:​\pcre-8.41-install\lib
 </​code>​ </​code>​
     * with TLS: <​code>​     * with TLS: <​code>​
-E:​\zabbix-4.2.0\build\win32\project>​ nmake /K -f Makefile_get TLS=openssl TLSINCDIR=C:​\OpenSSL-Win64-111-static\include TLSLIBDIR=C:​\OpenSSL-Win64-111-static\lib PCREINCDIR=E:​\pcre-8.41-install\include PCRELIBDIR=E:​\pcre-8.41-install\lib +E:​\zabbix-4.4.0\build\win32\project>​ nmake /K -f Makefile_get TLS=openssl TLSINCDIR=C:​\OpenSSL-Win64-111-static\include TLSLIBDIR=C:​\OpenSSL-Win64-111-static\lib PCREINCDIR=E:​\pcre-8.41-install\include PCRELIBDIR=E:​\pcre-8.41-install\lib 
-E:​\zabbix-4.2.0\build\win32\project>​ nmake /K -f Makefile_sender TLS=openssl TLSINCDIR="​C:​\OpenSSL-Win64-111-static\include TLSLIBDIR="​C:​\OpenSSL-Win64-111-static\lib"​ PCREINCDIR=E:​\pcre-8.41-install\include PCRELIBDIR=E:​\pcre-8.41-install\lib +E:​\zabbix-4.4.0\build\win32\project>​ nmake /K -f Makefile_sender TLS=openssl TLSINCDIR="​C:​\OpenSSL-Win64-111-static\include TLSLIBDIR="​C:​\OpenSSL-Win64-111-static\lib"​ PCREINCDIR=E:​\pcre-8.41-install\include PCRELIBDIR=E:​\pcre-8.41-install\lib 
-E:​\zabbix-4.2.0\build\win32\project>​ nmake /K -f Makefile_agent TLS=openssl TLSINCDIR=C:​\OpenSSL-Win64-111-static\include TLSLIBDIR=C:​\OpenSSL-Win64-111-static\lib PCREINCDIR=E:​\pcre-8.41-install\include PCRELIBDIR=E:​\pcre-8.41-install\lib+E:​\zabbix-4.4.0\build\win32\project>​ nmake /K -f Makefile_agent TLS=openssl TLSINCDIR=C:​\OpenSSL-Win64-111-static\include TLSLIBDIR=C:​\OpenSSL-Win64-111-static\lib PCREINCDIR=E:​\pcre-8.41-install\include PCRELIBDIR=E:​\pcre-8.41-install\lib
 </​code>​ </​code>​
-  - New binaries are located in e:​\zabbix-4.2.0\bin\win64. Since OpenSSL was compiled with '​no-shared'​ option, Zabbix binaries contain OpenSSL within themselves and can be copied to other machines that do not have OpenSSL.+  - New binaries are located in e:​\zabbix-4.4.0\bin\win64. Since OpenSSL was compiled with '​no-shared'​ option, Zabbix binaries contain OpenSSL within themselves and can be copied to other machines that do not have OpenSSL. 
 + 
 +=== Compiling Zabbix with LibreSSL === 
 + 
 +The process is similar to compiling with OpenSSL, but you need to make small changes in files located in the ''​build\win32\project''​ directory:​ 
 +    * In ''​Makefile_tls''​ delete ''/​DHAVE_OPENSSL_WITH_PSK''​. i.e. find <​code>​ 
 +CFLAGS = $(CFLAGS) /​DHAVE_OPENSSL /​DHAVE_OPENSSL_WITH_PSK</​code>​and replace it with <​code>​ 
 +CFLAGS = $(CFLAGS) /​DHAVE_OPENSSL</​code>​ 
 +    * In ''​Makefile_common.inc''​ add ''/​NODEFAULTLIB:​LIBCMT''​ i.e. find <​code>​ 
 +/​MANIFESTUAC:"​level='​asInvoker'​ uiAccess='​false'"​ /​DYNAMICBASE:​NO /​PDB:​$(TARGETDIR)\$(TARGETNAME).pdb</​code>​and replace it with <​code>​ 
 +/​MANIFESTUAC:"​level='​asInvoker'​ uiAccess='​false'"​ /​DYNAMICBASE:​NO /​PDB:​$(TARGETDIR)\$(TARGETNAME).pdb /​NODEFAULTLIB:​LIBCMT</​code>​