From ebc6422aa4d6250b4c4adae14954dcc00a86d67f Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sun, 6 Apr 2014 16:44:14 +0200 Subject: overview: only calculate cores when config option showload is enabled Closes: https://github.com/pommi/CGP/issues/60 --- inc/html.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/html.inc.php') diff --git a/inc/html.inc.php b/inc/html.inc.php index e6c6f6d..b4d295a 100644 --- a/inc/html.inc.php +++ b/inc/html.inc.php @@ -191,8 +191,6 @@ function host_summary($cat, $hosts) { foreach($hosts as $host) { $host_counter++; - $cores = count(group_plugindata(collectd_plugindata($host, 'cpu'))); - printf('', $row_style[$host_counter % 2]); printf('%s', $CONFIG['weburl'],$host, $host); @@ -209,6 +207,8 @@ function host_summary($cat, $hosts) { isset($rrd_info['ds[midterm].last_ds']) && isset($rrd_info['ds[longterm].last_ds'])) { + $cores = count(group_plugindata(collectd_plugindata($host, 'cpu'))); + foreach (array('ds[shortterm].last_ds', 'ds[midterm].last_ds', 'ds[longterm].last_ds') as $info) { $class = ''; if ($cores > 0 && $rrd_info[$info] > $cores * 2) -- cgit v1.1