Module: check_mk
Branch: master
Commit: 7ed7c37a48fdd709bdc1b44c86db3aeb94478263
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7ed7c37a48fdd7…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue May 28 11:36:44 2013 +0200
windows agent: 64 bit version available
---
ChangeLog | 1 +
agents/windows/Makefile | 16 ++++-
agents/windows/check_mk_agent-64.exe | Bin 0 -> 131072 bytes
agents/windows/check_mk_agent.exe | Bin 113664 -> 112640 bytes
agents/windows/crash.exe | Bin 20024 -> 20024 bytes
agents/windows/install_agent-64.exe | Bin 0 -> 131695 bytes
agents/windows/install_agent.exe | Bin 131980 -> 131798 bytes
agents/windows/installer-64.nsi | 110 ++++++++++++++++++++++++++++++++++
agents/windows/nowin.exe | Bin 22511 -> 22511 bytes
9 files changed, 126 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 6854aab..d31567b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
Checks & Agents:
* lnx_if: Fixed crash on missing "Address" field
* viprinet_router: Now able to set required target state via rule
+ * windows_agent: Now available as 64 bit version
1.2.3i1:
Core:
diff --git a/agents/windows/Makefile b/agents/windows/Makefile
index 43e60e7..768566b 100755
--- a/agents/windows/Makefile
+++ b/agents/windows/Makefile
@@ -23,11 +23,14 @@
# Boston, MA 02110-1301 USA.
ifeq ($(shell uname),Linux)
- CXX = echo -e "\n\nWARNING: MinGW under Linux is broken! Use at your own
risk!\n\n" ; i586-mingw32msvc-g++
+ CXX = echo -e "\n\nWARNING: MinGW under Linux is broken! Use at your own
risk!\n\n" ; i586-mingw32msvc-g++
+ CXX_64 = x86_64-w64-mingw32-g++
else
CXX = mingw32-g++
endif
+all: install_agent.exe install_agent-64.exe
+
install_agent.exe: check_mk_agent.exe crash.exe nowin.exe
if ! which makensis; then \
echo "ERROR: makensis missing. Please install the nsis package." ; \
@@ -36,9 +39,20 @@ install_agent.exe: check_mk_agent.exe crash.exe nowin.exe
makensis installer.nsi
chmod +x install_agent.exe
+install_agent-64.exe: check_mk_agent-64.exe crash.exe nowin.exe
+ if ! which makensis; then \
+ echo "ERROR: makensis missing. Please install the nsis package." ; \
+ exit 1 ; \
+ fi
+ makensis installer-64.nsi
+ chmod +x install_agent-64.exe
+
check_mk_agent.exe: check_mk_agent.cc Makefile
$(CXX) -s -O2 -Wall -Werror -o $@ $< -static -lwsock32
+check_mk_agent-64.exe: check_mk_agent.cc Makefile
+ $(CXX_64) -s -O2 -Wall -Werror -o $@ $< -static -lwsock32
+
crash.exe: crash.cc Makefile
$(CXX) -o $@ $<
diff --git a/agents/windows/check_mk_agent-64.exe b/agents/windows/check_mk_agent-64.exe
new file mode 100755
index 0000000..073f0e2
Binary files /dev/null and b/agents/windows/check_mk_agent-64.exe differ
diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe
index aeeaadc..eb5abf3 100755
Binary files a/agents/windows/check_mk_agent.exe and b/agents/windows/check_mk_agent.exe
differ
diff --git a/agents/windows/crash.exe b/agents/windows/crash.exe
index c51b120..65b86d5 100755
Binary files a/agents/windows/crash.exe and b/agents/windows/crash.exe differ
diff --git a/agents/windows/install_agent-64.exe b/agents/windows/install_agent-64.exe
new file mode 100755
index 0000000..d85c2a0
Binary files /dev/null and b/agents/windows/install_agent-64.exe differ
diff --git a/agents/windows/install_agent.exe b/agents/windows/install_agent.exe
index 126ba50..5cad004 100755
Binary files a/agents/windows/install_agent.exe and b/agents/windows/install_agent.exe
differ
diff --git a/agents/windows/installer-64.nsi b/agents/windows/installer-64.nsi
new file mode 100644
index 0000000..5a6a851
--- /dev/null
+++ b/agents/windows/installer-64.nsi
@@ -0,0 +1,110 @@
+; This is the NSIS configuration file for the Check_MK windows agent. This is
+; the spec file how to build the installer
+;--------------------------------
+; Useful sources:
+;
http://nsis.sourceforge.net/Reusable_installer_script
+
+!define CHECK_MK_VERSION "1.2.3i1"
+!define NAME "Check_MK Agent ${CHECK_MK_VERSION}"
+
+XPStyle on
+Icon "installer.ico"
+
+; The name of the installer
+Name "${NAME}"
+
+; The file to write
+OutFile "install_agent-64.exe"
+
+SetDateSave on
+SetDatablockOptimize on
+CRCCheck on
+SilentInstall normal
+
+; The default installation directory
+InstallDir "$PROGRAMFILES\check_mk"
+
+; Registry key to check for directory (so if you install again, it will
+; overwrite the old one automatically)
+InstallDirRegKey HKLM "Software\check_mk_agent" "Install_Dir"
+
+; Request application privileges for Windows >Vista
+RequestExecutionLevel admin
+
+ShowInstDetails show
+
+;--------------------------------
+; Pages
+
+Page directory
+Page components
+Page instfiles
+
+UninstPage uninstConfirm
+UninstPage instfiles
+
+;--------------------------------
+
+Section "Check_MK_Agent"
+ ; Can not be disabled
+ SectionIn RO
+
+ !include LogicLib.nsh
+ ExpandEnvStrings $0 "%comspec%"
+ nsExec::ExecToStack '"$0" /k "net start | FIND /C /I
"check_mk_agent""'
+ Pop $0
+ Pop $1
+ StrCpy $1 $1 1
+ Var /GLOBAL stopped
+ ${If} "$0$1" == "01"
+ DetailPrint "Stop running check_mk_agent..."
+ StrCpy $stopped "1"
+ nsExec::Exec 'cmd /C "net stop check_mk_agent"'
+ ${Else}
+ StrCpy $stopped "0"
+ ${EndIf}
+
+ SetOutPath "$INSTDIR"
+ File /oname=check_mk_agent.exe check_mk_agent-64.exe
+ File check_mk.example.ini
+ CreateDirectory "$INSTDIR\local"
+ CreateDirectory "$INSTDIR\plugins"
+
+ ; Write the installation path into the registry
+ WriteRegStr HKLM SOFTWARE\check_mk_agent "Install_Dir"
"$INSTDIR"
+
+ ; Write the uninstall keys for Windows
+ WriteRegStr HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\check_mk_agent"
"DisplayName" "${NAME}"
+ WriteRegStr HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\check_mk_agent"
"UninstallString" '"$INSTDIR\uninstall.exe"'
+ WriteRegDWORD HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\check_mk_agent"
"NoModify" 1
+ WriteRegDWORD HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\check_mk_agent"
"NoRepair" 1
+ WriteUninstaller "uninstall.exe"
+SectionEnd
+
+Section "Install & start service"
+ DetailPrint "Installing and starting the check_mk_agent service..."
+ nsExec::Exec 'cmd /C "$INSTDIR\check_mk_agent.exe" install'
+ nsExec::Exec 'cmd /C "net start check_mk_agent"'
+SectionEnd
+
+Section "Uninstall"
+ ; Remove the service
+ DetailPrint "Stopping service..."
+ nsExec::Exec 'cmd /C "net stop check_mk_agent"'
+ DetailPrint "Removing service..."
+ nsExec::Exec 'cmd /C "$INSTDIR\check_mk_agent.exe" remove'
+
+ ; Remove registry keys
+ DeleteRegKey HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\check_mk_agent"
+ DeleteRegKey HKLM SOFTWARE\check_mk_agent
+
+ ; Remove files and uninstaller
+ Delete "$INSTDIR\check_mk_agent.exe"
+ Delete "$INSTDIR\check_mk.example.ini"
+ Delete "$INSTDIR\uninstall.exe"
+ RMDir "$INSTDIR\local"
+ RMDir "$INSTDIR\plugins"
+
+ ; Remove directories used
+ RMDir "$INSTDIR"
+SectionEnd
diff --git a/agents/windows/nowin.exe b/agents/windows/nowin.exe
index 9c2e4c1..63bdf3c 100755
Binary files a/agents/windows/nowin.exe and b/agents/windows/nowin.exe differ