Module: check_mk
Branch: master
Commit: f11a16faebc078dd29e0ee4e6b6854353fa79812
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f11a16faebc078…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Oct 29 14:03:57 2012 +0100
WATO: sites not used in distr. WATO being skipped when
determining the prefered peer
---
ChangeLog | 2 ++
web/htdocs/wato.py | 10 +++++++++-
2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e7831a6..2d7a325 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -110,6 +110,8 @@
list of explicit host/services in rules)
* FIX: fix inheritation of contactgroups from folder to hosts
* FIX: fix sorting of users, fix lost user alias in some situations
+ * FIX: Sites not using distritubed WATO now being skipped when determining
+ the prefered peer
BI:
* FIX: Correct representation of (!), (!!) and (?) markers in check output
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index ee4f436..b1b9dba 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -7343,7 +7343,15 @@ def preferred_peer():
if site.get("replication") == "slave":
continue # Ignore slave sites
- if best_peer == None or site.get("repl_priority",0) > best_peer.get("repl_priority",0) or (site_id < best_peer["id"] and site.get("repl_priority",0) == best_peer.get("repl_priority",0)):
+ if not site.get("replication") and not site_is_local(site_id):
+ continue # Ignore sites without distributed WATO
+
+ # a) No peer found yet
+ # b) Replication priority of current site is greater than best peer
+ # c) On same priority -> use higher alphabetical order
+ if best_peer == None \
+ or site.get("repl_priority",0) > best_peer.get("repl_priority",0) \
+ or (site_id < best_peer["id"] and site.get("repl_priority",0) == best_peer.get("repl_priority",0)):
best_peer = site
if site_is_local(site_id):
best_working_peer = site
Module: check_mk
Branch: master
Commit: 7cfa617b2ddfede21c087b91b7597655ac38bcd9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7cfa617b2ddfed…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Oct 29 09:22:22 2012 +0100
Updated bug entries #0872
---
.bugs/872 | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/.bugs/872 b/.bugs/872
new file mode 100644
index 0000000..2e5e4e3
--- /dev/null
+++ b/.bugs/872
@@ -0,0 +1,10 @@
+Title: Sidebar does not terminate refresh jobs of removed snapins
+Component: multisite
+State: open
+Date: 2012-10-29 09:20:48
+Targetversion: future
+Class: bug
+
+When having e.g. the speedometer in the sidebar and removing it, the javascript worker code
+remains fetching the speedometer webservice. The worker should detect that the snapin has
+been removed and stop updating the data.
Module: check_mk
Branch: master
Commit: 21b9ff3c4a42c761d063d59ecfddf9687cb12bff
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=21b9ff3c4a42c7…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Oct 29 13:24:57 2012 +0100
BI: Fixed bug with clusters in single host aggregation construct
---
web/htdocs/bi.py | 33 ++++++++++++++++++++++-----------
1 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/web/htdocs/bi.py b/web/htdocs/bi.py
index 69455f7..c8b5c16 100644
--- a/web/htdocs/bi.py
+++ b/web/htdocs/bi.py
@@ -361,14 +361,15 @@ def compile_forest(user, only_hosts = None, only_groups = None):
if aggr_type == AGGR_HOST:
# In normal cases a host aggregation has only one req_hosts item, we could use
# index 0 here. But clusters (which are also allowed now) have all their nodes
- # in the list of required nodes. The cluster node is always the last one in
- # this list.
- host = req_hosts[-1] # pair of (site, host)
- if not only_hosts or host in only_hosts:
- cache["host_aggregations"].setdefault(host, []).append((group, aggr))
+ # in the list of required nodes.
+ # Before the latest change this used the last item of the req_hosts. I think it
+ # would be better to register this for all hosts mentioned in req_hosts. Give it a try...
+ for host in req_hosts:
+ if not only_hosts or host in only_hosts:
+ cache["host_aggregations"].setdefault(host, []).append((group, aggr))
- # construct a list of compiled single-host aggregations for cached registration
- single_affected_hosts.append(host)
+ # construct a list of compiled single-host aggregations for cached registration
+ single_affected_hosts.append(host)
# All aggregations containing a specific host
for h in req_hosts:
@@ -646,17 +647,22 @@ def find_all_leaves(node):
else:
return []
+# Removes all empty nodes from the given rule tree
def remove_empty_nodes(node):
- if node["type"] != NT_RULE: # leaf node
+ if node["type"] != NT_RULE:
+ # simply return leaf nodes without action
return node
else:
subnodes = node["nodes"]
+ # loop all subnodes recursing down to the lowest level
for i in range(0, len(subnodes)):
remove_empty_nodes(subnodes[i])
+ # remove all subnode rules which have no subnodes
for i in range(0, len(subnodes))[::-1]:
if node_is_empty(subnodes[i]):
del subnodes[i]
+# Checks wether or not a rule node has no subnodes
def node_is_empty(node):
if node["type"] != NT_RULE: # leaf node
return False
@@ -774,7 +780,7 @@ def compile_aggregation_rule(aggr_type, rule, args, lvl):
needed_hosts.update(element.get("reqhosts", []))
aggregation = { "type" : NT_RULE,
- "reqhosts" : list(needed_hosts),
+ "reqhosts" : needed_hosts,
"title" : inst_description,
"func" : funcname,
"nodes" : elements}
@@ -783,9 +789,13 @@ def compile_aggregation_rule(aggr_type, rule, args, lvl):
if lvl == 0:
for hostspec, ref, placeholder in g_remaining_refs:
new_entries = find_remaining_services(hostspec, aggregation)
+ for entry in new_entries:
+ aggregation['reqhosts'].update(entry['reqhosts'])
where_to_put = ref.index(placeholder)
ref[where_to_put:where_to_put+1] = new_entries
+ aggregation['reqhosts'] = list(aggregation['reqhosts'])
+
return [ aggregation ]
@@ -884,8 +894,9 @@ def compile_leaf_node(host_re, service_re = config.HOST_STATE):
"title" : hostname})
elif service_re == config.REMAINING:
- found.append({"type" : NT_REMAINING,
- "host" : (site, hostname)})
+ found.append({"type" : NT_REMAINING,
+ "reqhosts" : [(site, hostname)],
+ "host" : (site, hostname)})
else:
# found.append({"type" : NT_LEAF,
Module: check_mk
Branch: master
Commit: 0985c6a7bcd3097f0a5b636203b086c0a713ba6a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0985c6a7bcd309…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Sun Oct 28 21:20:15 2012 +0100
logwatch: add some examples for critical errors
---
agents/logwatch.cfg | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/agents/logwatch.cfg b/agents/logwatch.cfg
index 4e2db0c..14c1628 100644
--- a/agents/logwatch.cfg
+++ b/agents/logwatch.cfg
@@ -39,6 +39,8 @@
W mdadm\[
W ata.*hard resetting link
W ata.*soft reset failed (.*FIS failed)
+ W device-mapper: thin:.*reached low water mark
+ C device-mapper: thin:.*no free space
/var/log/auth.log
W sshd.*Corrupted MAC on input
@@ -46,6 +48,7 @@
/var/log/syslog /var/log/kern.log
C panic
C Oops
+ W generic protection rip
W .*Unrecovered read error - auto reallocate failed
# Globbing patterns are allowed: