Module: check_mk
Branch: master
Commit: 14510c5c47d4878f3caad8d793717b0e19bbb664
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=14510c5c47d487…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Mar 1 12:53:32 2013 +0100
Updated bug entries #0903
---
.bugs/903 | 46 ++++++++++++++++++++--------------------------
1 files changed, 20 insertions(+), 26 deletions(-)
diff --git a/.bugs/903 b/.bugs/903
index 90acabf..ed3fd67 100644
--- a/.bugs/903
+++ b/.bugs/903
@@ -1,28 +1,22 @@
-Title: Umlauts in regexes never match
-Component: ec
-Class: bug
-State: done
-Date: 2013-01-31 11:14:47
-Targetversion: 1.2.2
+Title: Add user setting "low bandwidth mode"
+Component: multisite
+State: open
+Date: 2013-03-01 12:52:57
+Targetversion: future
+Class: feature
-When adding umlauts like ä to regex patterns, they do never match.
+die genutzten Background-Images im Multisite und PNP4Nagios schauen
+zwar schick aus, sorgen aber für reichlich Traffic bzw.
+Darstellungsverzögerung in unserer
+Windows-Terminal-Services/Citrix-Umgebung. Dies kann man z.B. auch beim
+VNC-Nutzung oder x-via-ssh reproduzieren.
-Was machen wir eigentlich, wenn die Enkodierung der eingehenden
-Events nicht klar ist? Vorschlag:
-
-Wir kodieren grundsatzlich von UTF-8 nach intern Unicode. Dabei
-dann aufpassen, dass auch die Konfiguration der Regeln immer
-Unicode verwendet (nicht TextAscii, sondern TextUnicode()).
-
-Wenn beim Enkodieren ein Fehler auftritt, dann nehmen wir
-latin1 an (bzw. Einstellbar als globale Option).
-
-try:
- text = text.decode('utf-8'
-except:
- text = text.decode(conifg.ec_fallback_encoding)
-
-
-2013-02-12 16:51:02: changed state open -> done
-Die mit dem try/except war eh schon drin. Allerdings hart-kodiert
-auf latin1.Denke wir lassen das vorerst so.
+Die Background-Images habe ich an folgenden Orten entfernt:
+./share/check_mk/web/htdocs/sidebar.css und dort background-color
+hinzugefügt (weil sonst weiß)
+./share/check_mk/web/htdocs/pages.css
+./share/pnp4nagios/htdocs/media/css/ui-multisite/jquery-ui.css
+Damit komme ich soweit zurecht.
+Vielleicht baut Ihr ja irgendwo einen Schalter ein, mittels dem die GUI
+leicht zwischen unterschiedlichen Grafik-Layouts umgeschalten werden
+kann.
Module: check_mk
Branch: master
Commit: 8719b3f28edd0fc4138e40f82982248bc2dc5971
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8719b3f28edd0f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Mar 1 12:41:23 2013 +0100
Updated bug entries #0901
---
.bugs/901 | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 65 insertions(+), 10 deletions(-)
diff --git a/.bugs/901 b/.bugs/901
index 74c993c..7fff5c3 100644
--- a/.bugs/901
+++ b/.bugs/901
@@ -1,14 +1,69 @@
-Title: uptime checks: add thresholds
-Component: checks
+Title: fix logwatch in mk_logwatch & check_mk_caching_agent & zei monitoring servers
+Component: core
State: open
-Date: 2013-01-22 14:53:09
-Targetversion: 1.4.0
-Class: feature
+Date: 2013-03-01 12:39:47
+Targetversion: future
+Class: bug
-The uptime checks should be consolidated to use the same check logics (uptime.include).
+Wir setzen omd 0.56 ein. Dabei haben wir eine test und eine prod
+instanz und transportieren config änderungen per svn von test nach prod.
-Add the following:
+Da wir diese zwei instanzen haben benutzen wir check_mk_caching_agent.
-- Thresholds (warn/crit for upper and lower limits)
-- WATO valuespec
-- update the check manpage
+Leider habe ich festgestellt, dass es unter bestimmten umständen
+sein kann, dass bei der verwendung von mk_logwatch die prod instanz
+ein log event "verpasst" weil die test instanz sich das schon abgeholt hat
+und zufälliger weise der agentcache expired war.
+
+Wir haben uns jetzt so beholfen, das wir die environment variable per ssh
+über sudo mit ans mk_logwatch weitereichen, aber das ist alles andere als schön
+und es muss sehr viel konfiguriert werden, habt ihr da eine bessere idee ?
+
+
+
+danke & gruss
+jodok
+
+
+
+
+Hier unser Workaround
+
+Es es werden pro monitoring instanz ein /etc/check_mk/logwatch.state.$OMD
+_SITE gepflegt.
+Dies ist leider sehr aufwändig, da die Umgebungsvariable OMD_SITE muss vom server an den client durchgereicht werden muss,
+d.h. ssh-agent statt xinetd (durch flag „ssh-agent“), anpassen von /etc/ssh/sshd_config, anpassen von /etc/sudoers, patchen von mk_logwatch
+
+Anpassungen
+
+Auf dem Nagios Server in ~/.ssh/config für die monitoring instanz (test,prod)
+
+SendEnv OMD_SITE
+
+Auf dem Client in /etc/ssh/sshd_config
+
+AcceptEnv OMD_SITE
+
+Auf dem Client in der /etc/sudoers (visudo)
+
+Defaults always_set_home
+Defaults env_reset
+Defaults env_keep += "OMD_SITE"
+...
+nagios ALL=(root) NOPASSWD: /usr/bin/check_mk_caching_agent
+
+/usr/lib/check_mk_agent/plugins/mk_logwatch patchen
+
+58c58
+<
+---
+> site = str(os.environ.get("OMD_SITE"))
+60c60
+< status_filename = logwatch_dir + "/logwatch.state"
+---
+> status_filename = logwatch_dir + "/logwatch.state." + site
+
+
+
+PS wir machen in user ~nagios/.ssh/authorized_keys sowas:
+command="/usr/bin/sudo /usr/bin/check_mk_caching_agent" ssh-rsa AAAAB3Nz
Module: check_mk
Branch: master
Commit: ab3785d5be54aac83aa3ab8aa1d97e4e94e96639
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ab3785d5be54aa…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Mar 1 12:41:42 2013 +0100
Updated bug entries #0901
---
.bugs/901 | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/.bugs/901 b/.bugs/901
index 7fff5c3..d725161 100644
--- a/.bugs/901
+++ b/.bugs/901
@@ -19,14 +19,6 @@ Wir haben uns jetzt so beholfen, das wir die environment variable per ssh
über sudo mit ans mk_logwatch weitereichen, aber das ist alles andere als schön
und es muss sehr viel konfiguriert werden, habt ihr da eine bessere idee ?
-
-
-danke & gruss
-jodok
-
-
-
-
Hier unser Workaround
Es es werden pro monitoring instanz ein /etc/check_mk/logwatch.state.$OMD
Module: check_mk
Branch: master
Commit: 5ca7aaaa8c3ac18993610725fbb2b7963b1ff507
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5ca7aaaa8c3ac1…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Mar 1 12:16:27 2013 +0100
FIX: single host aggregations didnt work for aggregations += [...]
---
ChangeLog | 1 +
web/htdocs/bi.py | 6 ++++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 2c84343..1e04ed6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -89,6 +89,7 @@
* FIX: fix styling of top/down and bottom/up views (borders, padding)
* FIX: fix style of mouse pointer over BI boxes
* FIX: list of BI aggregates was incomplete in some cases
+ * FIX: single host aggregations didn't work for aggregations += [...]
* Make titles of non-leaf tree nodes klickable
WATO:
diff --git a/web/htdocs/bi.py b/web/htdocs/bi.py
index 3e2de1a..78a6961 100644
--- a/web/htdocs/bi.py
+++ b/web/htdocs/bi.py
@@ -376,6 +376,7 @@ def compile_forest(user, only_hosts = None, only_groups = None):
# 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...
+ # ASSERT: len(req_hosts) == 1!
for host in req_hosts:
if not only_hosts or host in only_hosts:
cache["host_aggregations"].setdefault(host, []).append((group, aggr))
@@ -383,6 +384,11 @@ def compile_forest(user, only_hosts = None, only_groups = None):
# construct a list of compiled single-host aggregations for cached registration
single_affected_hosts.append(host)
+ # Also all other aggregations that contain exactly one hosts are considered to
+ # be "single host aggregations"
+ elif len(req_hosts) == 1:
+ cache["host_aggregations"].setdefault(req_hosts[0], []).append((group, aggr))
+
# All aggregations containing a specific host
for h in req_hosts:
cache["affected_hosts"].setdefault(h, []).append((group, aggr))
Module: check_mk
Branch: master
Commit: 9d81359a199ed7e54ba2f94013fecaae0879163f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9d81359a199ed7…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Mar 1 12:15:36 2013 +0100
FIX: list of BI aggregates was incomplete in some cases
---
ChangeLog | 3 +-
web/htdocs/bi.py | 61 +++++++++++++++++++++++++++++++-----------------------
2 files changed, 37 insertions(+), 27 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8062d53..2c84343 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -51,8 +51,8 @@
* FIX: no default PING service if custom checks are defined
* FIX: check_mk_base: fixed rounding error in get_bytes_human_readable
* FIX: check_mk: improved support of utf-8 characters in extra_service_conf
- * New configuration variable contactgroup_members
* FIX: livestatus: table statehist now able to check AuthUser permissions
+ * New configuration variable contactgroup_members
Checks & Agents:
* FIX: smart - not trying to parse unhandled lines to prevent errors
@@ -88,6 +88,7 @@
* FIX: fix exception in top/down and bottom/up views
* FIX: fix styling of top/down and bottom/up views (borders, padding)
* FIX: fix style of mouse pointer over BI boxes
+ * FIX: list of BI aggregates was incomplete in some cases
* Make titles of non-leaf tree nodes klickable
WATO:
diff --git a/web/htdocs/bi.py b/web/htdocs/bi.py
index 671410d..3e2de1a 100644
--- a/web/htdocs/bi.py
+++ b/web/htdocs/bi.py
@@ -121,7 +121,6 @@ NT_PLACEHOLDER = 4 # temporary dummy entry needed for REMAINING
g_cache = {} # per-user cache
g_config_information = None # for invalidating cache after config change
did_compilation = False # Is set to true if anything has been compiled
-g_compiled_everything = False # Is set to true if all aggregations have been compiled
# Load the static configuration of all services and hosts (including tags)
# without state.
@@ -211,47 +210,57 @@ def log(s):
# aggregation functions are still left as names. That way the forest
# printable (and storable in Python syntax to a file).
def compile_forest(user, only_hosts = None, only_groups = None):
- global g_cache, g_user_cache, g_compiled_everything
+ global g_cache, g_user_cache
global used_cache, did_compilation
new_config_information = cache_needs_update()
- if new_config_information \
- or (config.bi_precompile_on_demand and not only_groups and not only_hosts):
- # config changed or monitoring daemon restarted, clear cache.
- # or: in case of on demand precompile and a total compilation
- # requested (even if some hosts have already be compiled).
+ if new_config_information:
+ log("Configuration has changed. Forcing recompile.\n")
g_cache = {}
global g_config_information
g_config_information = new_config_information
- g_compiled_everything = False
-
- if g_compiled_everything:
- log('PID: %d - Already compiled everything\n' % os.getpid())
- used_cache = True
- return # In this case simply skip further compilations
# OPTIMIZE: All users that have the permissing bi.see_all
# can use the same cache.
if config.may("bi.see_all"):
user = '<<<see_all>>>'
- # Try to get data from per-user cache:
- # make sure, BI permissions have not changed since last time
- cache = g_cache.get(user)
- if cache and cache["see_all"] == config.may("bi.see_all"):
- g_user_cache = cache
- else:
- # Initialize empty caching structure
- cache = {
+ def empty_user_cache():
+ return {
"forest" : {},
"aggregations_by_hostname" : {},
"host_aggregations" : {},
"affected_hosts" : {},
"affected_services": {},
- "see_all" : config.may("bi.see_all"),
"compiled_hosts" : set([]),
- "compiled_groups": set([]),
+ "compiled_groups" : set([]),
+ "compiled_all" : False,
}
+
+ # Try to get data from per-user cache:
+ # make sure, BI permissions have not changed since last time.
+ # g_user_cache is a global variable for all succeeding functions, so
+ # that they do not need to check the user again
+ cache = g_cache.get(user)
+ if cache:
+ g_user_cache = cache
+ else:
+ # Initialize empty caching structure
+ cache = empty_user_cache()
+ g_user_cache = cache
+
+ if g_user_cache["compiled_all"]:
+ log('PID: %d - Already compiled everything\n' % os.getpid())
+ used_cache = True
+ return # In this case simply skip further compilations
+
+ # If we have previously only partly compiled and now there is no
+ # filter, then throw away partly compiled data.
+ if (cache["compiled_hosts"] or cache["compiled_groups"]) \
+ and (not config.bi_precompile_on_demand \
+ or (config.bi_precompile_on_demand and not only_groups and not only_hosts)):
+ log("Invalidating incomplete cache, since we compile all now.\n")
+ cache = empty_user_cache()
g_user_cache = cache
# Reduces a list of hosts by the already compiled hosts
@@ -395,8 +404,7 @@ def compile_forest(user, only_hosts = None, only_groups = None):
# The list of ALL hosts
cache['compiled_hosts'] = set(g_services.keys())
cache['compiled_groups'] = set(cache['forest'].keys())
-
- g_compiled_everything = True
+ cache['compiled_all'] = True
# Remember successful compile in cache
g_cache[user] = cache
@@ -436,7 +444,7 @@ def compile_forest(user, only_hosts = None, only_groups = None):
num_new_multi_aggrs, num_new_host_aggrs,
only_groups and len(only_groups) or 0,
- g_compiled_everything,
+ cache['compiled_all'],
num_total_aggr - num_host_aggr,
num_host_aggr,
len(cache['compiled_groups']),
@@ -1701,6 +1709,7 @@ def singlehost_table(columns, add_headers, only_sites, limit, filters, joinbynam
host_columns = filter(lambda c: c.startswith("host_"), columns)
hostrows = get_status_info_filtered(filter_code, only_sites, limit, host_columns, config.bi_precompile_on_demand)
+
# if limit:
# views.check_limit(hostrows, limit)