Module: check_mk
Branch: master
Commit: 3ec6925600e615903ae02d18353492a79fcd4a97
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3ec6925600e615…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Sep 11 11:47:34 2017 +0200
5204 FIX Host rename: Fixed broken rename of hosts in rrdcached journal
When using the new Check_MK rrd format (single value per RRD), the
host rename feature was not renaming host specific entries in the
journal of the rrdcached.
This resulted in lost RRD values that have not been written to the
RRDs yet.
Manual fix: You could stop the rrdcached (or the whole site), go
to var/rrdcached and rename the host in the journal files manually,
e.g. using <tt>sed</tt>.
Change-Id: Ib330541438a87692f40a2856add7d1f066379c01
---
.werks/5204 | 20 ++++++++++++++++++++
cmk_base/automations/check_mk.py | 5 +++--
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/.werks/5204 b/.werks/5204
new file mode 100644
index 0000000..f2cde4d
--- /dev/null
+++ b/.werks/5204
@@ -0,0 +1,20 @@
+Title: Host rename: Fixed broken rename of hosts in rrdcached journal
+Level: 1
+Component: core
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1505122976
+
+When using the new Check_MK rrd format (single value per RRD), the
+host rename feature was not renaming host specific entries in the
+journal of the rrdcached.
+
+This resulted in lost RRD values that have not been written to the
+RRDs yet.
+
+Manual fix: You could stop the rrdcached (or the whole site), go
+to var/rrdcached and rename the host in the journal files manually,
+e.g. using <tt>sed</tt>.
diff --git a/cmk_base/automations/check_mk.py b/cmk_base/automations/check_mk.py
index daaa0c4..cc38a55 100644
--- a/cmk_base/automations/check_mk.py
+++ b/cmk_base/automations/check_mk.py
@@ -370,8 +370,9 @@ class AutomationRenameHosts(Automation):
# entries of rrdcached journal
if self.rename_host_in_files(os.path.join(cmk.paths.omd_root,
"var/rrdcached/rrd.journal.*"),
- "/perfdata/%s/" % oldregex,
- "/perfdata/%s/" % newregex):
+ "/(perfdata|rrd)/%s/" % oldregex,
+ "/\\1/%s/" % newregex,
+ extended_regex=True):
actions.append("rrdcached")
# Spoolfiles of NPCD