diff --git a/discovery.php b/discovery.php index 07673c5176..201ca6d3df 100755 --- a/discovery.php +++ b/discovery.php @@ -58,6 +58,7 @@ while ($device = mysql_fetch_array($device_query)) { include("includes/discovery/cisco-physical.php"); include("includes/discovery/bgp-peers.php"); include("includes/discovery/cisco-pw.php"); + include("includes/discovery/cisco-vrf.php"); } echo("\n"); $devices_polled++; diff --git a/html/includes/print-interface.inc b/html/includes/print-interface.inc index c49dc120a5..67b84e350a 100644 --- a/html/includes/print-interface.inc +++ b/html/includes/print-interface.inc @@ -69,7 +69,12 @@ if($device['os'] == "IOS") { if($interface['ifTrunk']) { echo("" . $interface['ifTrunk'] . ""); - } elseif ($interface['ifVlan']) { echo("VLAN " . $interface['ifVlan'] . ""); } + } elseif ($interface['ifVlan']) { echo("VLAN " . $interface['ifVlan'] . ""); + } elseif ($interface['ifVrf']) { + $vrf = mysql_fetch_array(mysql_query("SELECT * FROM vrfs WHERE vrf_id = '".$interface['ifVrf']."'")); + echo("" . $vrf['vrf_name'] . ""); + } + } diff --git a/html/includes/print-vrf.inc b/html/includes/print-vrf.inc new file mode 100644 index 0000000000..6d68f8f225 --- /dev/null +++ b/html/includes/print-vrf.inc @@ -0,0 +1,20 @@ +"); + +echo(" " . $vrf['vrf_name'] . ""); +echo("" . $vrf['mplsVpnVrfRouteDistinguisher'] . ""); + +echo(""); +$ports_query = mysql_query("SELECT * FROM interfaces WHERE `device_id` = '" . $device['device_id'] . "' AND `ifVrf` = '" . $vrf['vrf_id'] . "' "); +while($port = mysql_fetch_array($ports_query)) { + + echo($vrf['port_sep'] . generateiflink($port, makeshortif($port['ifDescr']))); + $vrf['port_sep'] = ", "; +} +echo(""); +echo(""); + +?> diff --git a/html/pages/device.php b/html/pages/device.php index 8cdb51622f..567a075894 100644 --- a/html/pages/device.php +++ b/html/pages/device.php @@ -39,6 +39,16 @@ if(@mysql_result(mysql_query("select count(vlan_id) from vlans WHERE device_id = "); } +if(@mysql_result(mysql_query("select count(*) from vrfs WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0') { + echo(" +
  • + + VRFs + +
  • "); +} + + if($config['enable_bgp'] && $device['bgpLocalAs']) { echo("
  • diff --git a/html/pages/device/dev-vrfs.inc b/html/pages/device/dev-vrfs.inc new file mode 100644 index 0000000000..583f27cc1d --- /dev/null +++ b/html/pages/device/dev-vrfs.inc @@ -0,0 +1,12 @@ +"); + $i = "1"; + $vrf_query = mysql_query("select * from vrfs WHERE device_id = '".$_GET['id']."' ORDER BY 'vrf_name'"); + while($vrf = mysql_fetch_array($vrf_query)) { + include("includes/print-vrf.inc"); + $i++; + } + echo("
    "); + +?> diff --git a/includes/discovery/cisco-vrf.php b/includes/discovery/cisco-vrf.php new file mode 100755 index 0000000000..95fdd4524f --- /dev/null +++ b/includes/discovery/cisco-vrf.php @@ -0,0 +1,49 @@ +