Module: check_mk
Branch: master
Commit: 207cb89c7802b4dbbdcfb7b9f024915aa8b89dc5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=207cb89c7802b4…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Fri Nov 28 17:04:09 2014 +0100
#1518 raritan_pdu_inlet, raritan_pdu_inlet_summary: Modified existing check to give one item per phase and support setting levels.
raritan_pdu_inlet used to create one item per sensor. Now, only one item per phase is created.
A Perf-O-Meter displaying the power has been added, as well as a WATO rule to configure
warning and critical levels.
raritan_pdu_inlet_summary works very similarily, but provides summary information concerning all
phases.
---
.werks/1518 | 13 ++++++
ChangeLog | 2 +
checkman/raritan_pdu_inlet | 25 ++++++-----
checkman/raritan_pdu_inlet_summary | 30 +++++++++++++
checks/elphase.include | 78 +++++++++++++++++++++++++++++++++-
checks/raritan_pdu_inlet | 1 +
checks/raritan_pdu_inlet.include | 6 +--
checks/raritan_pdu_inlet_summary | 1 +
web/plugins/perfometer/check_mk.py | 9 ++++
web/plugins/wato/check_parameters.py | 48 ++++++++++++++++++++-
10 files changed, 197 insertions(+), 16 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=207cb89c78…
Module: check_mk
Branch: master
Commit: f7d5d8f7fab52d09cc6075e5d8c190c7eb3d0487
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f7d5d8f7fab52d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Nov 28 15:06:56 2014 +0100
New ValuSpec for absolut directory names
---
web/htdocs/valuespec.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 513687c..24a7c41 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -569,6 +569,12 @@ class Hostname(TextAscii):
self._regex = re.compile('^[-0-9a-zA-Z_.]+$')
self._regex_error = _("Please enter a valid hostname or IPv4 address.")
+class AbsoluteDirname(TextAscii):
+ def __init__(self, **kwargs):
+ TextAscii.__init__(self, **kwargs)
+ self._regex = re.compile('^(/|(/[^/]+)+)$')
+ self._regex_error = _("Please enter a valid absolut pathname with / as a path separator.")
+
# Valuespec for a HTTP Url (not HTTPS), that
# automatically adds http:// to the value
@@ -653,6 +659,7 @@ class TextAreaUnicode(TextUnicode):
# A variant of TextAscii() that validates a path to a filename that
# lies in an existing directory.
+# TODO: Rename the valuespec here to ExistingFilename or somehting similar
class Filename(TextAscii):
def __init__(self, **kwargs):
TextAscii.__init__(self, **kwargs)
Module: check_mk
Branch: master
Commit: f436721a492879bf20819d43fc8fc06921ffcd5b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f436721a492879…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Nov 28 10:13:45 2014 +0100
#1539 FIX Fixed refreshing of PNP graphs in dashboards
The PNP graphs contained in dashboards were not refreshed as intended.
Now they are refreshed in the hard coded default interval of 60 seconds.
This will be configurable soon.
---
.werks/1539 | 12 ++++++++++++
ChangeLog | 1 +
web/htdocs/dashboard.py | 4 ++--
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/.werks/1539 b/.werks/1539
new file mode 100644
index 0000000..c0c6f26
--- /dev/null
+++ b/.werks/1539
@@ -0,0 +1,12 @@
+Title: Fixed refreshing of PNP graphs in dashboards
+Level: 2
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.5i7
+Date: 1417165950
+
+The PNP graphs contained in dashboards were not refreshed as intended.
+Now they are refreshed in the hard coded default interval of 60 seconds.
+This will be configurable soon.
diff --git a/ChangeLog b/ChangeLog
index 7a864d2..7378e93 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -77,6 +77,7 @@
* 1553 FIX: Fix deleting (acknowleding) of logfiles in logwatch...
* 1537 FIX: Added transformation code for user dashboards created between 2014-08 and 2014-10...
* 1538 FIX: Only allow switching sites on/off when permitted to...
+ * 1539 FIX: Fixed refreshing of PNP graphs in dashboards...
WATO:
* 1170 Added buttons to move rules to top/bottom of the list to ruleset edit dialog
diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py
index 00127f5..aaf083f 100644
--- a/web/htdocs/dashboard.py
+++ b/web/htdocs/dashboard.py
@@ -376,8 +376,8 @@ def render_dashboard(name):
# dashlets using static content (such as an iframe) will not be
# refreshed by us but need to do that themselves.
if "url" in dashlet or ('render' in dashlet_type and dashlet_type.get('refresh')):
- url = dashlet.get("url", "dashboard_dashlet.py?name="+name+"&id="+ str(nr));
- refresh = dashlet.get("refresh")
+ url = dashlet.get("url", "dashboard_dashlet.py?name="+name+"&id="+ str(nr))
+ refresh = dashlet.get("refresh", dashlet_type.get("refresh"))
if refresh:
# FIXME: remove add_wato_folder_to_url
refresh_dashlets.append([nr, refresh, str(add_wato_folder_to_url(url, wato_folder))])
Module: check_mk
Branch: master
Commit: 2ed0a3438324e89bce210ea128db853eed198805
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2ed0a3438324e8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Nov 28 10:01:06 2014 +0100
#1538 FIX Only allow switching sites on/off when permitted to
The permission check was missing in the action processing server component.
---
.werks/1538 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/html_mod_python.py | 23 ++++++++++++-----------
3 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/.werks/1538 b/.werks/1538
new file mode 100644
index 0000000..594fcd2
--- /dev/null
+++ b/.werks/1538
@@ -0,0 +1,9 @@
+Title: Only allow switching sites on/off when permitted to
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417165211
+Class: fix
+
+The permission check was missing in the action processing server component.
diff --git a/ChangeLog b/ChangeLog
index d1fd67a..7a864d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -76,6 +76,7 @@
* 1534 FIX: Fixed filtering views in distributed setup lead to empty views...
* 1553 FIX: Fix deleting (acknowleding) of logfiles in logwatch...
* 1537 FIX: Added transformation code for user dashboards created between 2014-08 and 2014-10...
+ * 1538 FIX: Only allow switching sites on/off when permitted to...
WATO:
* 1170 Added buttons to move rules to top/bottom of the list to ruleset edit dialog
diff --git a/web/htdocs/html_mod_python.py b/web/htdocs/html_mod_python.py
index 94f594f..1d9dc24 100644
--- a/web/htdocs/html_mod_python.py
+++ b/web/htdocs/html_mod_python.py
@@ -233,17 +233,18 @@ def connect_to_livestatus():
# Also honor HTML-variables for switching off sites
# right now. This is generally done by the variable
# _site_switch=sitename1:on,sitename2:off,...
- switch_var = html.var("_site_switch")
- if switch_var:
- for info in switch_var.split(","):
- sitename, onoff = info.split(":")
- d = config.user_siteconf.get(sitename, {})
- if onoff == "on":
- d["disabled"] = False
- else:
- d["disabled"] = True
- config.user_siteconf[sitename] = d
- config.save_site_config()
+ if config.may("sidesnap.sitestatus"):
+ switch_var = html.var("_site_switch")
+ if switch_var:
+ for info in switch_var.split(","):
+ sitename, onoff = info.split(":")
+ d = config.user_siteconf.get(sitename, {})
+ if onoff == "on":
+ d["disabled"] = False
+ else:
+ d["disabled"] = True
+ config.user_siteconf[sitename] = d
+ config.save_site_config()
# Make lists of enabled and disabled sites
enabled_sites = {}
Module: check_mk
Branch: master
Commit: 765f4c9334abe5c525daed76718efa3713b25388
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=765f4c9334abe5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Nov 27 15:43:50 2014 +0100
#1537 FIX Added transformation code for user dashboards created between 2014-08 and 2014-10
Installations which were using early versions of the dashboard editor, which was first available
our nightly builds from 2014-08 till 2014-10 and created dashoards with it, have now dashboards
saved in a format, which can not be interpreted by the current dashboard code.
For some time, we assumed that there were not many installations with such files, therefor we
did not implement any migration code and asked the users to migrate by hand. But now we have
a bit too many users which are having trouble here, so we decided to implement a migration
routine for these dashboards.
---
.werks/1537 | 16 ++++++++++++++++
ChangeLog | 1 +
web/htdocs/dashboard.py | 25 +++++++++++++++++++++++++
web/htdocs/views.py | 7 ++-----
web/htdocs/visuals.py | 13 +++++++++++++
5 files changed, 57 insertions(+), 5 deletions(-)
diff --git a/.werks/1537 b/.werks/1537
new file mode 100644
index 0000000..016d73a
--- /dev/null
+++ b/.werks/1537
@@ -0,0 +1,16 @@
+Title: Added transformation code for user dashboards created between 2014-08 and 2014-10
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417099138
+Class: fix
+
+Installations which were using early versions of the dashboard editor, which was first available
+our nightly builds from 2014-08 till 2014-10 and created dashoards with it, have now dashboards
+saved in a format, which can not be interpreted by the current dashboard code.
+
+For some time, we assumed that there were not many installations with such files, therefor we
+did not implement any migration code and asked the users to migrate by hand. But now we have
+a bit too many users which are having trouble here, so we decided to implement a migration
+routine for these dashboards.
diff --git a/ChangeLog b/ChangeLog
index bc01d24..2ffb784 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -72,6 +72,7 @@
* 1529 FIX: Mobile-GUI: Fixed "all host problems" view not showing all problems...
* 1533 FIX: Fixed sorting of hosts with same name in "services of host" view
* 1534 FIX: Fixed filtering views in distributed setup lead to empty views...
+ * 1537 FIX: Added transformation code for user dashboards created between 2014-08 and 2014-10...
WATO:
* 1170 Added buttons to move rules to top/bottom of the list to ruleset edit dialog
diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py
index 4967b13..5fe7022 100644
--- a/web/htdocs/dashboard.py
+++ b/web/htdocs/dashboard.py
@@ -92,8 +92,31 @@ def load_dashboards():
global dashboards, available_dashboards
transform_builtin_dashboards()
dashboards = visuals.load('dashboards', builtin_dashboards)
+ transform_dashboards(dashboards)
available_dashboards = visuals.available('dashboards', dashboards)
+# During implementation of the dashboard editor and recode of the visuals
+# we had serveral different data structures, for example one where the
+# views in user dashlets were stored with a context_type instead of the
+# "single_info" key, which is the currently correct one.
+#
+# This code transforms views from user_dashboards.mk which have been
+# migrated/created with daily snapshots from 2014-08 till beginning 2014-10.
+# FIXME: Can be removed one day. Mark as incompatible change or similar.
+def transform_dashboards(dashboards):
+ for (u, n), dashboard in dashboards.items():
+ visuals.transform_old_visual(dashboard)
+
+ # Also transform dashlets
+ for dashlet in dashboard['dashlets']:
+ visuals.transform_old_visual(dashlet)
+
+ if dashlet['type'] == 'pnpgraph':
+ if 'service' not in dashlet['single_infos']:
+ dashlet['single_infos'].append('service')
+ if 'host' not in dashlet['single_infos']:
+ dashlet['single_infos'].append('host')
+
# be compatible to old definitions, where even internal dashlets were
# referenced by url, e.g. dashboard['url'] = 'hoststats.py'
# FIXME: can be removed one day. Mark as incompatible change or similar.
@@ -852,6 +875,8 @@ def page_edit_dashlet():
except IndexError:
raise MKGeneralException(_('The dashlet does not exist.'))
+ html.debug(dashlet)
+
ty = dashlet['type']
dashlet_type = dashlet_types[ty]
single_infos = dashlet['single_infos']
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index b6f0d13..fb601f9 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -91,6 +91,7 @@ def permitted_views():
return available_views
# Convert views that are saved in the pre 1.2.6-style
+# FIXME: Can be removed one day. Mark as incompatible change or similar.
def transform_old_views():
for view in multisite_views.values():
@@ -103,11 +104,7 @@ def transform_old_views():
if 'context_type' in view:
# This code transforms views from user_views.mk which have been migrated with
# daily snapshots from 2014-08 till beginning 2014-10.
- if view['context_type'] in [ 'host', 'service', 'hostgroup', 'servicegroup' ]:
- view['single_infos'] = [view['context_type']]
- else:
- view['single_infos'] = [] # drop the context type and assume a "multiple view"
- del view['context_type']
+ visuals.transform_old_visual(view)
elif 'single_infos' not in view:
# This tries to map the datasource and additional settings of the
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index b4b1943..e83ebcd 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -1244,6 +1244,19 @@ def collect_context_links_of(visual_type_name, this_visual, active_filter_vars,
return context_links
+def transform_old_visual(visual):
+ if 'context_type' in visual:
+ if visual['context_type'] in [ 'host', 'service', 'hostgroup', 'servicegroup' ]:
+ visual['single_infos'] = [visual['context_type']]
+ else:
+ visual['single_infos'] = [] # drop the context type and assume a "multiple visual"
+ del visual['context_type']
+ elif 'single_infos' not in visual:
+ visual['single_infos'] = []
+
+ visual.setdefault('context', {})
+
+
#.
# .--Popup Add-----------------------------------------------------------.
# | ____ _ _ _ |