Windows on one click to install zabbix-agent automatically

Source: Internet
Author: User

First, Introduction

Zabbix is a popular monitoring program in the open source World, C/S architecture, running a variety of system platform installation, the personal view of the Windows platform Zabbix-agent installation is the most cumbersome, UNIX and Linux platform through the automated maintenance tools can be installed remotely, and Windows does not have a good way, so I wrote a script on the Web (including Zabbix-agent 2.4.5 client), one-click installation and configuration of the firewall.


Ii. installation Scripts (configuration files)

Please first modify the script in Zabbbix_server for your own Zabbix server IP

@Echo  offsetlocal enabledelayedexpansion::  need to modify IP (fill in your Zabbix server IP address) set zabbix_server= 10.168.118.91::  replacing Server ipset conf_file=%~dp0\zabbix_agents_2.4.4.win\conf\zabbix_ in a configuration file agentd.win.conffor /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.txtmove  "%conf_file%" _tmp.txt  "%conf_file%":: 32 bit or 64 bit  process detectionif  "%processor_architecture%%processor_architew6432%" = = "x86"   (  set  _processor_architecture=32bit  goto x86)  ELSE  (  set _processor_ architecture=64bit  goto x64):x86xcopy  "%~dp0\zabbix_agents_2.4.4.win\bin\win32"  c:\ zabbix_x86 /e /i /ycopy  "%conf_file%"  c:\zabbix_x86\zabbix_agentd.conf /ysc stop   "Zabbix agent"  >nul 2> nulsc delete   "Zabbix agent"  >nul 2>nulc:\zabbix_x86\zabbix_agentd.exe  -c c:\zabbix_x86\zabbix_agentd.conf -ic:\zabbix_x86\zabbix_agentd.exe -c c:\zabbix_ x86\zabbix_agentd.conf -sgoto firewall:x64xcopy  "%~dp0\zabbix_agents_2.4.4.win\bin\win64"   c:\zabbix_x64 /e /i /ycopy  "%conf_file%"  C:\ZABBIX_X64\ZABBIX_AGENTD.CONF /YSC  stop   "Zabbix agent"  >nul 2>nulsc delete   "zabbix  Agent " >nul 2>nulc:\zabbix_x64\zabbix_agentd.exe -c c:\zabbix_x64\zabbix_agentd.conf  -ic:\zabbix_x64\zabbix_agentd.exe -c c:\zabbix_x64\zabbix_agentd.conf -sgoto  firewall:firewall:: get windows version numbersfor /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 detectionif  "%_major%" = = "5"   (  IF  "%_minor%" = = "0"  echo  OS details: Windows 2000 [%_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 64  Bit [%_processor_architecture%]  ::  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 2008 [%_processor_architecture%]  if   "%_minor%" = = "1"  Echo OS details: Windows 7 or Windows 2008  r2 [%_processor_architecture%]  if  "%_minor%" = = "2"  Echo OS details:  windows 8 or windows server 2012 [%_processor_architecture%]  if  "%_minor%" = = "3"  Echo OS details: Windows 8.1 or Windows Server  2012 r2 [%_processor_architecture%]  if  "%_minor%" = = "4"  echo os details: windows 10  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%) pauserd /s /q  "%~dp0\zabbix_ Agents_2.4.4.win "del %0

Three, installation package and installation instructions

installation package name Zabbix_agents_auto_installer.win.zip See attachment

The installation package contains 32 and 64-bit zabbix-agent and a copy of the configuration file, as well as an automatic installation script.

After extracting it, find the Autoinstall.bat script tool and double click on it! The zabbix-agent is automatically registered as a system service and runs, adding 10050 passive ports.

This article is from the "end of the school" blog, please be sure to keep this source http://dyc2005.blog.51cto.com/270872/1942149

Windows on one click to install zabbix-agent automatically

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.