Module: check_mk
Branch: master
Commit: 456f2efa8d17a7d0d3ee8c1b964dd0fd7ea7ec14
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=456f2efa8d17a7…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Tue Jan 3 11:11:22 2017 +0100
4183 FIX ibm_imm_fan: Fixed crash if fan speed is "unavailable"
If the value for speed is "unavailable" the behaviour is now similar to
"offline": The state becomes CRIT and the status detail shows the output "is unvailable".
Change-Id: Ic5f1a7531a6c4b15feb76c0ab88c94f93c743d63
---
.werks/4183 | 11 +++++++++++
ChangeLog | 1 +
checks/ibm_imm_fan | 4 ++--
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/4183 b/.werks/4183
new file mode 100644
index 0000000..feb888e
--- /dev/null
+++ b/.werks/4183
@@ -0,0 +1,11 @@
+Title: ibm_imm_fan: Fixed crash if fan speed is "unavailable"
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i4
+Date: 1483438073
+Class: fix
+
+If the value for speed is "unavailable" the behaviour is now similar to
+"offline": The state becomes CRIT and the status detail shows the output "is unvailable".
+
diff --git a/ChangeLog b/ChangeLog
index 5edbf5d..1794caa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,6 +26,7 @@
* 4122 FIX: ibm_svc_enclosure: added support for firmware >= 7.8...
* 4182 FIX: mysql_slave: fixed crash if agent output is empty...
* 4176 FIX: postfix_mailq_status: fixed wrong status handling
+ * 4183 FIX: ibm_imm_fan: Fixed crash if fan speed is "unavailable"...
Multisite:
* 4169 View action: Default values of sticky, notification and persistent options can now be configured via global settings....
diff --git a/checks/ibm_imm_fan b/checks/ibm_imm_fan
index 82f2a9a..a9bf705 100644
--- a/checks/ibm_imm_fan
+++ b/checks/ibm_imm_fan
@@ -40,8 +40,8 @@ def check_ibm_imm_fan(item, params, info):
for descr, speed_text in info:
if descr == item:
- if speed_text.lower() == "offline":
- yield 2, "is offline"
+ if speed_text.lower() in ["offline", "unavailable"]:
+ yield 2, "is %s" % speed_text.lower()
return
# speed_text can be "34 %", or "34%", or "34 % of maximum"
Module: check_mk
Branch: master
Commit: c3414e743ad87dc7ccddf7fed87850d6ee07b477
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c3414e743ad87d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jan 9 13:10:44 2017 +0100
Changed behaviour of "used ruleset" page to work like before recode
Change-Id: I78b83a0efd286f0eada4206ab3d5e3856e0c3fb9
---
web/htdocs/watolib.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index d59cf46..a1b2309 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -6313,7 +6313,7 @@ class Ruleset(object):
if "ruleset_deprecated" in search_options and search_options["ruleset_deprecated"] != self.is_deprecated():
return False
- if "ruleset_used" in search_options and search_options["ruleset_used"] == self.is_empty_in_folder(Folder.current()):
+ if "ruleset_used" in search_options and search_options["ruleset_used"] == self.is_empty():
return False
if "ruleset_group" in search_options \
Module: check_mk
Branch: master
Commit: 8d1bb26249e89bb660f04edabacb882a192de481
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8d1bb26249e89b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jan 9 11:55:34 2017 +0100
4202 FIX Availability now avoids pending states for times before new hosts or services were added
When computing the availability of a BI aggregation for a time range during
which new hosts or services were added to the monitoring the state of these
objects would be displayed as (PEND) before point of time they were added. But
this is not correct. These objects where not pending but simply not yet
existing and thus not contained in the aggregation tree at all at that time.
When computing a BI state it is a big difference if something is pending
or simply not existing. One pending node can make the total tree state also
(PEND). While this is correct in the current monitoring it breaks the
availability computation.
BI availability has now been fixed so that unmonitored hosts and services
are correctly being removed from the tree in the according time ranges and
the real state at that time is reconstructed. That way bogus (PEND) phases
of BI aggregations are being avoided.
Change-Id: I6772fdcb562b67738044bc22aa3cd2a09add6873
---
.werks/4202 | 23 +++++++++++++++++++++++
ChangeLog | 3 +++
web/htdocs/availability.py | 14 ++++++++++----
web/htdocs/bi.py | 14 +++++++++-----
4 files changed, 45 insertions(+), 9 deletions(-)
diff --git a/.werks/4202 b/.werks/4202
new file mode 100644
index 0000000..b9246e3
--- /dev/null
+++ b/.werks/4202
@@ -0,0 +1,23 @@
+Title: Availability now avoids pending states for times before new hosts or services were added
+Level: 1
+Component: bi
+Compatible: compat
+Version: 1.4.0i4
+Date: 1483958830
+Class: fix
+
+When computing the availability of a BI aggregation for a time range during
+which new hosts or services were added to the monitoring the state of these
+objects would be displayed as (PEND) before point of time they were added. But
+this is not correct. These objects where not pending but simply not yet
+existing and thus not contained in the aggregation tree at all at that time.
+
+When computing a BI state it is a big difference if something is pending
+or simply not existing. One pending node can make the total tree state also
+(PEND). While this is correct in the current monitoring it breaks the
+availability computation.
+
+BI availability has now been fixed so that unmonitored hosts and services
+are correctly being removed from the tree in the according time ranges and
+the real state at that time is reconstructed. That way bogus (PEND) phases
+of BI aggregations are being avoided.
diff --git a/ChangeLog b/ChangeLog
index 24d2ca0..5edbf5d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -51,6 +51,9 @@
Notifications:
* 4197 FIX: Fix sending notification to global fallback email address
+ BI:
+ * 4202 FIX: Availability now avoids pending states for times before new hosts or services were added...
+
Reporting & Availability:
* 3652 FIX: Unbreak PDF exports...
diff --git a/web/htdocs/availability.py b/web/htdocs/availability.py
index 3094d34..67f51bc 100644
--- a/web/htdocs/availability.py
+++ b/web/htdocs/availability.py
@@ -1681,13 +1681,16 @@ def compute_bi_tree_state(tree, status):
for site_host_service, state_output in status.items():
site_host = site_host_service[:2]
service = site_host_service[2]
+ state = state_output[0]
+ if state == -1:
+ state = None # Means: consider this object as missing
if service:
services_by_host.setdefault(site_host, []).append((
service, # service description
- state_output[0], # state
+ state,
1, # has_been_checked
state_output[1], # output
- state_output[0], # hard state (we use the soft state here)
+ state, # hard state (we use the soft state here)
1, # attempt
1, # max_attempts (not relevant)
state_output[2], # in_downtime
@@ -1699,9 +1702,12 @@ def compute_bi_tree_state(tree, status):
status_info = {}
for site_host, state_output in hosts.items():
+ state = state_output[0]
+ if state == -1:
+ state = None # Means: consider this object as missing
status_info[site_host] = [
- state_output[0],
- state_output[0], # host hard state
+ state,
+ state, # host hard state
state_output[1],
state_output[2], # in_downtime
False, # acknowledged
diff --git a/web/htdocs/bi.py b/web/htdocs/bi.py
index 74a987d..80fcaa0 100644
--- a/web/htdocs/bi.py
+++ b/web/htdocs/bi.py
@@ -2463,6 +2463,8 @@ def execute_rule_node(node, status_info, aggregation_options):
one_assumption = False
for n in node["nodes"]:
result = execute_node(n, status_info, aggregation_options) # state, assumed_state, node [, subtrees]
+ if result[0]["state"] == None: # Omit this node (used in availability for unmonitored things)
+ continue
subtrees.append(result)
# Assume items in downtime as CRIT when computing downtime state
@@ -2486,10 +2488,12 @@ def execute_rule_node(node, status_info, aggregation_options):
# no assumption, take real state into assumption array
assumed_states.append(node_states[-1])
- state = func(*([node_states] + funcargs))
-
- # Compute downtime state
- downtime_state = func(*([downtime_states] + funcargs))
+ if len(node_states) == 0:
+ state = { "state": None, "output" : _("Not yet monitored") }
+ downtime_state = state
+ else:
+ state = func(*([node_states] + funcargs))
+ downtime_state = func(*([downtime_states] + funcargs))
if aggregation_options["downtime_aggr_warn"]:
state["in_downtime"] = downtime_state["state"] >= 1
@@ -3018,7 +3022,7 @@ def aggr_render_node(tree, title, show_host, mousecode=None, img_class=None):
_("This element is currently not in its service period.")) + title
h = '<span class="content state state%d%s">%s</span>\n' \
- % (effective_state["state"], addclass, render_bi_state(effective_state["state"]))
+ % (effective_state["state"] if effective_state["state"] != None else -1, addclass, render_bi_state(effective_state["state"]))
if mousecode:
if img_class:
h += '<img src="images/tree_black_closed.png" class="treeangle %s"%s>' % \