From 2ee7bc20b82c84d5ff3bf9cab45d5e67937aaa1e Mon Sep 17 00:00:00 2001 From: Manuel CISSÉ Date: Mon, 21 Jun 2010 13:52:00 +0200 Subject: Default time range on the summary page is now configurable --- conf/config.php | 3 +++ inc/collectd.inc.php | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/conf/config.php b/conf/config.php index a36c083..cebdc39 100644 --- a/conf/config.php +++ b/conf/config.php @@ -18,6 +18,9 @@ $CONFIG['rrdtool_opts'] = ''; # default plugins to show on host page $CONFIG['overview'] = array('load', 'cpu', 'memory', 'swap'); +# default plugins time range +$CONFIG['time_range'] = array('uptime' => 31536000); + # show load averages on overview page $CONFIG['showload'] = true; diff --git a/inc/collectd.inc.php b/inc/collectd.inc.php index fde3267..3c8d48c 100644 --- a/inc/collectd.inc.php +++ b/inc/collectd.inc.php @@ -131,7 +131,9 @@ function graphs_from_plugin($host, $plugin) { $CONFIG['weburl'], build_url('detail.php', $items), $CONFIG['weburl'], - build_url('graph.php', $items) + (array_key_exists($plugin, $CONFIG['time_range']) ? + build_url('graph.php', $items, $CONFIG['time_range'][$plugin]) : + build_url('graph.php', $items) ) ); } } -- cgit v1.1