mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
more db*
git-svn-id: http://www.observium.org/svn/observer/trunk@2324 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -2,15 +2,13 @@
|
||||
|
||||
echo('<table width="100%">');
|
||||
|
||||
$hrdevices = mysql_query("SELECT * FROM `hrDevice` WHERE `device_id` = '".$device['device_id']."' ORDER BY `hrDeviceIndex`");
|
||||
|
||||
while ($hrdevice = mysql_fetch_assoc($hrdevices))
|
||||
foreach (dbFetchRows("SELECT * FROM `hrDevice` WHERE `device_id` = ? ORDER BY `hrDeviceIndex`", array($device['device_id'])) as $hrdevice)
|
||||
{
|
||||
echo("<tr><td>".$hrdevice['hrDeviceIndex']."</td>");
|
||||
|
||||
if ($hrdevice['hrDeviceType'] == "hrDeviceProcessor")
|
||||
{
|
||||
$proc_id = mysql_result(mysql_query("SELECT processor_id FROM processors WHERE device_id = '".$device['device_id']."' AND hrDeviceIndex = '".$hrdevice['hrDeviceIndex']."'"),0);
|
||||
$proc_id = dbFetchCell("SELECT processor_id FROM processors WHERE device_id = '".$device['device_id']."' AND hrDeviceIndex = '".$hrdevice['hrDeviceIndex']."'");
|
||||
$proc_url = "device/".$device['device_id']."/health/processor/";
|
||||
$proc_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$hrdevice['hrDeviceDescr'];
|
||||
$proc_popup .= "</div><img src=\'graph.php?id=" . $proc_id . "&type=processor_usage&from=$month&to=$now&width=400&height=125\'>";
|
||||
@@ -32,7 +30,7 @@ while ($hrdevice = mysql_fetch_assoc($hrdevices))
|
||||
elseif ($hrdevice['hrDeviceType'] == "hrDeviceNetwork")
|
||||
{
|
||||
$int = str_replace("network interface ", "", $hrdevice['hrDeviceDescr']);
|
||||
$interface = mysql_fetch_assoc(mysql_query("SELECT * FROM ports WHERE device_id = '".$device['device_id']."' AND ifDescr = '".$int."'"));
|
||||
$interface = dbFetchRow("SELECT * FROM ports WHERE device_id = ? AND ifDescr = ?", array($device['device_id'], $int));
|
||||
if ($interface['ifIndex'])
|
||||
{
|
||||
echo("<td>".generate_port_link($interface)."</td>");
|
||||
@@ -65,4 +63,4 @@ while ($hrdevice = mysql_fetch_assoc($hrdevices))
|
||||
|
||||
echo('</table>');
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Reference in New Issue
Block a user