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
Module: check_mk
Branch: master
Commit: 221f61bf66edff78f9dd7732b8bc8e09d7aaf701
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=221f61bf66edff…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Oct 20 14:00:09 2015 +0200
An exception like "'int' object is not iterable" could occur during execution of the ps checks.
Conflicts:
modules/check_mk_base.py
---
.werks/2683 | 10 ++++++++++
ChangeLog | 1 +
modules/check_mk_base.py | 9 +++++++--
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/.werks/2683 b/.werks/2683
new file mode 100644
index 0000000..9b17ccf
--- /dev/null
+++ b/.werks/2683
@@ -0,0 +1,10 @@
+Title: Fixed exceptions occuring in some ps checks
+Level: 2
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1445342126
+
+An exception like "'int' object is not iterable" could occur during execution of the ps checks.
diff --git a/ChangeLog b/ChangeLog
index c90c820..8135952 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,7 @@
* 2661 FIX: windows agent: fixed incomplete process list...
* 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...
Multisite:
* 2680 FIX: LDAP: Fixed exception when syncing groups using configurations from previous versions...
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 0c1cc0a..0ec829f 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -994,7 +994,6 @@ def load_item_state(hostname):
def save_item_state(hostname):
if not opt_dont_submit and not i_am_root(): # never writer counters as root
- global g_item_state
filename = counters_directory + "/" + hostname
try:
if not os.path.exists(counters_directory):
@@ -1108,11 +1107,17 @@ def clear_counters(counter_name_prefix, min_keep_seconds):
counters_to_delete = []
remove_if_min_keep_seconds = time.time() - min_keep_seconds
- for name, (timestamp, value) in g_item_state.iteritems():
+ for name, state in g_item_state.iteritems():
if type(name) == tuple:
counter_name = name[0] # never needed, since only called by ps currently
else:
counter_name = name
+
+ if type(state) == tuple:
+ timestamp, value = state
+ else:
+ continue # unable to cleanup values without timestamp info, skip
+
if counter_name.startswith(counter_name_prefix):
if timestamp < remove_if_min_keep_seconds:
counters_to_delete.append(name)