diff options
| -rw-r--r-- | inc/collectd.inc.php | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/inc/collectd.inc.php b/inc/collectd.inc.php index 306086a..525b931 100644 --- a/inc/collectd.inc.php +++ b/inc/collectd.inc.php | |||
| @@ -110,16 +110,18 @@ function graphs_from_plugin($host, $plugin) { | |||
| 110 | $ts = collectd_plugindetail($host, $plugin, 't'); | 110 | $ts = collectd_plugindetail($host, $plugin, 't'); |
| 111 | $tis = collectd_plugindetail($host, $plugin, 'ti'); | 111 | $tis = collectd_plugindetail($host, $plugin, 'ti'); |
| 112 | if (!$pis) $pis = array('NULL'); | 112 | if (!$pis) $pis = array('NULL'); |
| 113 | if (!$tis) $tis = array('NULL'); | 113 | if (!$tis || $CONFIG['groupby'][$plugin] == 'type') |
| 114 | $tis = array('NULL'); | ||
| 114 | 115 | ||
| 115 | foreach($pis as $pi) { | 116 | foreach($pis as $pi) { |
| 116 | if ($CONFIG['groupby'][$plugin] == 'type') { | 117 | foreach ($tis as $ti) { |
| 117 | foreach ($ts as $t) { | 118 | foreach ($ts as $t) { |
| 118 | $items = array( | 119 | $items = array( |
| 119 | 'h' => $host, | 120 | 'h' => $host, |
| 120 | 'p' => $plugin, | 121 | 'p' => $plugin, |
| 121 | 'pi' => $pi, | 122 | 'pi' => $pi, |
| 122 | 't' => $t | 123 | 't' => $t, |
| 124 | 'ti' => $ti | ||
| 123 | ); | 125 | ); |
| 124 | printf('<a href="%s/%s"><img src="%s/%s"></a>'."\n", | 126 | printf('<a href="%s/%s"><img src="%s/%s"></a>'."\n", |
| 125 | $CONFIG['weburl'], | 127 | $CONFIG['weburl'], |
| @@ -128,24 +130,6 @@ function graphs_from_plugin($host, $plugin) { | |||
| 128 | build_url('graph.php', $items) | 130 | build_url('graph.php', $items) |
| 129 | ); | 131 | ); |
| 130 | } | 132 | } |
| 131 | } else { | ||
| 132 | foreach ($tis as $ti) { | ||
| 133 | foreach ($ts as $t) { | ||
| 134 | $items = array( | ||
| 135 | 'h' => $host, | ||
| 136 | 'p' => $plugin, | ||
| 137 | 'pi' => $pi, | ||
| 138 | 't' => $t, | ||
| 139 | 'ti' => $ti | ||
| 140 | ); | ||
| 141 | printf('<a href="%s/%s"><img src="%s/%s"></a>'."\n", | ||
| 142 | $CONFIG['weburl'], | ||
| 143 | build_url('detail.php', $items), | ||
| 144 | $CONFIG['weburl'], | ||
| 145 | build_url('graph.php', $items) | ||
| 146 | ); | ||
| 147 | } | ||
| 148 | } | ||
| 149 | } | 133 | } |
| 150 | } | 134 | } |
| 151 | } | 135 | } |
