cleanups to how graphing works. start using device= for device graphs.

git-svn-id: http://www.observium.org/svn/observer/trunk@3167 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2012-05-11 13:26:14 +00:00
parent 62c302b960
commit d52042ba47
75 changed files with 226 additions and 194 deletions

View File

@@ -17,13 +17,6 @@ echo("<span style='font-weight: bold;'>Graphs</span> &#187; ");
$sep = "";
foreach (dbFetchRows("SELECT * FROM munin_plugins WHERE device_id = ? ORDER BY mplug_category, mplug_type", array($device['device_id'])) as $mplug)
{
# if (strlen($mplug['mplug_category']) == 0) { $mplug['mplug_category'] = "general"; } else { }
$graph_enable[$mplug['mplug_category']][$mplug['mplug_type']]['id'] = $mplug['mplug_id'];
$graph_enable[$mplug['mplug_category']][$mplug['mplug_type']]['title'] = $mplug['mplug_title'];
}
foreach (dbFetchRows("SELECT * FROM device_graphs WHERE device_id = ? ORDER BY graph", array($device['device_id'])) as $graph)
{
$section = $config['graph_types']['device'][$graph['graph']]['section'];
@@ -59,18 +52,11 @@ $graph_enable = $graph_enable[$vars['group']];
#foreach ($config['graph_types']['device'] as $graph => $entry)
foreach ($graph_enable as $graph => $entry)
{
$graph_array = array();
if ($graph_enable[$graph])
{
if (is_numeric($entry['id']))
{
$graph_title = $entry['title'];
$graph_array['type'] = "munin_graph";
$graph_array['id'] = $entry['id'];
} else {
$graph_title = $config['graph_types']['device'][$graph]['descr'];
$graph_array['type'] = "device_" . $graph;
}
$graph_title = $config['graph_types']['device'][$graph]['descr'];
$graph_array['type'] = "device_" . $graph;
include("includes/print-device-graph.php");
}
}