欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

windows上一鍵自動(dòng)安裝zabbix-agent

一、簡(jiǎn)介

專注于為中小企業(yè)提供成都網(wǎng)站設(shè)計(jì)、成都網(wǎng)站建設(shè)服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)東洲免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動(dòng)了超過千家企業(yè)的穩(wěn)健成長,幫助中小企業(yè)通過網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。

       zabbix是開源界流行的監(jiān)控程序,C/S架構(gòu),運(yùn)行多種系統(tǒng)平臺(tái)安裝,個(gè)人認(rèn)為windows平臺(tái)的 zabbix-agent安裝最為煩瑣,unix及l(fā)inux平臺(tái)通過自動(dòng)化運(yùn)維工具可一鍵遠(yuǎn)程安裝,而windows目前沒有好的方法,所以就參考網(wǎng)上寫了一個(gè)腳本(包含zabbix-agent 2.4.5客戶端),一鍵安裝并配置好防火墻。

二、安裝腳本(配置文件)

請(qǐng)先修改腳本中zabbbix_server 為自己的zabbix服務(wù)器ip

@Echo off
setlocal enabledelayedexpansion
:: 需要修改IP(填寫自己zabbix服務(wù)器IP地址)
set zabbix_server=10.168.118.91
:: 替換配置文件中的server ip
set conf_file=%~dp0\zabbix_agents_2.4.4.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%"
:: 32 bit or 64 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_2.4.4.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.4.4.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 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%]
  :: 開啟防火墻10050端口
  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%]
  :: 開啟防火墻10050端口
  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.4.4.win"
del %0

三、安裝包及安裝說明

安裝包名zabbix_agents_auto_installer.win.zip 見附件

安裝包中包含32和64位zabbix-agent和一份配置文件,以及自動(dòng)安裝腳本。

解壓出來后找到AutoInstall.bat 腳本工具,雙擊就可以!會(huì)自動(dòng)把zabbix-agent注冊(cè)為系統(tǒng)服務(wù)并運(yùn)行,添加10050被動(dòng)端口。

附件:http://down.51cto.com/data/2366792

分享文章:windows上一鍵自動(dòng)安裝zabbix-agent
網(wǎng)址分享:http://chinadenli.net/article0/jehpio.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信公眾號(hào)、App設(shè)計(jì)、網(wǎng)站策劃網(wǎng)頁設(shè)計(jì)公司、品牌網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì)公司

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都seo排名網(wǎng)站優(yōu)化