Module: check_mk
Branch: master
Commit: c37a0c350f8b667f05aef31c2ebc1fb0b3af2ebf
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c37a0c350f8b66…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Mar 22 08:46:28 2019 +0100
added WK7247: Fixed incomplete counter cleanup routine
Change-Id: Ia2565c70e5c80e8d679cfc21c8b223a9f0323105
---
.werks/7247 | 17 +++++++++++++++++
checks/ps | 2 +-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/.werks/7247 b/.werks/7247
new file mode 100644
index 0000000..bb8d295
--- /dev/null
+++ b/.werks/7247
@@ -0,0 +1,17 @@
+Title: ps.perf: Fixed incomplete counter cleanup routine, leading to ever-growing counter
state files
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1553175847
+
+The ps check regularly creates counter values with dyamic names and save them into the
counter state file.
+There is a cleanup routine which removes outdated counters.
+
+This cleanup routine failed at cleaning up counter values from the deprecated ps.perf
check.
+As a result the check counters file did steadily grow. This has been fixed. The cleanup
now also
+checks for outdated ps.perf counters.
+
diff --git a/checks/ps b/checks/ps
index a0a09cb..5e354c3 100644
--- a/checks/ps
+++ b/checks/ps
@@ -98,7 +98,7 @@ def ps_cleanup_counters(parsed):
def ps_get_counters_to_delete(pids):
counters_to_delete = []
for ident in get_all_item_states():
- if isinstance(ident, tuple) and ident[0] == "ps":
+ if isinstance(ident, tuple) and ident[0] in ["ps",
"ps.perf"]:
check_ident = ident[2]
elif not isinstance(ident, tuple) and (ident.startswith("ps_stat") or
ident.startswith("ps_wmic")):