diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/collectd.inc.php | 5 | ||||
-rw-r--r-- | inc/html.inc.php | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/inc/collectd.inc.php b/inc/collectd.inc.php index 3467667..99ffdd1 100644 --- a/inc/collectd.inc.php +++ b/inc/collectd.inc.php | |||
@@ -54,6 +54,7 @@ function collectd_plugindata($host, $plugin=NULL) { | |||
54 | 54 | ||
55 | # only return data about one plugin | 55 | # only return data about one plugin |
56 | if (!is_null($plugin)) { | 56 | if (!is_null($plugin)) { |
57 | $pdata = array(); | ||
57 | foreach($data as $item) { | 58 | foreach($data as $item) { |
58 | if ($item['p'] == $plugin) | 59 | if ($item['p'] == $plugin) |
59 | $pdata[] = $item; | 60 | $pdata[] = $item; |
@@ -113,6 +114,7 @@ function collectd_plugindetail($host, $plugin, $detail, $where=NULL) { | |||
113 | function group_plugindata($plugindata) { | 114 | function group_plugindata($plugindata) { |
114 | global $CONFIG; | 115 | global $CONFIG; |
115 | 116 | ||
117 | $data = array(); | ||
116 | # type instances should be grouped in 1 graph | 118 | # type instances should be grouped in 1 graph |
117 | foreach ($plugindata as $item) { | 119 | foreach ($plugindata as $item) { |
118 | # backwards compatibility | 120 | # backwards compatibility |
@@ -129,6 +131,9 @@ function group_plugindata($plugindata) { | |||
129 | } | 131 | } |
130 | 132 | ||
131 | function plugin_sort($data) { | 133 | function plugin_sort($data) { |
134 | if (empty($data)) | ||
135 | return $data; | ||
136 | |||
132 | foreach ($data as $key => $row) { | 137 | foreach ($data as $key => $row) { |
133 | $pi[$key] = (isset($row['pi'])) ? $row['pi'] : null; | 138 | $pi[$key] = (isset($row['pi'])) ? $row['pi'] : null; |
134 | $c[$key] = (isset($row['c'])) ? $row['c'] : null; | 139 | $c[$key] = (isset($row['c'])) ? $row['c'] : null; |
diff --git a/inc/html.inc.php b/inc/html.inc.php index 20a10ed..3ad2439 100644 --- a/inc/html.inc.php +++ b/inc/html.inc.php | |||
@@ -58,10 +58,14 @@ EOT; | |||
58 | } | 58 | } |
59 | 59 | ||
60 | function plugin_header($host, $plugin) { | 60 | function plugin_header($host, $plugin) { |
61 | global $CONFIG; | ||
62 | |||
61 | return printf("<h3><a href='%shost.php?h=%s&p=%s'>%s</a></h3>\n", $CONFIG['weburl'], $host, $plugin, $plugin); | 63 | return printf("<h3><a href='%shost.php?h=%s&p=%s'>%s</a></h3>\n", $CONFIG['weburl'], $host, $plugin, $plugin); |
62 | } | 64 | } |
63 | 65 | ||
64 | function plugins_list($host, $overview_plugins, $other_plugins, $selected_plugins = array()) { | 66 | function plugins_list($host, $overview_plugins, $other_plugins, $selected_plugins = array()) { |
67 | global $CONFIG; | ||
68 | |||
65 | echo '<div class="plugins">'; | 69 | echo '<div class="plugins">'; |
66 | echo '<h3>Plugins</h3>'; | 70 | echo '<h3>Plugins</h3>'; |
67 | echo '<ul>'; | 71 | echo '<ul>'; |