mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
all graphs to db*
git-svn-id: http://www.observium.org/svn/observer/trunk@2309 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
|
||||
$device = device_by_id_cache($id);
|
||||
$query = mysql_query("SELECT * FROM `mempools` where `device_id` = '".$id."'");
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
@@ -10,7 +9,7 @@ $rrd_options .= " -u 100 -l 0 -E -b 1024 ";
|
||||
$iter = "1"; $i=1;
|
||||
$rrd_options .= " COMMENT:' Min Cur Max\\n'";
|
||||
|
||||
while ($mempool = mysql_fetch_assoc($query))
|
||||
foreach(dbFetchRows("SELECT * FROM `mempools` where `device_id` = ?", array($id)) as $mempool)
|
||||
{
|
||||
# FIXME generic colour function
|
||||
if ($iter=="1") { $colour="CC0000"; } elseif ($iter=="2") { $colour="008C00"; } elseif ($iter=="3") { $colour="4096EE"; }
|
||||
@@ -36,4 +35,4 @@ while ($mempool = mysql_fetch_assoc($query))
|
||||
|
||||
$rrd_options .= " HRULE:0#999999";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
$device = device_by_id_cache($id);
|
||||
$query = mysql_query("SELECT * FROM `processors` where `device_id` = '".$id."'");
|
||||
$procs = dbFetchRows("SELECT * FROM `processors` where `device_id` = ?", array($id));
|
||||
|
||||
if($config['os'][$device['os']]['processor_stacked'] == 1)
|
||||
{
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
<?php
|
||||
|
||||
#$device = device_by_id_cache($id);
|
||||
#$query = mysql_query("SELECT * FROM `processors` where `device_id` = '".$id."'");
|
||||
|
||||
|
||||
|
||||
$i = 0;
|
||||
|
||||
while ($proc = mysql_fetch_assoc($query))
|
||||
foreach ($procs as $proc)
|
||||
{
|
||||
$rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("processor-" . $proc['processor_type'] . "-" . $proc['processor_index'] . ".rrd");
|
||||
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
<?php
|
||||
|
||||
#$device = device_by_id_cache($id);
|
||||
#$query = mysql_query("SELECT * FROM `processors` where `device_id` = '".$id."'");
|
||||
|
||||
$i = 0;
|
||||
|
||||
while ($proc = mysql_fetch_assoc($query))
|
||||
foreach ($procs as $proc)
|
||||
{
|
||||
$rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("processor-" . $proc['processor_type'] . "-" . $proc['processor_index'] . ".rrd");
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ if ($_GET['width'] > "300") { $descr_len = "40"; } else { $descr_len = "22"; }
|
||||
|
||||
$rrd_options .= " -l 0 -E ";
|
||||
$iter = "1";
|
||||
$sql = mysql_query("SELECT * FROM sensors WHERE sensor_class='".$class."' AND device_id = '$id' ORDER BY sensor_index");
|
||||
$rrd_options .= " COMMENT:'".str_pad($unit_long,$descr_len)." Cur Min Max\\n'";
|
||||
while ($sensor = mysql_fetch_assoc($sql))
|
||||
|
||||
foreach (dbFetchRows("SELECT * FROM `sensors` WHERE `sensor_class` = ? AND `device_id` = ? ORDER BY `sensor_index`", array($class, $id)) as $sensor)
|
||||
{
|
||||
# FIXME generic colour function
|
||||
switch ($iter)
|
||||
|
||||
@@ -8,10 +8,9 @@ include("includes/graphs/common.inc.php");
|
||||
$device = device_by_id_cache($id);
|
||||
|
||||
$iter = "1";
|
||||
$sql = mysql_query("SELECT * FROM storage where device_id = '$id'");
|
||||
$rrd_options .= " COMMENT:' Size Used %age\\l'";
|
||||
|
||||
while ($storage = mysql_fetch_assoc($sql))
|
||||
foreach (dbFetchRows("SELECT * FROM storage where device_id = ?", array($id)) as $storage)
|
||||
{
|
||||
# FIXME generic colour function
|
||||
if ($iter=="1") { $colour="CC0000"; } elseif ($iter=="2") { $colour="008C00"; } elseif ($iter=="3") { $colour="4096EE"; }
|
||||
@@ -32,4 +31,4 @@ while ($storage = mysql_fetch_assoc($sql))
|
||||
$iter++;
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -6,9 +6,8 @@ $device = device_by_id_cache($id);
|
||||
$rrd_options .= " -l 0 -E ";
|
||||
|
||||
$iter = "1";
|
||||
$sql = mysql_query("SELECT * FROM toner where device_id = '$id'");
|
||||
$rrd_options .= " COMMENT:'Toner level Cur Min Max\\n'";
|
||||
while ($toner = mysql_fetch_assoc($sql))
|
||||
foreach (dbFetchRows("SELECT * FROM toner where device_id = ?", array($id)) as $toner)
|
||||
{
|
||||
# FIXME generic colour function
|
||||
switch ($iter)
|
||||
|
||||
Reference in New Issue
Block a user