Module: check_mk
Branch: master
Commit: 83a69af70ce31a2d56fe5a855a4668b7ea01ddf2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=83a69af70ce31a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Sep 12 08:54:08 2017 +0200
Created generic SiteChoice() valuespec
Change-Id: Ib1ef26a8a10e3d1917ac4ec6449e6a67a6f4fb38
---
web/htdocs/valuespec.py | 18 ++++++++++++++++++
web/htdocs/watolib.py | 5 +----
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index b3397a1..91534c9 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -4529,6 +4529,24 @@ def ListOfCAs(**args):
)
+class SiteChoice(DropdownChoice):
+ def __init__(self, **kwargs):
+ import config
+ kwargs.setdefault("title", _("Site"))
+ kwargs.setdefault("help", _("Specify the site of your choice"))
+ kwargs.setdefault("default_value", config.default_site())
+ kwargs.setdefault("invalid_choice_error", _("The configured site is not known to this site."))
+
+ kwargs.update({
+ "choices": config.site_choices,
+ "invalid_choice": "complain",
+ "invalid_choice_title": _("Unknown site (%s)"),
+ })
+
+ super(SiteChoice, self).__init__(**kwargs)
+
+
+
class TimeperiodSelection(ElementSelection):
def __init__(self, **kwargs):
ElementSelection.__init__(self, **kwargs)
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index c498b0f..f6de125 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -4176,13 +4176,10 @@ class SiteAttribute(ValueSpecAttribute):
def __init__(self):
# Default is is the local one, if one exists or
# no one if there is no local site
- ValueSpecAttribute.__init__(self, "site", DropdownChoice(
+ ValueSpecAttribute.__init__(self, "site", SiteChoice(
title=_("Monitored on site"),
help=_("Specify the site that should monitor this host."),
default_value = default_site(),
- choices = site_choices,
- invalid_choice = "complain",
- invalid_choice_title = _("Unknown site (%s)"),
invalid_choice_error = _("The configured site is not known to this site. In case you "
"are configuring in a distributed slave, this may be a host "
"monitored by another site. If you want to modify this "
Module: check_mk
Branch: master
Commit: 4fbbf4e06457f195765245f17327555ff4b51203
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4fbbf4e06457f1…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Sep 12 08:37:29 2017 +0200
Minor refactoring
Change-Id: I093ec8ac3afa231a83dcda09edf0eeeec9c78dfe
---
web/plugins/dashboard/dashlets.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/web/plugins/dashboard/dashlets.py b/web/plugins/dashboard/dashlets.py
index 089770b..9e0f7d8 100644
--- a/web/plugins/dashboard/dashlets.py
+++ b/web/plugins/dashboard/dashlets.py
@@ -377,13 +377,14 @@ def dashlet_graph_reload_js(nr, dashlet):
if html.has_var('site'):
site = html.var('site')
else:
- sites.live().set_prepend_site(True)
query = "GET hosts\nFilter: name = %s\nColumns: name" % lqencode(host)
try:
+ sites.live().set_prepend_site(True)
site = sites.live().query_column(query)[0]
except IndexError:
raise MKUserError("host", _("The host could not be found on any active site."))
- sites.live().set_prepend_site(False)
+ finally:
+ sites.live().set_prepend_site(False)
# New graphs which have been added via "add to visual" option don't have a timerange
# configured. So we assume the default timerange here by default.
Module: check_mk
Branch: master
Commit: 74b53f7351bdfcf0de053ca474664ad88a5d90cb
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=74b53f7351bdfc…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Sep 19 16:49:41 2017 +0200
3920 Graphs: Vertical axis scaling and mirroring can now be customized
You can now customize the vertical axis scaling mode and mirror the
metrics in a graph if you like. This can be done just for yourself
or for all your users.
This can be useful, for example, if you like to change the scaling
of all CPU usage graphs from fixed 100% to dynamical scaling based
on the measured values.
This feature is usable for all template based and combined graphs.
It does not affect custom graphs at all.
To configure such a customization open your GUI and click the {{Edit}}
button of your {{Views}} snapin. Then click on the {{Graph tunings}}
button on the top of the page. From this page you can then create a
new graph tuning where you first need to set a title and the graph
type you want to customize
.
Then you need to add a new tuning setting where you can first configure
to which graphs you want it to be applied and then configure the options
you want to change.
If you like you can enable to share this tuning with others, which will
make your changes effective for other users graphs.
After saving the new tunings it's settings will be applied immediately
to fresh rendered graphs.
---
.werks/3920 | 35 +++++++++++++++++++++++++++++++++++
web/htdocs/metrics.py | 7 +++++++
web/htdocs/pagetypes.py | 14 ++++++++++++++
web/htdocs/visuals.py | 2 ++
4 files changed, 58 insertions(+)
diff --git a/.werks/3920 b/.werks/3920
new file mode 100644
index 0000000..e4cbcf1
--- /dev/null
+++ b/.werks/3920
@@ -0,0 +1,35 @@
+Title: Graphs: Vertical axis scaling and mirroring can now be customized
+Level: 2
+Component: multisite
+Compatible: compat
+Edition: cee
+Version: 1.5.0i1
+Date: 1505832008
+Class: feature
+
+You can now customize the vertical axis scaling mode and mirror the
+metrics in a graph if you like. This can be done just for yourself
+or for all your users.
+
+This can be useful, for example, if you like to change the scaling
+of all CPU usage graphs from fixed 100% to dynamical scaling based
+on the measured values.
+
+This feature is usable for all template based and combined graphs.
+It does not affect custom graphs at all.
+
+To configure such a customization open your GUI and click the {{Edit}}
+button of your {{Views}} snapin. Then click on the {{Graph tunings}}
+button on the top of the page. From this page you can then create a
+new graph tuning where you first need to set a title and the graph
+type you want to customize
+.
+Then you need to add a new tuning setting where you can first configure
+to which graphs you want it to be applied and then configure the options
+you want to change.
+
+If you like you can enable to share this tuning with others, which will
+make your changes effective for other users graphs.
+
+After saving the new tunings it's settings will be applied immediately
+to fresh rendered graphs.
diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py
index d4cc625..208b44f 100644
--- a/web/htdocs/metrics.py
+++ b/web/htdocs/metrics.py
@@ -1123,6 +1123,13 @@ def generic_graph_template(metric_name):
]
}
+
+def get_graph_template_choices():
+ # TODO: v.get("title", k): Use same algorithm as used in
+ # GraphIdentificationTemplateBased._parse_template_metric()
+ return sorted([ (k, v.get("title", k)) for k, v in graph_info.items() ], key=lambda (k, v): v)
+
+
def get_graph_template(template_id):
if template_id.startswith("METRIC_"):
return generic_graph_template(template_id[7:])
diff --git a/web/htdocs/pagetypes.py b/web/htdocs/pagetypes.py
index e8ad462..989fbb5 100644
--- a/web/htdocs/pagetypes.py
+++ b/web/htdocs/pagetypes.py
@@ -84,6 +84,9 @@ class Base(object):
# "add_to" : Text like "Add to foo bar..."
# TODO: Look at GraphCollection for the complete list of phrases to
# be defined for each page type and explain that here.
+ # TODO: Refactor this to different indepentent class methods. For example
+ # the "add_to" phrase is not relevant for non container elements. In the
+ # moment we use dedicated methods, wrong usage will be found by pylint.
@classmethod
def phrase(cls, phrase):
return _("MISSING '%s'") % phrase
@@ -492,6 +495,17 @@ class Overridable(Base):
### elif visual["public"] and owner == "":
### builtin.append((owner, visual_name, visual))
+
+ @classmethod
+ def permitted_instances_sorted(cls):
+ instances = []
+ for instance in cls.instances_sorted():
+ if (instance.is_mine() and instance.may_see()) or \
+ (not instance.is_mine() and instance.is_public() and instance.may_see()):
+ instances.append(instance)
+ return instances
+
+
def may_delete(self):
if self.is_builtin():
return False
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index 1d4bab8..eabd0ad 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -302,6 +302,8 @@ def page_list(what, title, visuals, custom_columns = None,
html.context_button(_("Graph Collections"), "graph_collections.py", "graph_collection")
if pagetypes.has_page_type("custom_graph"):
html.context_button(_("Custom Graphs"), "custom_graphs.py", "custom_graph")
+ if pagetypes.has_page_type("graph_tuning"):
+ html.context_button(_("Grap tunings"), "graph_tunings.py", "graph_tuning")
html.context_button(_("Bookmark Lists"), "bookmark_lists.py", "bookmark_list")
html.end_context_buttons()
Module: check_mk
Branch: master
Commit: f6d325f628f334045bfab4e49db581f63c862507
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f6d325f628f334…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 14 16:33:57 2017 +0200
Pagetypes: Added missing multiple topics in edit dialog
Change-Id: I63de61529ea73d613c7de391f66c6380694a8ee5
---
web/htdocs/pagetypes.py | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/web/htdocs/pagetypes.py b/web/htdocs/pagetypes.py
index 0ff64d8..e8ad462 100644
--- a/web/htdocs/pagetypes.py
+++ b/web/htdocs/pagetypes.py
@@ -142,16 +142,18 @@ class Base(object):
sorted_topics = topics.items()
sorted_topics.sort(cmp = lambda t1, t2: cmp(t1[1][0], t2[1][0]))
- # Now remove order numbers. Also drop the topic completely
- # for the while
- # TODO: Reenable topic as soon as we have the first page type
- # with more than one topic
- parameters = []
+ # Now remove order numbers and produce the structures for the Dictionary VS
+ parameters, keys_by_topic = [], []
for topic, elements in sorted_topics:
+ topic_keys = []
+
for _unused_order, key, vs in elements:
parameters.append((key, vs))
+ topic_keys.append(key)
- return parameters
+ keys_by_topic.append((topic, topic_keys))
+
+ return parameters, keys_by_topic
# Object methods that *can* be overridden - for cases where
@@ -1020,12 +1022,13 @@ class Overridable(Base):
html.context_button(_("Back"), back_url, "back")
html.end_context_buttons()
- # TODO: Implement multiple topics
+ parameters, keys_by_topic = cls._collect_parameters(mode)
vs = Dictionary(
title = _("General Properties"),
render = 'form',
optional_keys = None,
- elements = cls._collect_parameters(mode),
+ elements = parameters,
+ headers=keys_by_topic,
)
def validate(page_dict):
Module: check_mk
Branch: master
Commit: 4dedf7b9dc20fa2c1f79abf93a97c0c22162f466
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4dedf7b9dc20fa…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Sep 19 16:15:31 2017 +0200
Updated bug entries #2980
---
.bugs/2980 | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/.bugs/2980 b/.bugs/2980
new file mode 100644
index 0000000..23ba2b9
--- /dev/null
+++ b/.bugs/2980
@@ -0,0 +1,9 @@
+Title: Deprecated exe-Installer (NSIS)
+Component: checks
+State: open
+Date: 2017-09-19 16:14:42
+Targetversion: 1.5.0
+Class: todo
+
+Deprecate/Remove the NSIS based exe-Installer. The MSI based installer has
+all features we need. There is no need to maintain both types.