CRLF statt LF
This commit is contained in:
parent
d033039b6b
commit
9bca6d82ca
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
# Immer crLF statt LF verwenden:
|
||||
text eol=crlf
|
@ -1,18 +1,18 @@
|
||||
# Sample File for include own Config-File with UserParamter
|
||||
#
|
||||
# Rename this file to: zabbix_agentd.win.include.txt
|
||||
# before using!
|
||||
# Installation Script check if file "include\zabbix_agentd.win.include.txt" exist
|
||||
# and will copy that script and include it
|
||||
# If you need own Scripts or Programs copy them into the
|
||||
# \UserParameter
|
||||
# Directory
|
||||
# Use
|
||||
# "%PROGRAMFILES%\Zabbix\YoorScriptorExe.bat" at UserParameter
|
||||
# Complex Sample:
|
||||
# UserParameter=znil.fileandfolder[*],"%PROGRAMFILES%\Zabbix\fileandfolder.exe" "$1" "$2"
|
||||
#
|
||||
#Simple Sample
|
||||
UserParameter=znil.TestEcho,echo 1
|
||||
|
||||
# Your UserParameters behind this line:
|
||||
# Sample File for include own Config-File with UserParamter
|
||||
#
|
||||
# Rename this file to: zabbix_agentd.win.include.txt
|
||||
# before using!
|
||||
# Installation Script check if file "include\zabbix_agentd.win.include.txt" exist
|
||||
# and will copy that script and include it
|
||||
# If you need own Scripts or Programs copy them into the
|
||||
# \UserParameter
|
||||
# Directory
|
||||
# Use
|
||||
# "%PROGRAMFILES%\Zabbix\YoorScriptorExe.bat" at UserParameter
|
||||
# Complex Sample:
|
||||
# UserParameter=znil.fileandfolder[*],"%PROGRAMFILES%\Zabbix\fileandfolder.exe" "$1" "$2"
|
||||
#
|
||||
#Simple Sample
|
||||
UserParameter=znil.TestEcho,echo 1
|
||||
|
||||
# Your UserParameters behind this line:
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,210 +1,210 @@
|
||||
@echo off
|
||||
REM 2015 Bernhard Linz / Bernhard.Linz@datagroup.de / Bernhard@znil.de
|
||||
REM Script for Installing Zabbix-Agent on Windows System via GPO,
|
||||
REM take a look at: http://znil.net/index.php?title=Zabbix_Agent_per_Gruppenrichtlinie_installieren_lassen
|
||||
@echo off
|
||||
cls
|
||||
Echo +---------------------------------------------------------+
|
||||
Echo ^| Starting Script InstallZabbixAgentGPO ^|
|
||||
Echo +---------------------------------------------------------+
|
||||
Echo.
|
||||
REM Globale Variables
|
||||
Set GPO_INSTALL_AGENT=FALSE
|
||||
Set GPO_COMPUTERNAME=%COMPUTERNAME% x
|
||||
Set GPO_COMPUTERNAME=%GPO_COMPUTERNAME:~0,15%
|
||||
REM Loading Configuration for GPO-Installer
|
||||
Set GPO_CURPATH=%~dp0
|
||||
If EXIST "%GPO_CURPATH%\InstallZabbixAgentGPO\ConfigGPO.bat" (
|
||||
CALL "%GPO_CURPATH%\InstallZabbixAgentGPO\ConfigGPO.bat"
|
||||
) else (
|
||||
echo Missing "%GPO_CURPATH%\InstallZabbixAgentGPO\ConfigGPO.bat" !!!!
|
||||
GoTo END
|
||||
)
|
||||
If EXIST "%GPO_CURPATH%Config.bat" (
|
||||
CALL "%GPO_CURPATH%Config.bat"
|
||||
) else (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - ERROR - %DATE% - %TIME%: %GPO_CURPATH%Config.bat not found >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
echo Missing "%GPO_CURPATH%Config.bat (for InstallZabbixAgent.bat)" !!!!
|
||||
GoTo END
|
||||
)
|
||||
|
||||
REM ###### ## ## ######## ###### ## ## ######
|
||||
REM ## ## ## ## ## ## ## ## ## ## ##
|
||||
REM ## ## ## ## ## ## ## ##
|
||||
REM ####### ####### ## ######### ###### ## ##### ###### ####### #######
|
||||
REM ## ## ## ## ## ## ## ##
|
||||
REM ## ## ## ## ## ## ## ## ## ## ##
|
||||
REM ###### ## ## ######## ###### ## ## ######
|
||||
|
||||
REM Make a test if Zabbix-Agent is already installed
|
||||
sc query "Zabbix Agent" >nul 2>&1
|
||||
If NOT ERRORLEVEL 1 (
|
||||
Echo Zabbix-Agent already installed - Install Agent DENIED - Exit Script
|
||||
GoTo END
|
||||
) Else (
|
||||
Echo Missing Zabbix-Agent Configuration-File - Install Agent ALLOWED
|
||||
Set GPO_INSTALL_AGENT=TRUE
|
||||
)
|
||||
|
||||
|
||||
|
||||
REM Show used Configuration
|
||||
Echo.
|
||||
Echo Using following Settings:
|
||||
Echo -------------------------
|
||||
Set GPO_
|
||||
|
||||
REM Make the "Server or Workstation Check
|
||||
Echo.
|
||||
Echo Check OS for Server or Workstation
|
||||
For /f "tokens=*" %%i in ('wmic os get caption ^| findstr /I "Windows"') do (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
If "%GPO_LOG_POSITIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - INFO - %DATE% - %TIME%: OS-Type: %%i >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
) else (
|
||||
If "%GPO_LOG_NEGATIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - INFO - %DATE% - %TIME%: OS-Type: %%i >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
wmic os get caption | findstr /I "Server"
|
||||
If ERRORLEVEL 1 (
|
||||
Echo %COMPUTERNAME% is a Windows Workstation
|
||||
If "%GPO_INSTALL_WORKSTATION%" == "YES" (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
If "%GPO_LOG_POSITIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - SUCCESS - %DATE% - %TIME%: Type WORKSTATION ALLOWED >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
)
|
||||
Set GPO_INSTALL_AGENT=TRUE
|
||||
Echo GPO_INSTALL_WORKSTATION is YES - Install Agent ALLOWED
|
||||
) else (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
If "%GPO_LOG_NEGATIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - ERROR - %DATE% - %TIME%: Type WORKSTATION not ALLOWED >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
)
|
||||
Echo GPO_INSTALL_WORKSTATION is NO - Install Agent DENIED - Exit Script
|
||||
GoTo END
|
||||
)
|
||||
)else (
|
||||
Echo %COMPUTERNAME% is a Windows Server
|
||||
If "%GPO_INSTALL_SERVER%" == "YES" (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
If "%GPO_LOG_POSITIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - SUCCESS - %DATE% - %TIME%: Type SERVER ALLOWED >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
)
|
||||
Set GPO_INSTALL_AGENT=TRUE
|
||||
Echo GPO_INSTALL_SERVER is YES - Install Agent ALLOWED
|
||||
) else (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
If "%GPO_LOG_NEGATIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - ERROR - %DATE% - %TIME%: Type SERVER not ALLOWED >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
)
|
||||
Echo GPO_INSTALL_SERVER is NO - Install Agent DENIED - Exit Script
|
||||
GoTo END
|
||||
)
|
||||
)
|
||||
|
||||
REM Start the Whitelist Check
|
||||
If "%GPO_USE_WHITELIST%" == "YES" (
|
||||
Echo.
|
||||
Echo Check if %COMPUTERNAME% is whitelisted ...
|
||||
If EXIST "%GPO_CURPATH%InstallZabbixAgentGPO\Whitelist.txt" (
|
||||
findstr /I /B /E "%COMPUTERNAME%" "%GPO_CURPATH%InstallZabbixAgentGPO\Whitelist.txt"
|
||||
If ERRORLEVEL 1 (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
If "%GPO_LOG_NEGATIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - ERROR - %DATE% - %TIME%: Name not in Whitelist.txt >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
)
|
||||
Echo %COMPUTERNAME% is NOT listet at "%GPO_CURPATH%InstallZabbixAgentGPO\Whitelist.txt"
|
||||
Echo Install Agent DENIED - Exit Script
|
||||
GoTo END
|
||||
) else (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
If "%GPO_LOG_POSITIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - SUCCESS - %DATE% - %TIME%: Name is in Whitelist.txt >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
)
|
||||
Set GPO_INSTALL_AGENT=TRUE
|
||||
Echo %COMPUTERNAME% is listet at "%GPO_CURPATH%InstallZabbixAgentGPO\Whitelist.txt"
|
||||
Echo Install Agent ALLOWED
|
||||
)
|
||||
) else (
|
||||
Echo Missing "%GPO_CURPATH%InstallZabbixAgentGPO\Whitelist.txt"
|
||||
GoTo END
|
||||
)
|
||||
)
|
||||
|
||||
REM Start the Blacklist Check
|
||||
If "%GPO_USE_BLACKLIST%" == "YES" (
|
||||
Echo.
|
||||
Echo Check if %COMPUTERNAME% is blacklisted ...
|
||||
If EXIST "%GPO_CURPATH%InstallZabbixAgentGPO\Blacklist.txt" (
|
||||
findstr /I /B /E "%COMPUTERNAME%" "%GPO_CURPATH%InstallZabbixAgentGPO\Blacklist.txt"
|
||||
If ERRORLEVEL 1 (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
If "%GPO_LOG_POSITIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - SUCCESS - %DATE% - %TIME%: Name is NOT in Blacklist.txt >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
)
|
||||
Set GPO_INSTALL_AGENT=TRUE
|
||||
Echo %COMPUTERNAME% is NOT listet at "%GPO_CURPATH%InstallZabbixAgentGPO\Blacklist.txt"
|
||||
Echo Install Agent ALLOWED
|
||||
) else (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
If "%GPO_LOG_NEGATIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - ERROR - %DATE% - %TIME%: Name is in Blacklist.txt >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
)
|
||||
Echo %COMPUTERNAME% is listet at "%GPO_CURPATH%InstallZabbixAgentGPO\Blacklist.txt"
|
||||
Echo Install Agent DENIED - Exit Script
|
||||
GoTo END
|
||||
)
|
||||
) else (
|
||||
Echo Missing "%GPO_CURPATH%InstallZabbixAgentGPO\Blacklist.txt"
|
||||
GoTo END
|
||||
)
|
||||
)
|
||||
|
||||
REM #### ## ## ###### ######## ### ## ##
|
||||
REM ## ### ## ## ## ## ## ## ## ##
|
||||
REM ## #### ## ## ## ## ## ## ##
|
||||
REM ####### ####### ## ## ## ## ###### ## ## ## ## ## ####### #######
|
||||
REM ## ## #### ## ## ######### ## ##
|
||||
REM ## ## ### ## ## ## ## ## ## ##
|
||||
REM #### ## ## ###### ## ## ## ######## ########
|
||||
|
||||
REM Call the Installation Script
|
||||
Echo.
|
||||
Echo Start Agent-Installation ...
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - INSTALL - %DATE% - %TIME%: Start Installation: %GPO_INSTALLER% >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
If "%GPO_LOGGING_PER_HOST%" == "YES" (
|
||||
%GPO_INSTALLER% > %GPO_LOGGING_PATH%\%COMPUTERNAME%.LOG
|
||||
) else (
|
||||
%GPO_INSTALLER%
|
||||
)
|
||||
GoTo END
|
||||
|
||||
REM ######## ## ## ########
|
||||
REM ## ### ## ## ##
|
||||
REM ## #### ## ## ##
|
||||
REM ####### ####### ###### ## ## ## ## ## ####### #######
|
||||
REM ## ## #### ## ##
|
||||
REM ## ## ### ## ##
|
||||
REM ######## ## ## ########
|
||||
:END
|
||||
Echo.
|
||||
Echo +---------------------------------------------------------+
|
||||
Echo ^| Stopping Script InstallZabbixAgentGPO ^|
|
||||
Echo +---------------------------------------------------------+
|
||||
REM exit 0
|
||||
@echo off
|
||||
REM 2015 Bernhard Linz / Bernhard.Linz@datagroup.de / Bernhard@znil.de
|
||||
REM Script for Installing Zabbix-Agent on Windows System via GPO,
|
||||
REM take a look at: http://znil.net/index.php?title=Zabbix_Agent_per_Gruppenrichtlinie_installieren_lassen
|
||||
@echo off
|
||||
cls
|
||||
Echo +---------------------------------------------------------+
|
||||
Echo ^| Starting Script InstallZabbixAgentGPO ^|
|
||||
Echo +---------------------------------------------------------+
|
||||
Echo.
|
||||
REM Globale Variables
|
||||
Set GPO_INSTALL_AGENT=FALSE
|
||||
Set GPO_COMPUTERNAME=%COMPUTERNAME% x
|
||||
Set GPO_COMPUTERNAME=%GPO_COMPUTERNAME:~0,15%
|
||||
REM Loading Configuration for GPO-Installer
|
||||
Set GPO_CURPATH=%~dp0
|
||||
If EXIST "%GPO_CURPATH%\InstallZabbixAgentGPO\ConfigGPO.bat" (
|
||||
CALL "%GPO_CURPATH%\InstallZabbixAgentGPO\ConfigGPO.bat"
|
||||
) else (
|
||||
echo Missing "%GPO_CURPATH%\InstallZabbixAgentGPO\ConfigGPO.bat" !!!!
|
||||
GoTo END
|
||||
)
|
||||
If EXIST "%GPO_CURPATH%Config.bat" (
|
||||
CALL "%GPO_CURPATH%Config.bat"
|
||||
) else (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - ERROR - %DATE% - %TIME%: %GPO_CURPATH%Config.bat not found >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
echo Missing "%GPO_CURPATH%Config.bat (for InstallZabbixAgent.bat)" !!!!
|
||||
GoTo END
|
||||
)
|
||||
|
||||
REM ###### ## ## ######## ###### ## ## ######
|
||||
REM ## ## ## ## ## ## ## ## ## ## ##
|
||||
REM ## ## ## ## ## ## ## ##
|
||||
REM ####### ####### ## ######### ###### ## ##### ###### ####### #######
|
||||
REM ## ## ## ## ## ## ## ##
|
||||
REM ## ## ## ## ## ## ## ## ## ## ##
|
||||
REM ###### ## ## ######## ###### ## ## ######
|
||||
|
||||
REM Make a test if Zabbix-Agent is already installed
|
||||
sc query "Zabbix Agent" >nul 2>&1
|
||||
If NOT ERRORLEVEL 1 (
|
||||
Echo Zabbix-Agent already installed - Install Agent DENIED - Exit Script
|
||||
GoTo END
|
||||
) Else (
|
||||
Echo Missing Zabbix-Agent Configuration-File - Install Agent ALLOWED
|
||||
Set GPO_INSTALL_AGENT=TRUE
|
||||
)
|
||||
|
||||
|
||||
|
||||
REM Show used Configuration
|
||||
Echo.
|
||||
Echo Using following Settings:
|
||||
Echo -------------------------
|
||||
Set GPO_
|
||||
|
||||
REM Make the "Server or Workstation Check
|
||||
Echo.
|
||||
Echo Check OS for Server or Workstation
|
||||
For /f "tokens=*" %%i in ('wmic os get caption ^| findstr /I "Windows"') do (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
If "%GPO_LOG_POSITIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - INFO - %DATE% - %TIME%: OS-Type: %%i >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
) else (
|
||||
If "%GPO_LOG_NEGATIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - INFO - %DATE% - %TIME%: OS-Type: %%i >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
wmic os get caption | findstr /I "Server"
|
||||
If ERRORLEVEL 1 (
|
||||
Echo %COMPUTERNAME% is a Windows Workstation
|
||||
If "%GPO_INSTALL_WORKSTATION%" == "YES" (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
If "%GPO_LOG_POSITIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - SUCCESS - %DATE% - %TIME%: Type WORKSTATION ALLOWED >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
)
|
||||
Set GPO_INSTALL_AGENT=TRUE
|
||||
Echo GPO_INSTALL_WORKSTATION is YES - Install Agent ALLOWED
|
||||
) else (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
If "%GPO_LOG_NEGATIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - ERROR - %DATE% - %TIME%: Type WORKSTATION not ALLOWED >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
)
|
||||
Echo GPO_INSTALL_WORKSTATION is NO - Install Agent DENIED - Exit Script
|
||||
GoTo END
|
||||
)
|
||||
)else (
|
||||
Echo %COMPUTERNAME% is a Windows Server
|
||||
If "%GPO_INSTALL_SERVER%" == "YES" (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
If "%GPO_LOG_POSITIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - SUCCESS - %DATE% - %TIME%: Type SERVER ALLOWED >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
)
|
||||
Set GPO_INSTALL_AGENT=TRUE
|
||||
Echo GPO_INSTALL_SERVER is YES - Install Agent ALLOWED
|
||||
) else (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
If "%GPO_LOG_NEGATIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - ERROR - %DATE% - %TIME%: Type SERVER not ALLOWED >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
)
|
||||
Echo GPO_INSTALL_SERVER is NO - Install Agent DENIED - Exit Script
|
||||
GoTo END
|
||||
)
|
||||
)
|
||||
|
||||
REM Start the Whitelist Check
|
||||
If "%GPO_USE_WHITELIST%" == "YES" (
|
||||
Echo.
|
||||
Echo Check if %COMPUTERNAME% is whitelisted ...
|
||||
If EXIST "%GPO_CURPATH%InstallZabbixAgentGPO\Whitelist.txt" (
|
||||
findstr /I /B /E "%COMPUTERNAME%" "%GPO_CURPATH%InstallZabbixAgentGPO\Whitelist.txt"
|
||||
If ERRORLEVEL 1 (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
If "%GPO_LOG_NEGATIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - ERROR - %DATE% - %TIME%: Name not in Whitelist.txt >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
)
|
||||
Echo %COMPUTERNAME% is NOT listet at "%GPO_CURPATH%InstallZabbixAgentGPO\Whitelist.txt"
|
||||
Echo Install Agent DENIED - Exit Script
|
||||
GoTo END
|
||||
) else (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
If "%GPO_LOG_POSITIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - SUCCESS - %DATE% - %TIME%: Name is in Whitelist.txt >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
)
|
||||
Set GPO_INSTALL_AGENT=TRUE
|
||||
Echo %COMPUTERNAME% is listet at "%GPO_CURPATH%InstallZabbixAgentGPO\Whitelist.txt"
|
||||
Echo Install Agent ALLOWED
|
||||
)
|
||||
) else (
|
||||
Echo Missing "%GPO_CURPATH%InstallZabbixAgentGPO\Whitelist.txt"
|
||||
GoTo END
|
||||
)
|
||||
)
|
||||
|
||||
REM Start the Blacklist Check
|
||||
If "%GPO_USE_BLACKLIST%" == "YES" (
|
||||
Echo.
|
||||
Echo Check if %COMPUTERNAME% is blacklisted ...
|
||||
If EXIST "%GPO_CURPATH%InstallZabbixAgentGPO\Blacklist.txt" (
|
||||
findstr /I /B /E "%COMPUTERNAME%" "%GPO_CURPATH%InstallZabbixAgentGPO\Blacklist.txt"
|
||||
If ERRORLEVEL 1 (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
If "%GPO_LOG_POSITIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - SUCCESS - %DATE% - %TIME%: Name is NOT in Blacklist.txt >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
)
|
||||
Set GPO_INSTALL_AGENT=TRUE
|
||||
Echo %COMPUTERNAME% is NOT listet at "%GPO_CURPATH%InstallZabbixAgentGPO\Blacklist.txt"
|
||||
Echo Install Agent ALLOWED
|
||||
) else (
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
If "%GPO_LOG_NEGATIVE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - ERROR - %DATE% - %TIME%: Name is in Blacklist.txt >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
)
|
||||
Echo %COMPUTERNAME% is listet at "%GPO_CURPATH%InstallZabbixAgentGPO\Blacklist.txt"
|
||||
Echo Install Agent DENIED - Exit Script
|
||||
GoTo END
|
||||
)
|
||||
) else (
|
||||
Echo Missing "%GPO_CURPATH%InstallZabbixAgentGPO\Blacklist.txt"
|
||||
GoTo END
|
||||
)
|
||||
)
|
||||
|
||||
REM #### ## ## ###### ######## ### ## ##
|
||||
REM ## ### ## ## ## ## ## ## ## ##
|
||||
REM ## #### ## ## ## ## ## ## ##
|
||||
REM ####### ####### ## ## ## ## ###### ## ## ## ## ## ####### #######
|
||||
REM ## ## #### ## ## ######### ## ##
|
||||
REM ## ## ### ## ## ## ## ## ## ##
|
||||
REM #### ## ## ###### ## ## ## ######## ########
|
||||
|
||||
REM Call the Installation Script
|
||||
Echo.
|
||||
Echo Start Agent-Installation ...
|
||||
If "%GPO_LOGGING_ENABLE%" == "YES" (
|
||||
Echo %GPO_COMPUTERNAME% - INSTALL - %DATE% - %TIME%: Start Installation: %GPO_INSTALLER% >>%GPO_LOGGING_GLOBAL_LOG_FILE%
|
||||
)
|
||||
If "%GPO_LOGGING_PER_HOST%" == "YES" (
|
||||
%GPO_INSTALLER% > %GPO_LOGGING_PATH%\%COMPUTERNAME%.LOG
|
||||
) else (
|
||||
%GPO_INSTALLER%
|
||||
)
|
||||
GoTo END
|
||||
|
||||
REM ######## ## ## ########
|
||||
REM ## ### ## ## ##
|
||||
REM ## #### ## ## ##
|
||||
REM ####### ####### ###### ## ## ## ## ## ####### #######
|
||||
REM ## ## #### ## ##
|
||||
REM ## ## ### ## ##
|
||||
REM ######## ## ## ########
|
||||
:END
|
||||
Echo.
|
||||
Echo +---------------------------------------------------------+
|
||||
Echo ^| Stopping Script InstallZabbixAgentGPO ^|
|
||||
Echo +---------------------------------------------------------+
|
||||
REM exit 0
|
||||
REM PAUSE
|
@ -1,6 +1,6 @@
|
||||
*************************
|
||||
*** B L A C K L I S T ***
|
||||
*************************
|
||||
One Computername per Line (NetBIOS Computername)
|
||||
------------------------------------------------
|
||||
|
||||
*************************
|
||||
*** B L A C K L I S T ***
|
||||
*************************
|
||||
One Computername per Line (NetBIOS Computername)
|
||||
------------------------------------------------
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
*************************
|
||||
*** W H I T E L I S T ***
|
||||
*************************
|
||||
One Computername per Line (NetBIOS Computername)
|
||||
*************************
|
||||
*** W H I T E L I S T ***
|
||||
*************************
|
||||
One Computername per Line (NetBIOS Computername)
|
||||
------------------------------------------------
|
@ -1,30 +1,30 @@
|
||||
@echo off
|
||||
REM *** Configuration for Installing Zabbix-Agent via Group Policies ***
|
||||
REM Please use always YES or NO for switching Options
|
||||
REM -----------------------------------------------------------------
|
||||
REM Path and Name of InstallZabbixAgent.bat
|
||||
Set GPO_INSTALLER=\\10.20.30.40\Zabbix-Agent$\Agent\InstallZabbixAgent.bat
|
||||
REM Use Whitlist.txt - install only if %COMPUTERNAME% is listet in Whitelist
|
||||
Set GPO_USE_WHITELIST=NO
|
||||
REM Use Blacklist.txt - install only if %COMPUTERNAME% is NOT listet in Blacklist
|
||||
Set GPO_USE_BLACKLIST=YES
|
||||
REM Filter for different Operation Systems
|
||||
Set GPO_INSTALL_WORKSTATION=NO
|
||||
Set GPO_INSTALL_SERVER=YES
|
||||
REM -----------------------------------------------------------------
|
||||
REM Logging of Setup
|
||||
Set GPO_LOGGING_ENABLE=YES
|
||||
Set GPO_LOGGING_GLOBAL_LOG_FILE=\\\10.20.30.40\Zabbix-Agent$\Logs\_GlobalLogFile.txt
|
||||
Set GPO_LOGGING_PER_HOST=YES
|
||||
Set GPO_LOGGING_PATH=\\10.20.30.40\Zabbix-Agent$\Logs
|
||||
Set GPO_LOG_POSITIVE=YES
|
||||
Set GPO_LOG_NEGATIVE=YES
|
||||
REM -----------------------------------------------------------------
|
||||
REM for later use
|
||||
REM Set GPO_INSTALL_XP=NO
|
||||
REM Set GPO_INSTALL_7=NO
|
||||
REM Set GPO_INSTALL_8=NO
|
||||
REM Set GPO_INSTALL_Vista=NO
|
||||
REM Set GPO_INSTALL_2003=YES
|
||||
REM Set GPO_INSTALL_2008=YES
|
||||
REM Set GPO_INSTALL_2012=YES
|
||||
@echo off
|
||||
REM *** Configuration for Installing Zabbix-Agent via Group Policies ***
|
||||
REM Please use always YES or NO for switching Options
|
||||
REM -----------------------------------------------------------------
|
||||
REM Path and Name of InstallZabbixAgent.bat
|
||||
Set GPO_INSTALLER=\\10.20.30.40\Zabbix-Agent$\Agent\InstallZabbixAgent.bat
|
||||
REM Use Whitlist.txt - install only if %COMPUTERNAME% is listet in Whitelist
|
||||
Set GPO_USE_WHITELIST=NO
|
||||
REM Use Blacklist.txt - install only if %COMPUTERNAME% is NOT listet in Blacklist
|
||||
Set GPO_USE_BLACKLIST=YES
|
||||
REM Filter for different Operation Systems
|
||||
Set GPO_INSTALL_WORKSTATION=NO
|
||||
Set GPO_INSTALL_SERVER=YES
|
||||
REM -----------------------------------------------------------------
|
||||
REM Logging of Setup
|
||||
Set GPO_LOGGING_ENABLE=YES
|
||||
Set GPO_LOGGING_GLOBAL_LOG_FILE=\\\10.20.30.40\Zabbix-Agent$\Logs\_GlobalLogFile.txt
|
||||
Set GPO_LOGGING_PER_HOST=YES
|
||||
Set GPO_LOGGING_PATH=\\10.20.30.40\Zabbix-Agent$\Logs
|
||||
Set GPO_LOG_POSITIVE=YES
|
||||
Set GPO_LOG_NEGATIVE=YES
|
||||
REM -----------------------------------------------------------------
|
||||
REM for later use
|
||||
REM Set GPO_INSTALL_XP=NO
|
||||
REM Set GPO_INSTALL_7=NO
|
||||
REM Set GPO_INSTALL_8=NO
|
||||
REM Set GPO_INSTALL_Vista=NO
|
||||
REM Set GPO_INSTALL_2003=YES
|
||||
REM Set GPO_INSTALL_2008=YES
|
||||
REM Set GPO_INSTALL_2012=YES
|
||||
|
@ -1,5 +1,5 @@
|
||||
ZabbixAgentAutoUpdater
|
||||
GoogleUpdateTaskMachine
|
||||
ZabbixExchange
|
||||
ZabbixWindowsUpdateCheck
|
||||
|
||||
ZabbixAgentAutoUpdater
|
||||
GoogleUpdateTaskMachine
|
||||
ZabbixExchange
|
||||
ZabbixWindowsUpdateCheck
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
cls
|
||||
WindowsMountPoints.exe
|
||||
echo.
|
||||
@echo off
|
||||
cls
|
||||
WindowsMountPoints.exe
|
||||
echo.
|
||||
pause
|
@ -1,8 +1,8 @@
|
||||
@echo off
|
||||
cls
|
||||
echo See available Windows Updates as single Number in next line - wait a moment!
|
||||
echo First time maybe 0 at zabbix!
|
||||
windowsupdates.exe CHEAT
|
||||
windowsupdates.exe
|
||||
echo.
|
||||
@echo off
|
||||
cls
|
||||
echo See available Windows Updates as single Number in next line - wait a moment!
|
||||
echo First time maybe 0 at zabbix!
|
||||
windowsupdates.exe CHEAT
|
||||
windowsupdates.exe
|
||||
echo.
|
||||
pause
|
124
config.bat
124
config.bat
@ -1,62 +1,62 @@
|
||||
@echo off
|
||||
REM *** Configure the Agent **************************************************
|
||||
REM DNS-Name or IP of the Zabbix-Server or Zabbix Proxy, separate more than one server with ,
|
||||
Set ZABBIXSERVER=zabbix.example.local
|
||||
REM the same before, only for active checks. If Empty, ZABBIXSERVER will be used
|
||||
Set ZABBIXSERVERACTIVE=
|
||||
REM Port of Zabbix Server, Default = 10051
|
||||
Set ZABBIXSERVERPORT=10051
|
||||
REM Hostname to use
|
||||
REM Set ZABBIXHOSTNAME=%COMPUTERNAME%
|
||||
REM Next Line works also with Hostnames longer than 15 Chars
|
||||
For /f %%i in ('hostname') do Set ZABBIXHOSTNAME=%%i
|
||||
REM Set next Entry to YES or NO. YES = add Computerdomain like .domain.local to Hostname
|
||||
Set USEDOMAINSUFFIX=YES
|
||||
REM If the Computer is in no domain, or the domain can not be determined, use the following suffix
|
||||
Set FALLBACKDOMAIN=example.local
|
||||
REM Zabbix Host ListenPort, Default = 10050 **********************************
|
||||
Set ZABBIXHOSTLISTENPORT=10050
|
||||
REM HostMetadata for Autodiscovery *******************************************
|
||||
REM Set a REM in front of the line if you did not use
|
||||
REM Only use at Version 2.2 or higher, not for 2.0.x
|
||||
Set ZABBIXHOSTMETADATA=WindowsServer
|
||||
REM ## Try some alternativ Tests for different Metadata **********************
|
||||
REM Set METADATATEST to YES if you want the following additional Tests
|
||||
Set METADATATEST=NO
|
||||
REM Alternativ Metadata if if this Server is a Citrix Terminalserver with XenApp 6.x or 7.x
|
||||
Set ZABBIXHOSTMETADATACITRIX=CitrixServer
|
||||
REM Alternativ Metadata if this Server is an Active Directory Domain Controller
|
||||
Set ZABBIXHOSTMETADATADC=DomainController
|
||||
REM Alternativ Metadata if this Server is an Exchange Mail Server
|
||||
Set ZABBIXHOSTMETADATAEXCHANGE=ExchangeServer
|
||||
REM Alternativ Metadata if this Server is an Microsoft SQL Server
|
||||
Set ZABBIXHOSTMETADATAMSSQL=MSSQLServer
|
||||
REM *************************************************************************
|
||||
REM Name of Config-File - Default zabbix_agentd.win.conf
|
||||
Set ZABBIXHOSTCONFIGFILE=zabbix_agentd.win.conf
|
||||
REM CleanUp Directory before Installing - delete ALL Files in the Installation
|
||||
REM Directory before installing new Version
|
||||
Set ZABBIXCLEANUP=YES
|
||||
REM Unregister "Zabbix Agent" Service - set to "NO" if you use some Hosts where Zabbix Agent is running
|
||||
REM as an Windows User instead of SYSTEM (Changed some Host manually)
|
||||
Set ZABBIXUNREGISTERSERVICE=YES
|
||||
REM ***********************************************************
|
||||
REM ** **
|
||||
REM ** Next Lines are for the ZabbixAutoUpdater only **
|
||||
REM ** http://znil.net/index.php?title=Agent_Auto_Updater **
|
||||
REM ** **
|
||||
REM ***********************************************************
|
||||
REM Use ZabbixAutoUpdater? YES or NO
|
||||
Set ZABBIXAGENTUPDATER=YES
|
||||
REM Set Path to the Agent-Files in Network and to the Installation-Script or Program
|
||||
Set UPDATEFILESHARE=\\10.20.30.40\Zabbix-Agent$\3.4.1\UpdateCheck
|
||||
Set UPDATEINSTALLER=\\10.20.30.40\Zabbix-Agent$\3.4.1\InstallZabbixAgent.bat
|
||||
REM Update Frequency in Minutes
|
||||
Set UPDATEFREQUENCY=120
|
||||
REM Set Username and Password for Update-Task. Use DOMAIN\Username or Username@domain.local
|
||||
REM Thsi will not work with Password with an %. Use if possible a long Passwort with chars and Numbers
|
||||
REM Or you can run the job as SYSTEM. SYSTEM need no Password. But SYSTEM need anonymous access to the Network-Share
|
||||
Set UPDATEUSER=SYSTEM
|
||||
Set UPDATEPASSWORD=
|
||||
REM Set UPDATEUSER=DOMAIN\Administrator
|
||||
REM Set UPDATEPASSWORD=passw0rd
|
||||
@echo off
|
||||
REM *** Configure the Agent **************************************************
|
||||
REM DNS-Name or IP of the Zabbix-Server or Zabbix Proxy, separate more than one server with ,
|
||||
Set ZABBIXSERVER=zabbix.example.local
|
||||
REM the same before, only for active checks. If Empty, ZABBIXSERVER will be used
|
||||
Set ZABBIXSERVERACTIVE=
|
||||
REM Port of Zabbix Server, Default = 10051
|
||||
Set ZABBIXSERVERPORT=10051
|
||||
REM Hostname to use
|
||||
REM Set ZABBIXHOSTNAME=%COMPUTERNAME%
|
||||
REM Next Line works also with Hostnames longer than 15 Chars
|
||||
For /f %%i in ('hostname') do Set ZABBIXHOSTNAME=%%i
|
||||
REM Set next Entry to YES or NO. YES = add Computerdomain like .domain.local to Hostname
|
||||
Set USEDOMAINSUFFIX=YES
|
||||
REM If the Computer is in no domain, or the domain can not be determined, use the following suffix
|
||||
Set FALLBACKDOMAIN=example.local
|
||||
REM Zabbix Host ListenPort, Default = 10050 **********************************
|
||||
Set ZABBIXHOSTLISTENPORT=10050
|
||||
REM HostMetadata for Autodiscovery *******************************************
|
||||
REM Set a REM in front of the line if you did not use
|
||||
REM Only use at Version 2.2 or higher, not for 2.0.x
|
||||
Set ZABBIXHOSTMETADATA=WindowsServer
|
||||
REM ## Try some alternativ Tests for different Metadata **********************
|
||||
REM Set METADATATEST to YES if you want the following additional Tests
|
||||
Set METADATATEST=NO
|
||||
REM Alternativ Metadata if if this Server is a Citrix Terminalserver with XenApp 6.x or 7.x
|
||||
Set ZABBIXHOSTMETADATACITRIX=CitrixServer
|
||||
REM Alternativ Metadata if this Server is an Active Directory Domain Controller
|
||||
Set ZABBIXHOSTMETADATADC=DomainController
|
||||
REM Alternativ Metadata if this Server is an Exchange Mail Server
|
||||
Set ZABBIXHOSTMETADATAEXCHANGE=ExchangeServer
|
||||
REM Alternativ Metadata if this Server is an Microsoft SQL Server
|
||||
Set ZABBIXHOSTMETADATAMSSQL=MSSQLServer
|
||||
REM *************************************************************************
|
||||
REM Name of Config-File - Default zabbix_agentd.win.conf
|
||||
Set ZABBIXHOSTCONFIGFILE=zabbix_agentd.win.conf
|
||||
REM CleanUp Directory before Installing - delete ALL Files in the Installation
|
||||
REM Directory before installing new Version
|
||||
Set ZABBIXCLEANUP=YES
|
||||
REM Unregister "Zabbix Agent" Service - set to "NO" if you use some Hosts where Zabbix Agent is running
|
||||
REM as an Windows User instead of SYSTEM (Changed some Host manually)
|
||||
Set ZABBIXUNREGISTERSERVICE=YES
|
||||
REM ***********************************************************
|
||||
REM ** **
|
||||
REM ** Next Lines are for the ZabbixAutoUpdater only **
|
||||
REM ** http://znil.net/index.php?title=Agent_Auto_Updater **
|
||||
REM ** **
|
||||
REM ***********************************************************
|
||||
REM Use ZabbixAutoUpdater? YES or NO
|
||||
Set ZABBIXAGENTUPDATER=YES
|
||||
REM Set Path to the Agent-Files in Network and to the Installation-Script or Program
|
||||
Set UPDATEFILESHARE=\\10.20.30.40\Zabbix-Agent$\3.4.1\UpdateCheck
|
||||
Set UPDATEINSTALLER=\\10.20.30.40\Zabbix-Agent$\3.4.1\InstallZabbixAgent.bat
|
||||
REM Update Frequency in Minutes
|
||||
Set UPDATEFREQUENCY=120
|
||||
REM Set Username and Password for Update-Task. Use DOMAIN\Username or Username@domain.local
|
||||
REM Thsi will not work with Password with an %. Use if possible a long Passwort with chars and Numbers
|
||||
REM Or you can run the job as SYSTEM. SYSTEM need no Password. But SYSTEM need anonymous access to the Network-Share
|
||||
Set UPDATEUSER=SYSTEM
|
||||
Set UPDATEPASSWORD=
|
||||
REM Set UPDATEUSER=DOMAIN\Administrator
|
||||
REM Set UPDATEPASSWORD=passw0rd
|
||||
|
Loading…
Reference in New Issue
Block a user