Module: check_mk
Branch: master
Commit: 5b5d399fef1fcdad83b40e9465037fc0bc0efa5c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5b5d399fef1fcd…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Sep 10 11:34:14 2014 +0200
#1107 windows agent: now sets additional environment variables
The agent now sets the following environment variables on startup.
<ul>
<li>PLUGINSDIR</li>
<li>LOCALDIR</li>
<li>SPOOLDIR</li>
<li>MK_CONFDIR</li>
</ul>
These can be used in the local an plugin scripts. There is also a dynamic
environment variable <tt>REMOTE_HOST</tt> available, representing the host ip
of the current connection.
---
.werks/1107 | 20 ++++++++++++++++++++
ChangeLog | 1 +
agents/windows/build_version | 2 +-
agents/windows/check_mk_agent-64.exe | Bin 208896 -> 208896 bytes
agents/windows/check_mk_agent-64.unversioned.exe | Bin 208896 -> 208896 bytes
agents/windows/check_mk_agent.cc | 6 ++++++
agents/windows/check_mk_agent.exe | Bin 177664 -> 178176 bytes
agents/windows/check_mk_agent.unversioned.exe | Bin 177664 -> 178176 bytes
agents/windows/crash.exe | Bin 20024 -> 20024 bytes
agents/windows/install_agent-64.exe | Bin 160015 -> 160065 bytes
agents/windows/install_agent.exe | Bin 156898 -> 156986 bytes
agents/windows/nowin.exe | Bin 22511 -> 22511 bytes
12 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/.werks/1107 b/.werks/1107
new file mode 100644
index 0000000..46d393e
--- /dev/null
+++ b/.werks/1107
@@ -0,0 +1,20 @@
+Title: windows agent: now sets additional environment variables
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1410341500
+Class: feature
+
+The agent now sets the following environment variables on startup.
+
+<ul>
+<li>PLUGINSDIR</li>
+<li>LOCALDIR</li>
+<li>SPOOLDIR</li>
+<li>MK_CONFDIR</li>
+</ul>
+
+These can be used in the local an plugin scripts. There is also a dynamic
+environment variable <tt>REMOTE_HOST</tt> available, representing the host
ip
+of the current connection.
diff --git a/ChangeLog b/ChangeLog
index 9243cf0..bba41a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -54,6 +54,7 @@
* 1183 bluecat_commandserver: New Check for bluecat adonis devices
* 1397 juniper_screenos_cpu, juniper_screenos_fan, juniper_screenos_mem,
juniper_screenos_temp, juniper_screenos_vpn: new checks for Juniper ScreenOS Firewalls
* 1106 mk_inventory.ps1: now uses the MK_CONFDIR environment variable from the agent
(if available)...
+ * 1107 windows agent: now sets additional environment variables...
* 1051 FIX: tcp_conn_stats: fix missing performance data...
* 1142 FIX: winperf_ts_sessions: fix computation, check has never really worked
* 1090 FIX: zfsget: fixed exception which happened on incomplete zfs entries
diff --git a/agents/windows/build_version b/agents/windows/build_version
index 76a8b2b..8643cf6 100644
--- a/agents/windows/build_version
+++ b/agents/windows/build_version
@@ -1 +1 @@
-83
+89
diff --git a/agents/windows/check_mk_agent-64.exe b/agents/windows/check_mk_agent-64.exe
index 29b7ad0..2262cd3 100755
Binary files a/agents/windows/check_mk_agent-64.exe and
b/agents/windows/check_mk_agent-64.exe differ
diff --git a/agents/windows/check_mk_agent-64.unversioned.exe
b/agents/windows/check_mk_agent-64.unversioned.exe
index ef1e9a7..752375a 100755
Binary files a/agents/windows/check_mk_agent-64.unversioned.exe and
b/agents/windows/check_mk_agent-64.unversioned.exe differ
diff --git a/agents/windows/check_mk_agent.cc b/agents/windows/check_mk_agent.cc
index 3f5439a..dd9569b 100755
--- a/agents/windows/check_mk_agent.cc
+++ b/agents/windows/check_mk_agent.cc
@@ -4662,6 +4662,12 @@ void determine_directories()
snprintf(g_local_dir, sizeof(g_local_dir), "%s\\local",
g_agent_directory);
snprintf(g_spool_dir, sizeof(g_spool_dir), "%s\\spool",
g_agent_directory);
snprintf(g_logwatch_statefile, sizeof(g_logwatch_statefile),
"%s\\logstate.txt", g_agent_directory);
+
+ // Set these directories as environment variables. Some scripts might use them...
+ SetEnvironmentVariable("PLUGINSDIR", g_plugins_dir);
+ SetEnvironmentVariable("LOCALDIR", g_local_dir);
+ SetEnvironmentVariable("SPOOLDIR", g_spool_dir);
+ SetEnvironmentVariable("MK_CONFDIR", g_agent_directory);
}
int get_counter_id_from_lang(const char *language, const char *counter_name)
diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe
index 404846c..1ff882a 100755
Binary files a/agents/windows/check_mk_agent.exe and b/agents/windows/check_mk_agent.exe
differ
diff --git a/agents/windows/check_mk_agent.unversioned.exe
b/agents/windows/check_mk_agent.unversioned.exe
index 23ba18e..c27128f 100755
Binary files a/agents/windows/check_mk_agent.unversioned.exe and
b/agents/windows/check_mk_agent.unversioned.exe differ
diff --git a/agents/windows/crash.exe b/agents/windows/crash.exe
index 812ff07..6b00559 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
index e7401e6..fc4de25 100755
Binary files a/agents/windows/install_agent-64.exe and
b/agents/windows/install_agent-64.exe differ
diff --git a/agents/windows/install_agent.exe b/agents/windows/install_agent.exe
index 9dc0c7f..dff5540 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 86c3c0c..52f5a52 100755
Binary files a/agents/windows/nowin.exe and b/agents/windows/nowin.exe differ