mirror of
https://github.com/librenms/librenms.git
synced 2024-09-27 05:18:10 +00:00
ff70062aa9
git-svn-id: http://www.observium.org/svn/observer/trunk@2 61d68cd4-352d-0410-923a-c4978735b2b8
44 lines
1.5 KiB
PHP
44 lines
1.5 KiB
PHP
<?php
|
|
if($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg="#ffffff"; }
|
|
echo("<table cellpadding=7 cellspacing=0 class=devicetable width=100%>");
|
|
|
|
if($_GET['id']) {
|
|
$type = $_GET['id'];
|
|
$sql = "select *, I.id as iid, I.ifIndex as ifIndex, D.id as did, D.hostname as hostname, I.if as ifname, I.name as ifalias ";
|
|
$sql .= "from interfaces as I, devices as D WHERE `name` like '$type: %' AND I.host = D.id ORDER BY I.name";
|
|
$query = mysql_query($sql);
|
|
while($data = mysql_fetch_array($query)) {
|
|
$done = "yes";
|
|
unset($class);
|
|
$iid = $data[iid];
|
|
$ifIndex = $data[ifIndex];
|
|
$did = $data[did];
|
|
$hostname = $data[hostname];
|
|
$up = $data[up];
|
|
$up_admin = $data[up_admin];
|
|
$ifname = fixifname($data[ifname]);
|
|
$ifalias = $data[ifalias];
|
|
$ifalias = str_replace($type . ": ", "", $ifalias);
|
|
$ifalias = str_replace("[PNI]", "Private", $ifalias);
|
|
$ifclass = ifclass($up, $up_admin);
|
|
if($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg="#ffffff"; }
|
|
echo("<tr bgcolor='$bg'>
|
|
<td><span class=interface><a href='?page=interface&id=$iid'>$ifalias</a></span><br />
|
|
<span class=interface-desc><a href='?page=device&id=$did'>$hostname</a> <a href='?page=interface&id=$iid'>$ifname</a></span></td></tr><tr bgcolor='$bg'><td>");
|
|
|
|
if(file_exists("rrd/" . $hostname . ".". $ifIndex . ".rrd")) {
|
|
|
|
$graph_type = "bits";
|
|
include("includes/print-interface-graphs.php");
|
|
|
|
}
|
|
echo("</td></tr>");
|
|
}
|
|
}
|
|
|
|
echo("</table>");
|
|
|
|
if(!$done) { echo("None found."); }
|
|
|
|
?>
|