Module: check_mk
Branch: master
Commit: 53f5fbb5d356af03b5c87d0f70e1826c650039bf
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=53f5fbb5d356af…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Tue Oct 20 15:21:01 2015 +0200
#2662 FIX windows agent: fixed inventory running every time when ipv6 was activated
due to the colons in ipv6 adresses, the state file used to signal when inventory was last
executed
couldn't be saved. This has been fixed both in the ps1 and vbs variant of the script.
---
.werks/2662 | 10 ++++++++++
ChangeLog | 1 +
agents/windows/plugins/mk_inventory.ps1 | 2 +-
agents/windows/plugins/mk_inventory.vbs | 2 +-
4 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/.werks/2662 b/.werks/2662
new file mode 100644
index 0000000..e3446a4
--- /dev/null
+++ b/.werks/2662
@@ -0,0 +1,10 @@
+Title: windows agent: fixed inventory running every time when ipv6 was activated
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1445347125
+Class: fix
+
+due to the colons in ipv6 adresses, the state file used to signal when inventory was last
executed
+couldn't be saved. This has been fixed both in the ps1 and vbs variant of the
script.
diff --git a/ChangeLog b/ChangeLog
index 8135952..2f7c456 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,7 @@
* 2665 FIX: ps: fix crash in case of quota violation on Windows
* 2437 FIX: joloka_metrics.perm_gen: fixed broken check...
* 2683 FIX: Fixed exceptions occuring in some ps checks...
+ * 2662 FIX: windows agent: fixed inventory running every time when ipv6 was
activated...
Multisite:
* 2680 FIX: LDAP: Fixed exception when syncing groups using configurations from
previous versions...
diff --git a/agents/windows/plugins/mk_inventory.ps1
b/agents/windows/plugins/mk_inventory.ps1
index a9b1b64..160b0fd 100644
--- a/agents/windows/plugins/mk_inventory.ps1
+++ b/agents/windows/plugins/mk_inventory.ps1
@@ -17,7 +17,7 @@ if (!$state_dir) {
$state_dir = "c:\Program Files (x86)\check_mk\state"
}
-$timestamp = $state_dir + "\timestamp."+ $remote_host
+$timestamp = $state_dir + "\timestamp."+ $remote_host.Replace(":",
"_")
# does $timestamp exist?
If (Test-Path $timestamp){
diff --git a/agents/windows/plugins/mk_inventory.vbs
b/agents/windows/plugins/mk_inventory.vbs
index 8e480ea..5f573d4 100644
--- a/agents/windows/plugins/mk_inventory.vbs
+++ b/agents/windows/plugins/mk_inventory.vbs
@@ -31,7 +31,7 @@ Sub outPut(strOut)
objStdout.WriteLine strOut
End Sub
-timestamp = state_dir & "\mk_inventory." & remote_host
+timestamp = state_dir & "\mk_inventory." & Replace(remote_host,
":", "_")
' does timestamp exist?
If (fso.FileExists(timestamp)) Then