device/health -> db*

git-svn-id: http://www.observium.org/svn/observer/trunk@2335 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-05-16 11:01:48 +00:00
parent 69fc727785
commit d9439aaf65
5 changed files with 12 additions and 20 deletions
+1 -4
View File
@@ -1,8 +1,5 @@
<?php
$sql = "SELECT * FROM `ucd_diskio` WHERE device_id = '" . $device['device_id'] . "' ORDER BY diskio_descr";
$query = mysql_query($sql);
echo('<table cellspacing="0" cellpadding="5" width="100%">');
#echo("<tr class=tablehead>
@@ -14,7 +11,7 @@ echo('<table cellspacing="0" cellpadding="5" width="100%">');
$row = 1;
while ($drive = mysql_fetch_assoc($query))
foreach (dbFetchRows("SELECT * FROM `ucd_diskio` WHERE device_id = ? ORDER BY diskio_descr", array($device['device_id'])) as $drive)
{
if (is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
+1 -2
View File
@@ -6,9 +6,8 @@ echo("<div style='margin-top: 5px; padding: 0px;'>");
echo("<table width=100% cellpadding=6 cellspacing=0>");
$i = '1';
$mempools = mysql_query("SELECT * FROM `mempools` WHERE device_id = '" . $device['device_id'] . "'");
while ($mempool = mysql_fetch_assoc($mempools))
foreach (dbFetchRows("SELECT * FROM `mempools` WHERE device_id = ?", array($device['device_id'])) as $mempool)
{
if (!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
+1 -2
View File
@@ -6,8 +6,7 @@ echo("<div style='margin-top: 5px; padding: 0px;'>");
echo("<table width=100% cellpadding=6 cellspacing=0>");
$i = '1';
$procs = mysql_query("SELECT * FROM `processors` WHERE device_id = '" . $device['device_id'] . "'");
while ($proc = mysql_fetch_assoc($procs))
foreach (dbFetchRows("SELECT * FROM `processors` WHERE device_id = ?", array($device['device_id'])) as $proc)
{
$proc_url = "device/".$device['device_id']."/health/processor/";
+8 -8
View File
@@ -7,20 +7,20 @@ echo("<table cellspacing=0 cellpadding=5 width=100%>");
$row = 1;
while ($temp = mysql_fetch_assoc($query))
foreach (dbFetchRows("SELECT * FROM `sensors` WHERE `sensor_class` = ? AND `device_id` = ? ORDER BY `sensor_descr`", array($class, $device['device_id'])) as $sensor)
{
if (!is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
echo("<tr class=list-large style=\"background-color: $row_colour; padding: 5px;\">
<td width=500>" . $temp['sensor_descr'] . "</td>
<td>" . $temp['sensor_type'] . "</td>
<td width=50>" . format_si($temp['sensor_current']) .$unit. "</td>
<td width=50>" . format_si($temp['sensor_limit']) . $unit . "</td>
<td width=50>" . format_si($temp['sensor_limit_low']) . $unit ."</td>
<td width=500>" . $sensor['sensor_descr'] . "</td>
<td>" . $sensor['sensor_type'] . "</td>
<td width=50>" . format_si($sensor['sensor_current']) .$unit. "</td>
<td width=50>" . format_si($sensor['sensor_limit']) . $unit . "</td>
<td width=50>" . format_si($sensor['sensor_limit_low']) . $unit ."</td>
</tr>\n");
echo("<tr bgcolor=$row_colour><td colspan='5'>");
$graph_array['id'] = $temp['sensor_id'];
$graph_array['id'] = $sensor['sensor_id'];
$graph_array['type'] = $graph_type;
include("includes/print-quadgraphs.inc.php");
@@ -32,4 +32,4 @@ while ($temp = mysql_fetch_assoc($query))
echo("</table>");
?>
?>
+1 -4
View File
@@ -2,9 +2,6 @@
$graph_type = "storage_usage";
$sql = "SELECT * FROM `storage` WHERE device_id = '" . $device['device_id'] . "' ORDER BY storage_descr";
$query = mysql_query($sql);
echo("<table cellspacing=0 cellpadding=5 width=100%>");
echo("<tr class=tablehead>
@@ -16,7 +13,7 @@ echo("<tr class=tablehead>
$row = 1;
while ($drive = mysql_fetch_assoc($query))
foreach (dbFetchRows("SELECT * FROM `storage` WHERE device_id = ? ORDER BY storage_descr", array($device['device_id'])) as $drive)
{
if (is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }