Module: check_mk
Branch: master
Commit: a5bf5940b0fa011c15fba5ecb691aeea5c6705d1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a5bf5940b0fa01…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Oct 14 12:36:09 2014 +0200
Omit blue current value curve in prediction for non-current timeranges
This curves do not make much sense and are wrong sometimes
---
web/htdocs/prediction.py | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/web/htdocs/prediction.py b/web/htdocs/prediction.py
index b1a1059..e35238f 100644
--- a/web/htdocs/prediction.py
+++ b/web/htdocs/prediction.py
@@ -136,12 +136,14 @@ def page_graph():
# Try to get current RRD data and render it also
from_time, until_time = timegroup["range"]
- rrd_step, rrd_data = get_rrd_data(host, service, dsname, "MAX", from_time,
until_time)
- render_curve(rrd_data, "#0000ff", 2)
-
- if current_value != None:
- rel_time = (time.time() - time.timezone) % timegroup["slice"]
- render_point(timegroup["range"][0] + rel_time, current_value,
"#0000ff")
+ now = time.time()
+ if now >= from_time and now <= until_time:
+ rrd_step, rrd_data = get_rrd_data(host, service, dsname, "MAX",
from_time, until_time)
+ render_curve(rrd_data, "#0000ff", 2)
+
+ if current_value != None:
+ rel_time = (time.time() - time.timezone) % timegroup["slice"]
+ render_point(timegroup["range"][0] + rel_time, current_value,
"#0000ff")
html.footer()