Module: check_mk
Branch: master
Commit: 6507b9566c2255c701ad13ab92ab13564471016c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6507b9566c2255…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue May 27 10:31:07 2014 +0200
windows agent: local / plugin scripts now get the REMOTE_HOST as environment variable
---
.werks/926 | 8 ++++++++
ChangeLog | 5 +++--
agents/windows/check_mk_agent-64.exe | Bin 204800 -> 205312 bytes
agents/windows/check_mk_agent.cc | 12 +++++++++---
agents/windows/check_mk_agent.exe | Bin 175104 -> 175104 bytes
agents/windows/crash.exe | Bin 20024 -> 20024 bytes
agents/windows/install_agent-64.exe | Bin 158244 -> 158331 bytes
agents/windows/install_agent.exe | Bin 155364 -> 155451 bytes
agents/windows/nowin.exe | Bin 22511 -> 22511 bytes
9 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/.werks/926 b/.werks/926
new file mode 100644
index 0000000..5b43d12
--- /dev/null
+++ b/.werks/926
@@ -0,0 +1,8 @@
+Title: windows agent: local / plugin scripts now get the REMOTE_HOST as environment
variable
+Level: 1
+Component: checks
+Version: 1.2.5i3
+Date: 1401179419
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 5394e07..b0b54f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -60,7 +60,8 @@
* 0960 libelle_business_shadow.archive_dir: New check for the Archive Dir of Libelle
Business Shadow...
* 0978 Fix security issue with mk-job on Linux...
NOTE: Please refer to the migration notes!
- * 0925 ps: improved/fixed calculation of CPU utilization...
+ * 0925 ps: improved/fixed calculation of CPU utilization (linux)...
+ * 0926 windows agent: local / plugin scripts now get the REMOTE_HOST as environment
variable
* 0777 FIX: special agent emcvnx: did not work with security file authentication...
* 0786 FIX: zfsget: fixed compatibility with older Solaris agents...
* 0809 FIX: brocade_fcport: Fixed recently introduced problem with port speed
detection
@@ -88,8 +89,8 @@
* 0611 FIX: nfsexports.solaris: fix in determination of path prefix
* 0953 FIX: brocade_mlx_temp: special treatment for devices sometimes not delivering
temperature by SNMP
* 0958 FIX: df.include: failed for checks with grouping patterns...
- * 0614 FIX: cmciii.temp, cmciii.humidity: fixed bugs to get performance data back
* 0924 FIX: windows agent: now able to execute python scripts again
+ * 0614 FIX: cmciii.temp, cmciii.humidity: fixed bugs to get performance data back
Multisite:
* 0779 Hostgroups (Summary): Empty hostgroups are no longer shown (can be re-enabled
by filter)
diff --git a/agents/windows/check_mk_agent-64.exe b/agents/windows/check_mk_agent-64.exe
index e17986b..8198a67 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.cc b/agents/windows/check_mk_agent.cc
index e7fa13b..631f109 100755
--- a/agents/windows/check_mk_agent.cc
+++ b/agents/windows/check_mk_agent.cc
@@ -4056,12 +4056,18 @@ void listen_tcp_loop()
connection = RemoveSocketInheritance(connection);
if (connection != INVALID_SOCKET) {
uint32_t ip = 0;
- if (remote_addr.sin_family == AF_INET)
+ char ip_hr[256];
+ if (remote_addr.sin_family == AF_INET) {
ip = remote_addr.sin_addr.s_addr;
+ snprintf(ip_hr, sizeof(ip_hr), "%u.%u.%u.%u",
+ ip & 0xff, (ip >> 8) & 0xff, (ip >> 16)
& 0xff, (ip >> 24) & 0xff);
+ } else
+ snprintf(ip_hr, sizeof(ip_hr), "None");
if (check_only_from(ip)) {
open_crash_log();
- crash_log("Accepted client connection from %u.%u.%u.%u.",
- ip & 0xff, (ip >> 8) & 0xff, (ip >> 16)
& 0xff, (ip >> 24) & 0xff);
+ crash_log("Accepted client connection from %s.", ip_hr);
+
+ SetEnvironmentVariable("REMOTE_HOST", ip_hr);
output_data(connection);
close_crash_log();
}
diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe
index 3a353d7..c9b6229 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 eeca449..8276ea4 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 559d7ed..899111b 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 3ddaee1..34562eb 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 f86b848..2947ce7 100755
Binary files a/agents/windows/nowin.exe and b/agents/windows/nowin.exe differ