Module: check_mk
Branch: master
Commit: ec67661d6dfb8fbe56103b2167ba3a1ccdcaefce
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ec67661d6dfb8f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 9 08:19:29 2010 +0100
The windows Agent uses cscript for .vbs plugins now
It is not safe to rely on the default system handler for this
file type since it might be an editor on some systems.
---
ChangeLog | 2 ++
agents/windows/check_mk_agent.cc | 20 ++++++++++++++++++++
agents/windows/check_mk_agent.exe | Bin 95232 -> 95232 bytes
agents/windows/crash.exe | Bin 20024 -> 20494 bytes
4 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e46e75d..4f591d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -114,6 +114,8 @@
The check also handles unknown states better now
* printer_supply: Added new parameter "printer_supply_some_remaining_status" to
configure the reported state on small remaining capacity.
+ * Windows agent: .vbs scripts in agents plugins/ directory are executed
+ automatically with "cscript.exe /Nologo" to prevent wrong file handlers
Multisite:
* The custom open/close states of custom links are now stored for each
diff --git a/agents/windows/check_mk_agent.cc b/agents/windows/check_mk_agent.cc
index 143f962..f7c8f43 100755
--- a/agents/windows/check_mk_agent.cc
+++ b/agents/windows/check_mk_agent.cc
@@ -44,6 +44,7 @@
#define WINVER 0x0500
#include <stdio.h>
+#include <stdint.h>
#include <windows.h>
#include <winbase.h>
#include <winreg.h> // performance counters from registry
@@ -970,8 +971,27 @@ void section_eventlog(SOCKET &out)
first_run = false;
}
+void add_interpreter(char *path)
+{
+ if((strcmp(&path[strlen(path) - 5], ".vbs\"")) == 0) {
+ // If this is a vbscript don't rely on the default handler for this
+ // file extensions. This might be notepad or some other editor by
+ // default on a lot of systems. So better add cscript as interpreter.
+ //
+ snprintf(path, 256, "cscript.exe //Nologo %s", path);
+ //
+ //char path_tmp[256];
+ //strcpy(path_tmp, path);
+ //strcpy(path, "cscript.exe //Nologo ");
+ //strcat(path, path_tmp);
+ //free(path_tmp);
+ }
+}
+
void run_plugin(SOCKET &out, char *path)
{
+ add_interpreter(path);
+
FILE *f = popen(path, "r");
if (f) {
char line[4096];
diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe
index be9b18a..263adc5 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 00385a7..40aaa68 100755
Binary files a/agents/windows/crash.exe and b/agents/windows/crash.exe differ
Module: check_mk
Branch: master
Commit: 7b380089db6748b1274ef33b431eabb68605dc71
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7b380089db6748…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Dec 8 17:54:13 2010 +0100
Updated ChangeLog
---
ChangeLog | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 2ebc985..f576ffa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,9 +14,6 @@
* Configuration check (-X) is now always done. It is now impossible to
call any Check_MK action with an invalid configuration. This saves
you agains mistyped variables.
- * Renamed check functions of imm_health check from test_imm to imm_health
- to have valid function and check names. Please remove remove from
- inventory and re-inventory those checks.
* Check kernel: converted performance data from counters to rates. This
fixes RRD problems (spikes) on reboots and also allows better access
to the peformance data for the Perf-O-Meters. Also changed service
@@ -55,6 +52,9 @@
for an example
Checks & Agents:
+ * Renamed check functions of imm_health check from test_imm to imm_health
+ to have valid function and check names. Please remove remove from
+ inventory and re-inventory those checks.
* fc_brocade_port_detailed: allow to specify port state combinations not
to be critical
* megaraid_pdisks: Using the real enclosure number as check item now