Module: check_mk
Branch: master
Commit: 5021905c8a82f5dd0005c63c57481e09bcc43468
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5021905c8a82f5…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri Sep 8 16:58:40 2017 +0200
Better metric name typing.
Distinguish between the real metric names and their mangled counterparts on
the type level. We are now very explicit about this, making some mangling
Kung Fu visible. Some cleanups on the way.
Change-Id: I2f708134a9c753b8d63178108594810aaed37aa0
---
livestatus/src/ChronoUtils.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/livestatus/src/ChronoUtils.h b/livestatus/src/ChronoUtils.h
index fd21248..b823c37 100644
--- a/livestatus/src/ChronoUtils.h
+++ b/livestatus/src/ChronoUtils.h
@@ -46,8 +46,8 @@ inline double elapsed_ms_since(std::chrono::steady_clock::time_point then) {
inline tm to_tm(std::chrono::system_clock::time_point tp) {
time_t t = std::chrono::system_clock::to_time_t(tp);
struct tm ret;
- // NOTE: A brilliant example of how to make a simple API function a total
- // chaos follows...
+// NOTE: A brilliant example of how to make a simple API function a total
+// chaos follows...
#if defined(__STDC_LIB_EXT1__)
// C11 function, only guaranteed to be available when a
// #define __STDC_WANT_LIB_EXT1_ 1
Module: check_mk
Branch: master
Commit: eca299f96737f56bfd225ca9542f8402f13cbaf8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eca299f96737f5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Sep 11 12:38:38 2017 +0200
5205 FIX Host rename: Fixed broken renaming when new name uses dots
When using the host rename feature of WATO and setting a new name that
contains a dot, for example myhost.domain, the rename failed to set
a correct new name. Instead of setting the intended name, the name was
set to "myhost[.]domain" in different places.
The affected files are:
<ul>
<li>Nagios core: <tt>var/nagios/retention.dat</tt></li>
<li>NagVis maps: <tt>etc/nagvis/maps/*.cfg</tt></li>
<li>Monitoring history of all supported cores:<ul>
<li><tt>var/check_mk/core/history</tt></li>
<li><tt>var/check_mk/core/archive/*</tt></li>
<li><tt>var/nagios/nagios.log</tt></li>
<li><tt>var/nagios/archive/*</tt></li>
</ul></li>
</ul>
In case you did such a rename action, you can stop your site and
fix the wrong names in the mentioned files on your own, e.g. by using
<tt>sed</tt>.
Change-Id: Ic5615546b3f2ef645b311e536cd2041bd4c16104
---
.werks/5205 | 31 +++++++++++++++++++++++++++++++
cmk_base/automations/check_mk.py | 15 +++++++--------
2 files changed, 38 insertions(+), 8 deletions(-)
diff --git a/.werks/5205 b/.werks/5205
new file mode 100644
index 0000000..cd1b6ec
--- /dev/null
+++ b/.werks/5205
@@ -0,0 +1,31 @@
+Title: Host rename: Fixed broken renaming when new name uses dots
+Level: 1
+Component: core
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1505123538
+
+When using the host rename feature of WATO and setting a new name that
+contains a dot, for example myhost.domain, the rename failed to set
+a correct new name. Instead of setting the intended name, the name was
+set to "myhost[.]domain" in different places.
+
+The affected files are:
+
+<ul>
+<li>Nagios core: <tt>var/nagios/retention.dat</tt></li>
+<li>NagVis maps: <tt>etc/nagvis/maps/*.cfg</tt></li>
+<li>Monitoring history of all supported cores:<ul>
+ <li><tt>var/check_mk/core/history</tt></li>
+ <li><tt>var/check_mk/core/archive/*</tt></li>
+ <li><tt>var/nagios/nagios.log</tt></li>
+ <li><tt>var/nagios/archive/*</tt></li>
+</ul></li>
+</ul>
+
+In case you did such a rename action, you can stop your site and
+fix the wrong names in the mentioned files on your own, e.g. by using
+<tt>sed</tt>.
diff --git a/cmk_base/automations/check_mk.py b/cmk_base/automations/check_mk.py
index cc38a55..288d8c1 100644
--- a/cmk_base/automations/check_mk.py
+++ b/cmk_base/automations/check_mk.py
@@ -342,7 +342,6 @@ class AutomationRenameHosts(Automation):
# This functions could be moved out of Check_MK.
def _omd_rename_host(self, oldname, newname):
oldregex = oldname.replace(".", "[.]")
- newregex = newname.replace(".", "[.]")
actions = []
# Temporarily stop processing of performance data
@@ -358,7 +357,7 @@ class AutomationRenameHosts(Automation):
# Fix pathnames in XML files
self.rename_host_in_files(os.path.join(cmk.paths.omd_root, "var/pnp4nagios/perfdata", oldname, "*.xml"),
"/perfdata/%s/" % oldregex,
- "/perfdata/%s/" % newregex)
+ "/perfdata/%s/" % newname)
# RRD files
if self._rename_host_dir(cmk.paths.omd_root + "/var/pnp4nagios/perfdata", oldname, newname):
@@ -371,17 +370,17 @@ 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|rrd)/%s/" % oldregex,
- "/\\1/%s/" % newregex,
+ "/\\1/%s/" % newname,
extended_regex=True):
actions.append("rrdcached")
# Spoolfiles of NPCD
if self.rename_host_in_files("%s/var/pnp4nagios/perfdata.dump" % cmk.paths.omd_root,
"HOSTNAME::%s " % oldregex,
- "HOSTNAME::%s " % newregex) or \
+ "HOSTNAME::%s " % newname) or \
self.rename_host_in_files("%s/var/pnp4nagios/spool/perfdata.*" % cmk.paths.omd_root,
"HOSTNAME::%s " % oldregex,
- "HOSTNAME::%s " % newregex):
+ "HOSTNAME::%s " % newname):
actions.append("pnpspool")
finally:
if rrdcache_running:
@@ -398,7 +397,7 @@ s/(INITIAL|CURRENT) (HOST|SERVICE) STATE: %(old)s;/\1 \2 STATE: %(new)s;/
s/(HOST|SERVICE) (DOWNTIME |FLAPPING |)ALERT: %(old)s;/\1 \2ALERT: %(new)s;/
s/PASSIVE (HOST|SERVICE) CHECK: %(old)s;/PASSIVE \1 CHECK: %(new)s;/
s/(HOST|SERVICE) NOTIFICATION: ([^;]+);%(old)s;/\1 NOTIFICATION: \2;%(new)s;/
-''' % { "old" : oldregex, "new" : newregex }
+''' % { "old" : oldregex, "new" : newname }
path_patterns = [
"var/check_mk/core/history",
"var/check_mk/core/archive/*",
@@ -423,7 +422,7 @@ s/(HOST|SERVICE) NOTIFICATION: ([^;]+);%(old)s;/\1 NOTIFICATION: \2;%(new)s;/
if config.monitoring_core == "nagios":
if self.rename_host_in_files("%s/var/nagios/retention.dat" % cmk.paths.omd_root,
"^host_name=%s$" % oldregex,
- "host_name=%s" % newregex,
+ "host_name=%s" % newname,
extended_regex=True):
actions.append("retention")
@@ -437,7 +436,7 @@ s/(HOST|SERVICE) NOTIFICATION: ([^;]+);%(old)s;/\1 NOTIFICATION: \2;%(new)s;/
# NagVis maps
if self.rename_host_in_files("%s/etc/nagvis/maps/*.cfg" % cmk.paths.omd_root,
"^[[:space:]]*host_name=%s[[:space:]]*$" % oldregex,
- "host_name=%s" % newregex,
+ "host_name=%s" % newname,
extended_regex=True):
actions.append("nagvis")
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
Module: check_mk
Branch: master
Commit: f93aab66082fdac2484fd95c5a4f7365e5ddd540
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f93aab66082fda…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Sep 11 11:18:36 2017 +0200
5203 FIX Removed sorting of perfometers
The user could interactively sort a view by the sorter by clicking on the column header. The
sorter was not sorting by the shown value(s), but was simply using the first perfdata value
of the service for sorting. This could be wrong since the base for the shown value is often
not the first perfdata value.
The broken sorting function has been removed now.
Maybe we could add a more intelligent sorting in the future. For the moment you can create
a custom view and add a sorter that sorts the view using a custom perfdata value.
Change-Id: I855f873bcf597d6c97f62b7c1fbda248b57c5d6d
---
.werks/5203 | 19 +++++++++++++++++++
web/plugins/views/perfometer.py | 1 -
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/.werks/5203 b/.werks/5203
new file mode 100644
index 0000000..8c3b0c2
--- /dev/null
+++ b/.werks/5203
@@ -0,0 +1,19 @@
+Title: Removed sorting of perfometers
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1505121322
+
+The user could interactively sort a view by the sorter by clicking on the column header. The
+sorter was not sorting by the shown value(s), but was simply using the first perfdata value
+of the service for sorting. This could be wrong since the base for the shown value is often
+not the first perfdata value.
+
+The broken sorting function has been removed now.
+
+Maybe we could add a more intelligent sorting in the future. For the moment you can create
+a custom view and add a sorter that sorts the view using a custom perfdata value.
diff --git a/web/plugins/views/perfometer.py b/web/plugins/views/perfometer.py
index 9e48662..f2077cc 100644
--- a/web/plugins/views/perfometer.py
+++ b/web/plugins/views/perfometer.py
@@ -207,7 +207,6 @@ multisite_painters["perfometer"] = {
"columns" : [ "service_perf_data", "service_state",
"service_check_command", "service_pnpgraph_present", "service_plugin_output" ],
"paint" : paint_perfometer,
- "sorter" : "svc_perf_val01",
"printable" : "perfometer", # Special rendering in PDFs
}
Module: check_mk
Branch: master
Commit: 822079232c6b64bc3794e802f9b205f172f7b8e9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=822079232c6b64…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Mon Sep 11 10:51:43 2017 +0200
4805 AIX agent can now output spool files as well
Change-Id: I7f45b130c943a11030d38bb1e0b16dafa0fcae29
---
.werks/4805 | 10 ++++++++++
agents/check_mk_agent.aix | 40 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 50 insertions(+)
diff --git a/.werks/4805 b/.werks/4805
new file mode 100644
index 0000000..f76f9fa
--- /dev/null
+++ b/.werks/4805
@@ -0,0 +1,10 @@
+Title: AIX agent can now output spool files as well
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1505119857
+Class: feature
+
+
diff --git a/agents/check_mk_agent.aix b/agents/check_mk_agent.aix
index 1a91b67..6f5f5a7 100755
--- a/agents/check_mk_agent.aix
+++ b/agents/check_mk_agent.aix
@@ -48,6 +48,10 @@ PLUGINSDIR=$MK_LIBDIR/plugins
# to online documentation for details.
LOCALDIR=$MK_LIBDIR/local
+# All files in SPOOLDIR will simply appended to the agent
+# output if they are not outdated (see below)
+SPOOLDIR=$MK_VARDIR/spool
+
#Avoid problems with wrong decimal separators in other language verions of aix
export LC_NUMERIC="en_US"
@@ -362,3 +366,39 @@ then
echo "(${PLUGIN##*/}) $descr $? $OUTPUT"
done
fi
+
+# Agent output snippets created by cronjobs, etc.
+if [ -d "$SPOOLDIR" ]
+then
+ pushd "$SPOOLDIR" > /dev/null
+ now=$(date +%s)
+
+ for file in *
+ do
+ # output every file in this directory. If the file is prefixed
+ # with a number, then that number is the maximum age of the
+ # file in seconds. If the file is older than that, it is ignored.
+ maxage=""
+ part="$file"
+
+ # Each away all digits from the front of the filename and
+ # collect them in the variable maxage.
+ while [ "${part/#[0-9]/}" != "$part" ]
+ do
+ maxage=$maxage${part:0:1}
+ part=${part:1}
+ done
+
+ # If there is at least one digit, than we honor that.
+ if [ "$maxage" ] ; then
+ mtime=$(stat -c %Y "$file")
+ if [ $((now - mtime)) -gt $maxage ] ; then
+ continue
+ fi
+ fi
+
+ # Output the file
+ cat "$file"
+ done
+ popd > /dev/null
+fi
Module: check_mk
Branch: master
Commit: 6c37f8f7de7505520cfc68b79d203b875cf991ab
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6c37f8f7de7505…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Sep 11 07:46:42 2017 +0200
5120 FIX ps, ps.perf: Fixed regex range introduced with werk 5114 which allows "/" in process name in manual checks
Change-Id: I98f87c43e38516621384601bb6fe13111292e87b
---
.werks/5120 | 11 +++++++++++
web/plugins/wato/check_parameters.py | 4 ++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/.werks/5120 b/.werks/5120
new file mode 100644
index 0000000..39e6cae
--- /dev/null
+++ b/.werks/5120
@@ -0,0 +1,11 @@
+Title: ps, ps.perf: Fixed regex range introduced with werk 5114 which allows "/" in process name in manual checks
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1505108567
+
+
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index e82ec6a..b89adce 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -3671,9 +3671,9 @@ register_check_parameters(
title = _("Process Name"),
help = _("This name will be used in the description of the service"),
allow_empty = False,
- regex = "^[a-zA-Z_0-9 _.-/]*$",
+ regex = "^[a-zA-Z_0-9 _./-]*$",
regex_error = _("Please use only a-z, A-Z, 0-9, space, underscore, "
- "dot and hyphon for your service description"),
+ "dot, hyphon and slash for your service description"),
),
"dict",
has_inventory = False,