added hrdevice browser page (initial)

git-svn-id: http://www.observium.org/svn/observer/trunk@615 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-01-07 18:27:33 +00:00
parent d020f59761
commit f785a05489
2 changed files with 46 additions and 3 deletions

View File

@@ -138,17 +138,23 @@ if($_SESSION[userlevel] >= "5" && mysql_result(mysql_query("SELECT count(*) FROM
}
if($config['enable_inventory'] && @mysql_result(mysql_query("SELECT * FROM `entPhysical` WHERE device_id = '".$_GET['id']."'"), 0) > '0') {
echo("<li class=" . $select['entphysical'] . ">
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/entphysical/'>
<img src='images/16/bricks.png' align=absmiddle border=0> Inventory
</a>
</li>
");
} elseif ( $config['enable_inventory'] && @mysql_result(mysql_query("SELECT * FROM `hrDevice` WHERE device_id = '".$_GET['id']."'"), 0) > '0') {
echo("<li class=" . $select['hrdevice'] . ">
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/hrdevice/'>
<img src='images/16/bricks.png' align=absmiddle border=0> Inventory
</a>
</li>
");
}
#if(mysql_result(mysql_query("select count(storage_id) from storage WHERE host_id = '" . $device['device_id'] . "'"), 0) > '0') {
# echo("
#<li class=" . $select['storage'] . ">

View File

@@ -0,0 +1,37 @@
<?php
echo("<table width=100%>");
$hrdevices = mysql_query("SELECT * FROM `hrDevice` WHERE `device_id` = '".$device['device_id']."'");
while($hrdevice = mysql_fetch_array($hrdevices)) {
echo("<tr><td>".$hrdevice['hrDeviceIndex']."</td>");
if($hrdevice['hrDeviceType'] == "hrDeviceProcessor") {
$proc_url = "?page=device/".$device['device_id']."/health/hrprocessors/";
$proc_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$hrdevice['hrDeviceDescr'];
$proc_popup .= "</div><img src=\'graph.php?id=" . $hrdevice['hrDevice_id'] . "&type=hrProcessor&from=$month&to=$now&width=400&height=125\'>";
$proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
echo("<td><a href='#' $proc_popup>".$hrdevice['hrDeviceDescr']."</a></td>");
} elseif ($hrdevice['hrDeviceType'] == "hrDeviceNetwork") {
$int = str_replace("network interface ", "", $hrdevice['hrDeviceDescr']);
$interface = mysql_fetch_array(mysql_query("SELECT * FROM interfaces WHERE device_id = '".$device['device_id']."' AND ifDescr = '".$int."'"));
if($interface['ifIndex']) {
echo("<td>".generateiflink($interface)."</td>");
} else {
echo("<td>".$hrdevice['hrDeviceDescr']."</td>");
}
} else {
echo("<td>".$hrdevice['hrDeviceDescr']."</td>");
}
echo("<td>".$hrdevice['hrDeviceType']."</td><td>".$hrdevice['hrDeviceStatus']."</td>");
echo("<td>".$hrdevice['hrDeviceErrors']."</td><td>".$hrdevice['hrProcessorLoad']."</td>");
echo("</tr>");
}
echo("</table>");
?>