Module: check_mk
Branch: master
Commit: f16febe3f3bf3708e4dbc63f56bd7c188b3c69ee
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f16febe3f3bf37…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Feb 23 13:26:23 2017 +0100
Combined graphs: handle implicit templates correctly
Change-Id: Ic302bd62c3ee096346209fd4657752997d3cd804
---
ZUTUN.graphing | 32 ++++++++++++++------------------
web/htdocs/metrics.py | 8 ++++++++
2 files changed, 22 insertions(+), 18 deletions(-)
diff --git a/ZUTUN.graphing b/ZUTUN.graphing
index 12c8392..1755fa0 100644
--- a/ZUTUN.graphing
+++ b/ZUTUN.graphing
@@ -23,12 +23,12 @@
[4] Titel der Graphen selbst
-[5] Titel der einzelnen Metriken. Hierbei berücksichtigen,
- ob alle Kurven vom gleichen Host oder Service kommen.
- Frage klären, ob eventuell sogar der Name der Metrik
- auch weggealssen wird - z.B. wenn der Graph nur eine
- einzige Metrik zeigt und diese schon im Graph-Titel
- zu sehen ist.
+[5] au:Titel der einzelnen Metriken. Hierbei berücksichtigen,
+ au:ob alle Kurven vom gleichen Host oder Service kommen.
+ au:Frage klären, ob eventuell sogar der Name der Metrik
+ au:auch weggealssen wird - z.B. wenn der Graph nur eine
+ au:einzige Metrik zeigt und diese schon im Graph-Titel
+ au:zu sehen ist.
[6] Graph zu Dashboard hinzufügen.
@@ -44,39 +44,35 @@
[10] Graphen mit mehreren Areas, saubere Stacks bilden.
- Wenn die erste metrik line oder area ist, nimmt man area,
- sonst stacked.
+ Wenn die erste metrik line oder area ist, nimmt man area,
+ sonst stacked.
[11] Erkennung ob combined_graphs möglich sind (web/htdocs/config.py)
- sauber machen.
+ sauber machen.
[12] Limit auf Menge der dargestellten Objekte.
[13] Graphen von Hosts. Dazu den Hostcheck auf "PING" ändern, echte
- Metriken sammeln.
+ Metriken sammeln.
[14] Import views und visuals irgendwie aufrüamen
[15] Seite der Combined graphs: Hier muss der Titel der View irgendwie noch
- sauber rein. Eventuell einfach den Titel in einer URL-Variable mitschleifen.
- Auch die Art der Darstellung (Summe, etc.) muss im Titel stehen.
+ sauber rein. Eventuell einfach den Titel in einer URL-Variable mitschleifen.
+ Auch die Art der Darstellung (Summe, etc.) muss im Titel stehen.
[16] Prüfung auf eine einheitliche Unit? Brauchen wir das? Im Originalcode ist
- von den normalen Templates.
+ von den normalen Templates.
[17] Explizite Reihenfolge der Knöpfe festlegen.
[18] Default festlegen, wenn man auf die Seite kommt. Sollen wir einfach
"Summe"
- nehmen?
-
-
-[19] Implizite Schablonenen ala "METRIC_..." umsetzen.
-
+ nehmen?
diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py
index 0d918a2..7986b53 100644
--- a/web/htdocs/metrics.py
+++ b/web/htdocs/metrics.py
@@ -1044,6 +1044,14 @@ def generic_graph_template(metric_name):
]
}
+def get_graph_template(template_id):
+ if template_id.startswith("METRIC_"):
+ return generic_graph_template(template_id[7:])
+ elif template_id in graph_info:
+ return graph_info[template_id]
+ else:
+ raise MKGeneralException(_("There is no graph template with the id
'%d'") % template_id)
+
def get_graph_range(graph_template, translated_metrics):
if "range" not in graph_template: