Module: check_mk
Branch: master
Commit: d0858c19f9c33ce46dc5240c3da5a4a3c760bb5b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d0858c19f9c33c…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed May 15 15:24:46 2013 +0200
windows_agent: fixed timeouts for powershell scripts in local/plugins
---
ChangeLog | 1 +
agents/windows/check_mk.example.ini | 1 +
agents/windows/check_mk_agent.cc | 15 +--------------
agents/windows/check_mk_agent.exe | Bin 113664 -> 113664 bytes
agents/windows/crash.exe | Bin 20024 -> 20024 bytes
agents/windows/install_agent.exe | Bin 131986 -> 131980 bytes
agents/windows/nowin.exe | Bin 22511 -> 22511 bytes
7 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0cb5c01..41d9723 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -98,6 +98,7 @@
* lnx_if: show MAC address for interfaces (needs also agent update)
* winperf_tcp_conn: New check. Displays number of established tcpv4 connections in
windows
Uses WATO Rule "TCP connection stats (Windows)"
+ * windows_agent: fixed timeouts for powershell scripts in local/plugins
Notifications:
* notify.py: unique spoolfiles name no longer created with uuid
diff --git a/agents/windows/check_mk.example.ini b/agents/windows/check_mk.example.ini
index 40fb50d..a2f0e75 100644
--- a/agents/windows/check_mk.example.ini
+++ b/agents/windows/check_mk.example.ini
@@ -26,6 +26,7 @@
# Select counters to extract. The following counters
# are needed by checks shipped with check_mk.
# counters = 10332:msx_queues
+ # counters = 638:tcp_conn
[logfiles]
diff --git a/agents/windows/check_mk_agent.cc b/agents/windows/check_mk_agent.cc
index 07bfdb8..930a5d0 100755
--- a/agents/windows/check_mk_agent.cc
+++ b/agents/windows/check_mk_agent.cc
@@ -2089,7 +2089,7 @@ void launch_program(SOCKET &out, char *dirname, char *name, bool
is_plugin){
SECURITY_ATTRIBUTES sa;
SECURITY_DESCRIPTOR sd; // security information for pipes
PROCESS_INFORMATION pi;
- HANDLE newstdin,newstdout,read_stdout,write_stdin; // pipe handles
+ HANDLE newstdout,read_stdout; // pipe handles
// initialize security descriptor (Windows NT)
if (IsWinNT())
@@ -2103,17 +2103,9 @@ void launch_program(SOCKET &out, char *dirname, char *name,
bool is_plugin){
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.bInheritHandle = true; // allow inheritable handles
- // stdin is unused
- if (!CreatePipe(&newstdin,&write_stdin,&sa,0)) // create stdin pipe
- {
- crash_log("Error creating stdin pipe");
- return;
- }
if (!CreatePipe(&read_stdout,&newstdout,&sa,0)) // create stdout pipe
{
crash_log("Error creating stdout pipe");
- CloseHandle(newstdin);
- CloseHandle(write_stdin);
return;
}
@@ -2127,17 +2119,14 @@ void launch_program(SOCKET &out, char *dirname, char *name,
bool is_plugin){
si.wShowWindow = SW_HIDE;
si.hStdOutput = newstdout;
si.hStdError = newstdout; // set the new handles for the child process
- si.hStdInput = newstdin;
// spawn the child process
if (!CreateProcess(NULL,command,NULL,NULL,TRUE,CREATE_NEW_CONSOLE,
NULL,NULL,&si,&pi))
{
crash_log("Error creating process");
- CloseHandle(newstdin);
CloseHandle(newstdout);
CloseHandle(read_stdout);
- CloseHandle(write_stdin);
return;
}
@@ -2196,10 +2185,8 @@ void launch_program(SOCKET &out, char *dirname, char *name,
bool is_plugin){
// cleanup the mess
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
- CloseHandle(newstdin);
CloseHandle(newstdout);
CloseHandle(read_stdout);
- CloseHandle(write_stdin);
return;
}
diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe
index 7061cbf..aeeaadc 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 c41ea79..c51b120 100755
Binary files a/agents/windows/crash.exe and b/agents/windows/crash.exe differ
diff --git a/agents/windows/install_agent.exe b/agents/windows/install_agent.exe
index 99a9772..126ba50 100755
Binary files a/agents/windows/install_agent.exe and b/agents/windows/install_agent.exe
differ
diff --git a/agents/windows/nowin.exe b/agents/windows/nowin.exe
index 6cecab0..9c2e4c1 100755
Binary files a/agents/windows/nowin.exe and b/agents/windows/nowin.exe differ