Zabbix Monitoring Windows Deployment Installation
Zabbix Agent installs the deployment on Windows
(1) manual installation of Zabbix Agent client
1. Download and unzip
Address: Http://www.zabbix.com/downloads
Decompression Zabbix_agents_x.x.x.win.zip
Conf directory is the agent configuration file bin file that holds Windows 32-bit and 64-bit installers
2. Configuration and Installation
2.1 Configure the Zabbix agent-related configuration.
Locate the configuration file under Conf zabbix_agentd.win.conf, modify the logfile, Server, hostname three parameters (other parameters can be added according to individual needs), the following configuration:
Logfile=c:\zabbix_agentd.log #根据个人习惯配置log存放的路径
server=192.98.8.224 #zabbix服务器的IP地址
hostname=f523540. #hostname的标识需要和服务器配置的一致, otherwise errors such as not found hostname will appear later
serveractive=192.98.8.224 #zabbix Server Address
Where logfile is the Zabbix log storage address. Server is the IP address of the Zabbix service side. Hostname is the native machine name.
2.2 Installing the Agent
Under Windows Console, execute the following command:
E:\zabbix\bin\win32\zabbix_agentd.exe-c E:\zabbix\conf\zabbix_agentd.win.conf–i
2.3 Starting the Agent client
The start command is as follows:
E:\zabbix\bin\win32\zabbix_agentd.exe-c E:\zabbix\conf\zabbix_agentd.win.conf–s
Parameter meaning:
-C Make configuration file location
-I is the installation client
-S Start client
-X Stop Client
-D Uninstalling the client
2.4 Enter "Services.msc" in "Run", find "zabbixagent" in it, and start the service.
The details of the batch process are as follows:
:: One-click installation of Zabbix Agent, theory support for all Windows systems
:: 1, modify the Zabbix_server variable in this script
:: 2, execute this script, automatically install Zabbix agent to C drive
@Echo off
Setlocal enabledelayedexpansion
:: Need to modify IP
Set zabbix_server=192.168.20.211
:: Replace the server IP in the configuration file
Set conf_file=%~dp0\zabbix_agents.win\conf\zabbix_agentd.win.conf
for/f "delims="%%a in (' Type '%conf_file% "') Do (
Set Str=%%a
Set "str=!str:127.0.0.1=%zabbix_server%!"
echo!str!>> "%conf_file%" _tmp.txt
)
Move "%conf_file%" "%conf_file%" _bak.txt
Move "%conf_file%" _tmp.txt "%conf_file%"
:: + or-bit process detection
IF "%processor_architecture%%processor_architew6432%" = = "x86" (
Set _processor_architecture=32bit
Goto x86
) ELSE (
Set _processor_architecture=64bit
Goto x64
)
: x86
xcopy "%~dp0\zabbix_agents.win\bin\win32" c:\zabbix_x86/e/i/y
Copy "%conf_file%" c:\zabbix_x86\zabbix_agentd.conf/y
sc stop "Zabbix Agent" >nul 2>nul
SC delete "Zabbix Agent" >nul 2>nul
C:\zabbix_x86\zabbix_agentd.exe-c C:\zabbix_x86\zabbix_agentd.conf-i
C:\zabbix_x86\zabbix_agentd.exe-c c:\zabbix_x86\zabbix_agentd.conf-s
Goto Firewall
: x64
xcopy "%~dp0\zabbix_agents_2.2.9.win\bin\win64" c:\zabbix_x64/e/i/y
Copy "%conf_file%" c:\zabbix_x64\zabbix_agentd.conf/y
sc stop "Zabbix Agent" >nul 2>nul
SC delete "Zabbix Agent" >nul 2>nul
C:\zabbix_x64\zabbix_agentd.exe-c C:\zabbix_x64\zabbix_agentd.conf-i
C:\zabbix_x64\zabbix_agentd.exe-c c:\zabbix_x64\zabbix_agentd.conf-s
Goto Firewall
: Firewall
:: Get Windows Version numbers
For/f "tokens=2 delims=[]"%%g in (' ver ') do (set _version=%%g)
for/f "tokens=2,3,4 delims=."%%g in (' Echo-%_version% ') do (set _major=%%g& set _minor=%%h& set _build=%%i)
Echo Major Version:%_major% Minor version:%_minor%.%_build%
:: OS Detection
IF "%_major%" = = "5" (
IF "%_minor%" = = "0" Echo OS details:windows [%_processor_architecture%]
IF "%_minor%" = = "1" Echo OS details:windows XP [%_processor_architecture%]
If "%_minor%" = = "2" if "%_processor_architecture%" = = "32bit" Echo OS details:windows 2003 [%_processor_architecture%]
If "%_minor%" = = "2" if "%_processor_architecture%" = = "64bit" Echo OS details:windows 2003 or XP [%_processor_archite Cture%]
:: Open firewall 10050 port
netsh firewall delete portopening protocol=tcp port=10050
netsh firewall add portopening protocol=tcp port=10050 name=zabbix_10050 mode=enable scope=custom addresses=%zabbix_ server%
ELSE IF "%_major%" = = "6" (
IF "%_minor%" = = "0" Echo OS details:windows Vista or Windows [%_processor_architecture%]
IF "%_minor%" = = "1" Echo OS details:windows 7 or Windows R2 [%_processor_architecture%]
IF "%_minor%" = = "2" Echo OS details:windows 8 or Windows Server [%_processor_architecture%]
IF "%_minor%" = = "3" Echo OS details:windows 8.1 or Windows Server R2 [%_processor_architecture%]
IF "%_minor%" = = "4" Echo OS details:windows Technical Preview [%_processor_architecture%]
:: Open firewall 10050 port
netsh advfirewall firewall delete rule name= "zabbix_10050"
netsh advfirewall firewall add rule name= "zabbix_10050" protocol=tcp dir=in localport=10050 action=allow remoteip=% zabbix_server%
)
Pause
RD/S/q "%~dp0\zabbix_agents_2.2.9.win"
Del%0
Zabbix Agent Installation and configuration Chapter