Module: check_mk
Branch: master
Commit: 522908a0c5dd572d331e254ce43f7253e87042f2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=522908a0c5dd57…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon May 30 08:46:41 2016 +0200
3580 The macro $HOSTNAME$ is now available for host checks which are based on service states
---
.werks/3580 | 9 +++++++++
ChangeLog | 1 +
modules/check_mk.py | 4 +++-
web/plugins/wato/check_mk_configuration.py | 2 ++
4 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/.werks/3580 b/.werks/3580
new file mode 100644
index 0000000..d307958
--- /dev/null
+++ b/.werks/3580
@@ -0,0 +1,9 @@
+Title: The macro $HOSTNAME$ is now available for host checks which are based on service states
+Level: 1
+Component: core
+Compatible: compat
+Version: 1.2.9i1
+Date: 1464590736
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 2d938a2..ca6847f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
* 3342 MKP: local/lib and local/bin of sites can now be packed...
* 3114 linux and windows agent can now be configured to directly encrypt their output. For real-time updates encryption is now optional (but active per default)...
* 3531 Reduced Check_MK helper size for certain dists/python versions...
+ * 3580 The macro $HOSTNAME$ is now available for host checks which are based on service states
* 3193 FIX: Fixed fake check results for hosts...
* 3214 FIX: Removing SNMP checks for non SNMP hosts and agent based checks for non agent hosts...
* 3220 FIX: Check_MK HW/SW Inventory is now always disabled for "No Agent" hosts
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 1d0762d..c5c1de1 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -1200,7 +1200,9 @@ def host_check_command(hostname, ip, is_clust):
return "check-mk-host-service!" + service
command = "check-mk-host-custom-%d" % (len(hostcheck_commands_to_define) + 1)
hostcheck_commands_to_define.append((command,
- 'echo "$SERVICEOUTPUT:%s:%s$" && exit $SERVICESTATEID:%s:%s$' % (hostname, service, hostname, service)))
+ 'echo "$SERVICEOUTPUT:%s:%s$" && exit $SERVICESTATEID:%s:%s$' %
+ (hostname, service.replace('$HOSTNAME$', hostname),
+ hostname, service.replace('$HOSTNAME$', hostname))))
return command
elif value[0] == "tcp":
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index d613ff9..8497233 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -1499,6 +1499,8 @@ register_rule(
size = 45,
allow_empty = False,
attrencode = True,
+ help = _("You can use the macro <tt>$HOSTNAME$</tt> here. It will be replaced "
+ "with the name of the current host."),
)),
( "custom", _("Use a custom check plugin..."), PluginCommandLine() ),
],
Module: check_mk
Branch: master
Commit: 561a69967721d500eab7e39a79d42fa284c11cad
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=561a69967721d5…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri May 27 13:30:50 2016 +0200
updated werk
---
.werks/3612 | 2 +-
ChangeLog | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.werks/3612 b/.werks/3612
index 750a21e..8ad3684 100644
--- a/.werks/3612
+++ b/.werks/3612
@@ -1,4 +1,4 @@
-Title: nfsmounts: now has performance data
+Title: nfsmounts: new rule for en/disabling performance data
Level: 1
Component: checks
Compatible: compat
diff --git a/ChangeLog b/ChangeLog
index 88449ce..fad9e46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -87,7 +87,7 @@
* 3137 linux and solaris agent: mrpe checks now support option to append the cache age to cached results...
* 3610 mk_oracle: linux plugin now available for solaris
* 3611 websphere_mq_queues: now age of messages not processed is configurable...
- * 3612 nfsmounts: now has performance data
+ * 3612 nfsmounts: new rule for en/disabling performance data
* 3073 FIX: windows agent: relative paths to mrpe scripts are now treated as relative to the agent installation directory...
* 3061 FIX: mk_jolokia: Fixed debugging of the agent plugin
* 3074 FIX: windows agent: fixed incorrect values for 32-bit performance counters
Module: check_mk
Branch: master
Commit: 07b01a515777a549ba573be960a47be94f06a24a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=07b01a515777a5…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri May 27 13:29:34 2016 +0200
3614 FIX Outage statistics for hosts now also work in PDF reports
If you created a PDF report containing an availability table of hosts with some of the
outage statistics contained, then these were missing. This problem did not arise when
you did an PDF export or simply added an availability table to an existing report via
the context menu.
---
.werks/3614 | 13 +++++++++++++
ChangeLog | 1 +
web/htdocs/availability.py | 18 +++++++++++++++---
web/plugins/views/availability.py | 6 ------
4 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/.werks/3614 b/.werks/3614
new file mode 100644
index 0000000..db0c4e9
--- /dev/null
+++ b/.werks/3614
@@ -0,0 +1,13 @@
+Title: Outage statistics for hosts now also work in PDF reports
+Level: 1
+Component: reporting
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1464348499
+
+If you created a PDF report containing an availability table of hosts with some of the
+outage statistics contained, then these were missing. This problem did not arise when
+you did an PDF export or simply added an availability table to an existing report via
+the context menu.
diff --git a/ChangeLog b/ChangeLog
index 7092265..88449ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -427,6 +427,7 @@
* 3332 FIX: Avoid falling back to annotation edit form when reloading page directly after editing
* 3393 FIX: Availability annotations: also show annotations for hosts when showing services
* 3415 FIX: Availability option "Visual levels for the availability" not longer enables itself...
+ * 3614 FIX: Outage statistics for hosts now also work in PDF reports...
Event Console:
* 2999 The contact name is now included in Event Console notifications...
diff --git a/web/htdocs/availability.py b/web/htdocs/availability.py
index cb3a0d3..9c1dbd8 100644
--- a/web/htdocs/availability.py
+++ b/web/htdocs/availability.py
@@ -531,6 +531,18 @@ def get_default_avoptions():
},
}
+def get_outage_statistic_options(avoptions):
+ # Outage options are stored with keys matching service states (like "ok" and "crit").
+ # For hosts we use the same checkbox but mean "up" and "down". We simply add these states
+ # to the list of selected states.
+ aggrs, states = avoptions.get("outage_statistics", ([], []))
+ fixed_states = states[:]
+ for os, oh in [ ("ok","up"), ("crit","down"), ("unknown", "unreach") ]:
+ if os in fixed_states:
+ fixed_states.append(oh)
+ return aggrs, fixed_states
+
+
#.
# .--Computation---------------------------------------------------------.
# | ____ _ _ _ |
@@ -633,7 +645,7 @@ def compute_availability(what, av_rawdata, avoptions):
# 2.2.2.2.3 "crit"
# 2.2.2.2.4 "unknown"
availability_table = []
- os_aggrs, os_states = avoptions.get("outage_statistics", ([],[]))
+ os_aggrs, os_states = get_outage_statistic_options(avoptions)
need_statistics = os_aggrs and os_states
grouping = avoptions["grouping"]
timeline_rows = [] # Need this as a global variable if just one service is affected
@@ -1091,7 +1103,7 @@ def layout_availability_table(what, group_title, availability_table, avoptions):
# Headers for availability cells
av_table["cell_titles"] = []
- os_aggrs, os_states = avoptions.get("outage_statistics", ([],[]))
+ os_aggrs, os_states = get_outage_statistic_options(avoptions)
for sid, css, sname, help in availability_columns[what]:
if not cell_active(sid, avoptions):
continue
@@ -1183,7 +1195,7 @@ def layout_availability_table(what, group_title, availability_table, avoptions):
# Statistics?
x_cnt, x_min, x_max = entry["statistics"].get(sid, (None, None, None))
- os_aggrs, os_states = avoptions.get("outage_statistics", ([],[]))
+ os_aggrs, os_states = get_outage_statistic_options(avoptions)
if sid in os_states:
for aggr in os_aggrs:
if x_cnt != None:
diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py
index b2b78de..34961d0 100644
--- a/web/plugins/views/availability.py
+++ b/web/plugins/views/availability.py
@@ -106,12 +106,6 @@ def render_availability_options(what):
if html.form_submitted():
config.save_user_file("avoptions", avoptions)
- # Convert outage-options from service to host
- states = avoptions["outage_statistics"][1]
- for os, oh in [ ("ok","up"), ("crit","down"), ("unknown", "unreach") ]:
- if os in states:
- states.append(oh)
-
return avoptions