mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 16:04:35 +02:00
add some ASA support, clean up polling, clean up MAC table generation, add ARP table
git-svn-id: http://www.observium.org/svn/observer/trunk@467 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Executable
BIN
Binary file not shown.
|
After Width: | Height: | Size: 405 B |
@@ -5,6 +5,8 @@
|
||||
$interface['device_id'] = $device['device_id'];
|
||||
$interface['hostname'] = $device['hostname'];
|
||||
|
||||
$interface = ifNameDescr($interface);
|
||||
|
||||
$if_id = $interface['interface_id'];
|
||||
|
||||
if(!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
@@ -17,7 +19,7 @@
|
||||
<td valign=top width=300>");
|
||||
|
||||
echo(" <span class=list-large>
|
||||
" . generateiflink($interface, "$i. ".fixifName($interface['ifDescr'])) . " $error_img
|
||||
" . generateiflink($interface, $interface['ifIndex'] . ". ".fixifName($interface['label'])) . " $error_img
|
||||
|
||||
</span><br /><span class=interface-desc>".$interface['ifAlias']."</span>");
|
||||
|
||||
@@ -85,10 +87,10 @@
|
||||
|
||||
echo("</td>");
|
||||
echo("<td width=375 valign=top class=interface-desc>");
|
||||
if ( strpos($interface['ifDescr'], "oopback") === false && !$graph_type) {
|
||||
if ( strpos($interface['label'], "oopback") === false && !$graph_type) {
|
||||
$link_query = mysql_query("select * from links AS L, interfaces AS I, devices AS D WHERE L.src_if = '$if_id' AND L.dst_if = I.interface_id AND I.device_id = D.device_id");
|
||||
while($link = mysql_fetch_array($link_query)) {
|
||||
# echo("<img src='images/16/connect.png' align=absmiddle alt='Directly Connected' /> " . generateiflink($link, makeshortif($link['ifDescr'])) . " on " . generatedevicelink($link, shorthost($link['hostname'])) . "</a><br />");
|
||||
# echo("<img src='images/16/connect.png' align=absmiddle alt='Directly Connected' /> " . generateiflink($link, makeshortif($link['label'])) . " on " . generatedevicelink($link, shorthost($link['hostname'])) . "</a><br />");
|
||||
# $br = "<br />";
|
||||
$int_links[$link['interface_id']] = $link['interface_id'];
|
||||
$int_links_phys[$link['interface_id']] = 1;
|
||||
@@ -112,7 +114,7 @@ echo("</td>");
|
||||
$this_ifid = $new['interface_id'];
|
||||
$this_hostid = $new['device_id'];
|
||||
$this_hostname = $new['hostname'];
|
||||
$this_ifname = fixifName($new['ifDescr']);
|
||||
$this_ifname = fixifName($new['label']);
|
||||
$int_links[$this_ifid] = $this_ifid;
|
||||
$int_links_v4[$this_ifid] = 1;
|
||||
}
|
||||
@@ -132,7 +134,7 @@ echo("</td>");
|
||||
$this_ifid = $new['interface_id'];
|
||||
$this_hostid = $new['device_id'];
|
||||
$this_hostname = $new['hostname'];
|
||||
$this_ifname = fixifName($new['ifDescr']);
|
||||
$this_ifname = fixifName($new['label']);
|
||||
$int_links[$this_ifid] = $this_ifid;
|
||||
$int_links_v6[$this_ifid] = 1;
|
||||
}
|
||||
@@ -148,7 +150,7 @@ echo("</td>");
|
||||
if($int_links_phys[$int_link]) { echo("<img align=absmiddle src='images/16/connect.png'> "); } else {
|
||||
echo("<img align=absmiddle src='images/16/bullet_go.png'> "); }
|
||||
|
||||
echo("<b>" . generateiflink($link_if, makeshortif($link_if['ifDescr'])) . " on " . generatedevicelink($link_if, shorthost($link_if['hostname'])) );
|
||||
echo("<b>" . generateiflink($link_if, makeshortif($link_if['label'])) . " on " . generatedevicelink($link_if, shorthost($link_if['hostname'])) );
|
||||
|
||||
if($int_links_v6[$int_link]) { echo(" <b style='color: #a10000;'>v6</b>"); }
|
||||
if($int_links_v4[$int_link]) { echo(" <b style='color: #00a100'>v4</b>"); }
|
||||
@@ -166,7 +168,8 @@ echo("</td>");
|
||||
$pw_peer_int = mysql_fetch_array(mysql_query("SELECT * from `interfaces` AS I, pseudowires AS P WHERE I.device_id = '".$pseudowire['peer_device_id']."' AND
|
||||
P.cpwVcID = '".$pseudowire['cpwVcID']."' AND
|
||||
P.interface_id = I.interface_id"));
|
||||
echo("<img src='images/16/arrow_switch.png' align=absmiddle><b> " . generateiflink($pw_peer_int, makeshortif($pw_peer_int['ifDescr'])) ." on ". generatedevicelink($pw_peer_dev, shorthost($pw_peer_dev['hostname'])) . "</b>");
|
||||
$pw_peer_int = ifNameDescr($pw_peer_int);
|
||||
echo("<img src='images/16/arrow_switch.png' align=absmiddle><b> " . generateiflink($pw_peer_int, makeshortif($pw_peer_int['label'])) ." on ". generatedevicelink($pw_peer_dev, shorthost($pw_peer_dev['hostname'])) . "</b>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -16,9 +16,10 @@ $select[$section] = "selected";
|
||||
|
||||
$device_query = mysql_query("SELECT * FROM `devices` WHERE `device_id` = '" . $_GET['id'] . "'");
|
||||
while($device = mysql_fetch_array($device_query)) {
|
||||
echo("<table cellpadding=7 cellspacing=0 class=devicetable width=100%>");
|
||||
echo("<table cellpadding=15
|
||||
cellspacing=0 class=devicetable width=100%>");
|
||||
include("includes/device-header.inc");
|
||||
echo("</table><br />");
|
||||
echo("</table>");
|
||||
|
||||
echo("<div class=mainpane>");
|
||||
|
||||
|
||||
@@ -202,8 +202,9 @@ echo("
|
||||
$sql = "SELECT * FROM interfaces WHERE `device_id` = '" . $device['device_id'] . "'";
|
||||
$query = mysql_query($sql);
|
||||
while($data = mysql_fetch_array($query)) {
|
||||
$data = ifNameDescr($data);
|
||||
$data['hostname'] = $device['hostname'];
|
||||
echo("$ifsep" . generateiflink($data, makeshortif(strtolower($data['ifDescr']))));
|
||||
echo("$ifsep" . generateiflink($data, makeshortif(strtolower($data['label']))));
|
||||
$ifsep = ", ";
|
||||
}
|
||||
unset($ifsep);
|
||||
|
||||
@@ -60,16 +60,46 @@ if($_GET['optc'] == thumbs) {
|
||||
echo("</div>");
|
||||
} else {
|
||||
if($_GET['opta'] == "details" ) { $port_details = 1; }
|
||||
$hostname = gethostbyid($device['device_id']);
|
||||
echo("<div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=5 width=100%>");
|
||||
$i = "1";
|
||||
$interface_query = mysql_query("select * from interfaces WHERE device_id = '$_GET[id]' AND deleted = '0' ORDER BY `ifIndex` ASC");
|
||||
while($interface = mysql_fetch_array($interface_query)) {
|
||||
include("includes/print-interface.inc");
|
||||
$i++;
|
||||
if($_GET['opta'] == "arp" ) {
|
||||
|
||||
$interface_query = mysql_query("select * from interfaces WHERE device_id = '$_GET[id]' AND deleted = '0' ORDER BY `ifIndex` ASC");
|
||||
echo("<table border=0 cellspacing=0 cellpadding=3 width=800><tr><th>Address</th><th>Hardware Addr</th><th>Interface</th><th>Remote Device</th><th>Remote Port</th></tr>");
|
||||
$i = 1;
|
||||
while($interface = mysql_fetch_array($interface_query)) {
|
||||
$sql = "SELECT * FROM `ipv4_mac` WHERE `interface_id` = '".$interface['interface_id']."'";
|
||||
$arp_query = mysql_query($sql);
|
||||
while($arp = mysql_fetch_array($arp_query)) {
|
||||
$i++;
|
||||
if(!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
$r_sql = "SELECT * FROM `ipv4_addresses` AS A, `interfaces` AS I, `devices` AS D WHERE I.interface_id = A.interface_id AND
|
||||
I.device_id = D.device_id AND A.ipv4_address = '".$arp['ipv4_address']."' ORDER BY A.ipv4_address";
|
||||
$remote = mysql_fetch_array(mysql_query($r_sql));
|
||||
$mac = formatMac($arp['mac_address']);
|
||||
echo("<tr style=\"background-color: $row_colour; padding: 5px;\" valign=top>
|
||||
<td>" . $arp['ipv4_address'] . "</td><td>" . $mac . "</td><td>".generateiflink($interface)."</td>");
|
||||
if ($remote['interface_id'] == $interface['interface_id']) {
|
||||
echo("<td><i>local</i></td><td><i>local</i></td>");
|
||||
} elseif($remote['device_id']) {
|
||||
echo("<td>" . generatedevicelink($remote) . "</td><td>" . generateiflink($remote) . "</td>");
|
||||
} else {
|
||||
echo("<td></td><td></td>");
|
||||
}
|
||||
echo("</tr>");
|
||||
}
|
||||
echo("</div>");
|
||||
}
|
||||
echo("</table>");
|
||||
} else {
|
||||
echo("<div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=5 width=100%>");
|
||||
$i = "1";
|
||||
$interface_query = mysql_query("select * from interfaces WHERE device_id = '$_GET[id]' AND deleted = '0' ORDER BY `ifIndex` ASC");
|
||||
while($interface = mysql_fetch_array($interface_query)) {
|
||||
include("includes/print-interface.inc");
|
||||
$i++;
|
||||
}
|
||||
echo("</table></div>");
|
||||
echo("<div style='min-height: 150px;'></div>");
|
||||
}
|
||||
echo("</table></div>");
|
||||
echo("<div style='min-height: 150px;'></div>");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user