mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
redesigned graph defining system (still seems a bit batshit, but nevermind). lots of improvements to various pollers, only writing RRDs if valid data is returned, etc.
git-svn-id: http://www.observium.org/svn/observer/trunk@1506 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -4,16 +4,15 @@ $bg="#ffffff";
|
||||
|
||||
echo('<div style="clear: both;">');
|
||||
|
||||
$datas = array('System','Network');
|
||||
|
||||
if(!$_GET['opta']) { $_GET['opta'] = strtolower($datas[0]); }
|
||||
|
||||
print_optionbar_start('', '');
|
||||
|
||||
$sep = "";
|
||||
foreach ($datas as $texttype)
|
||||
$query = mysql_query("SELECT graph_section FROM device_graphs AS D, graph_types AS G WHERE D.device_id = '".$device['device_id']."' AND G.graph_subtype = D.graph AND G.graph_type = 'device' GROUP BY G.graph_section ORDER BY graph_section");
|
||||
while($section = mysql_fetch_assoc($query))
|
||||
{
|
||||
$type = strtolower($texttype);
|
||||
$type = strtolower($section['graph_section']);
|
||||
if(!$_GET['opta']) { $_GET['opta'] = $type; }
|
||||
echo($sep);
|
||||
if ($_GET['opta'] == $type)
|
||||
{
|
||||
@@ -24,29 +23,24 @@ foreach ($datas as $texttype)
|
||||
{
|
||||
echo('<img src="images/icons/greyscale/'.$type.'.png" class="optionicon" />');
|
||||
}
|
||||
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/graphs/" . $type . ($_GET['optb'] ? "/" . $_GET['optb'] : ''). "/'> " . $texttype ."</a>\n");
|
||||
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/graphs/" . $type . ($_GET['optb'] ? "/" . $_GET['optb'] : ''). "/'> " . $type ."</a>\n");
|
||||
if ($_GET['opta'] == $type) { echo("</strong>"); }
|
||||
$sep = " | ";
|
||||
}
|
||||
unset ($sep);
|
||||
print_optionbar_end();
|
||||
|
||||
#echo('<div style="float: right;">');
|
||||
$sql = "SELECT * FROM device_graphs AS D, graph_types AS G WHERE D.device_id = '".$device['device_id']."'";
|
||||
$sql .=" AND G.graph_subtype = D.graph AND G.graph_type = 'device' AND G.graph_section = '".mres($_GET['opta'])."' ORDER BY graph_order, graph_subtype";
|
||||
$query = mysql_query($sql);
|
||||
while($graph = mysql_fetch_assoc($query))
|
||||
{
|
||||
|
||||
include_dir("/html/pages/device/graphs/".mres($_GET['opta']));
|
||||
$graph_title = $graph['graph_descr'];
|
||||
$graph_type = "device_" . $graph['graph_subtype'];
|
||||
include ("includes/print-device-graph.php");
|
||||
|
||||
#if ($config['os'][$device['os']]['group']) { $os_group = $config['os'][$device['os']]['group']; }
|
||||
#if (is_file($config['install_dir'] . "/html/pages/device/graphs/os-".$device['os'].".inc.php")) {
|
||||
# /// OS Specific
|
||||
# include($config['install_dir'] . "/html/pages/device/graphs/os-".$device['os'].".inc.php");
|
||||
#} elseif ($os_group && is_file($config['install_dir'] . "/html/pages/device/graphs/os-".$os_group.".inc.php")) {
|
||||
# /// OS Group Specific
|
||||
# include($config['install_dir'] . "/html/pages/device/graphs/os-".$os_group.".inc.php");
|
||||
#} else {
|
||||
# echo("No graph definitions found for OS " . $device['os'] . "!");
|
||||
#}
|
||||
|
||||
# echo("</div>");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
Reference in New Issue
Block a user