mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
ac45d853aa
git-svn-id: http://www.observium.org/svn/observer/trunk@433 61d68cd4-352d-0410-923a-c4978735b2b8
73 lines
2.3 KiB
PHP
73 lines
2.3 KiB
PHP
<?php
|
|
|
|
$sql = "SELECT * FROM `interfaces` AS I, `devices` AS D";
|
|
$sql .= " WHERE I.ifAlias like 'Cust: %' AND I.device_id = D.device_id ORDER BY I.ifAlias";
|
|
$query = mysql_query($sql);
|
|
|
|
if($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg="#ffffff"; }
|
|
|
|
echo("<table border=0 cellspacing=0 cellpadding=2 class=devicetable width=100%>");
|
|
|
|
echo("
|
|
<tr bgcolor='$list_colour_a'>
|
|
<th width='7'></th>
|
|
<th width='250'><span style='font-weight: bold;' class=interface>Customer</span></th>
|
|
<th width='150'>Device</th>
|
|
<th width='100'>Interface</th>
|
|
<th width='100'>Speed</th>
|
|
<th width='100'>Circuit</th>
|
|
<th>Notes</th>
|
|
</tr>
|
|
");
|
|
|
|
|
|
$customers = 1;
|
|
while($interface = mysql_fetch_array($query)) {
|
|
$device = &$interface;
|
|
|
|
unset($class);
|
|
|
|
$ifname = fixifname($device['ifDescr']);
|
|
|
|
$ifclass = ifclass($interface['ifOperStatus'], $interface['ifAdminStatus']);
|
|
|
|
list(,$customer) = preg_split("/[\:\[\]\{\}\(\)]/", $interface['ifAlias']);
|
|
list(,$circuit) = preg_split("/[\{\}]/", $interface['ifAlias']);
|
|
list(,$notes) = preg_split("/[\(\)]/", $interface['ifAlias']);
|
|
list(,$speed) = preg_split("/[\[\]]/", $interface['ifAlias']);
|
|
|
|
|
|
if ($customer == $prev_customer) {
|
|
unset($customer);
|
|
} else {
|
|
if(is_integer($customers/2)) { $bg_colour = $list_colour_a; } else { $bg_colour = $list_colour_b; }
|
|
$customers++;
|
|
$prev_customer = $customer;
|
|
}
|
|
|
|
if($device['os'] == "IOS") {
|
|
|
|
if($interface['ifTrunk']) { $vlan = "<span class=box-desc><span class=red>" . $interface['ifTrunk'] . "</span></span>";
|
|
} elseif ($interface['ifVlan']) { $vlan = "<span class=box-desc><span class=blue>VLAN " . $interface['ifVlan'] . "</span></span>";
|
|
} else { $vlan = ""; }
|
|
|
|
}
|
|
|
|
echo("
|
|
<tr bgcolor='$bg_colour'>
|
|
<td width='7'></td>
|
|
<td width='250'><span style='font-weight: bold;' class=interface>$customer</span></td>
|
|
<td width='150'>" . generatedevicelink($device) . "</td>
|
|
<td width='100'>" . generateiflink($interface, makeshortif($interface['ifDescr'])) . "</td>
|
|
<td width='100'>$speed</td>
|
|
<td width='100'>$circuit</td>
|
|
<td>$notes</td>
|
|
</tr>
|
|
");
|
|
|
|
}
|
|
|
|
echo("</table>");
|
|
|
|
?>
|