diff --git a/html/includes/dev-overview-data.inc.php b/html/includes/dev-overview-data.inc.php index eee3e9c1eb..ac7c60edb9 100644 --- a/html/includes/dev-overview-data.inc.php +++ b/html/includes/dev-overview-data.inc.php @@ -1,63 +1,64 @@ ' . $device['sysDescr'] . ""); - } +if ($config['overview_show_sysDescr']) +{ + echo('
' . $device['sysDescr'] . "
"); +} - $uptime = $device['uptime']; +$uptime = $device['uptime']; - if ($device['os'] == "ios") { formatCiscoHardware($device); } - if ($device['features']) { $device['features'] = "(".$device['features'].")"; } - $device['os_text'] = $config['os'][$device['os']]['text']; +if ($device['os'] == "ios") { formatCiscoHardware($device); } +if ($device['features']) { $device['features'] = "(".$device['features'].")"; } +$device['os_text'] = $config['os'][$device['os']]['text']; - echo(''); - - if($device['hardware']) - { - echo(' - - - '); - } - - if($device['serial']) - { - echo(' - - - '); - } +echo('
Hardware' . $device['hardware']. '
Serial' . $device['serial']. '
'); +if ($device['hardware']) +{ echo(' - - - '); + + + '); +} - if($device['sysContact']) - { - echo(' - - - '); - } +if ($device['serial']) +{ + echo(' + + + '); +} - if($device['location']) - { - echo(' - - - '); - } +echo(' + + + '); - if($uptime) - { - echo(' - - - '); - } +if ($device['sysContact']) +{ + echo(' + + + '); +} - echo(' -
Operating System' . $device['os_text'] . ' ' . $device['version'] . ' ' . $device['features'] . '
Hardware' . $device['hardware']. '
Contact' . htmlspecialchars($device['sysContact']). '
Serial' . $device['serial']. '
Location' . $device['location']. '
Operating System' . $device['os_text'] . ' ' . $device['version'] . ' ' . $device['features'] . '
Uptime' . formatUptime($uptime) . '
Contact' . htmlspecialchars($device['sysContact']). '
'); -?> +if ($device['location']) +{ + echo(' + Location + ' . $device['location']. ' + '); +} + +if ($uptime) +{ + echo(' + Uptime + ' . formatUptime($uptime) . ' + '); +} + +echo(' + '); + +?> \ No newline at end of file diff --git a/html/includes/header-small.inc.php b/html/includes/header-small.inc.php deleted file mode 100644 index 3d46147ca4..0000000000 --- a/html/includes/header-small.inc.php +++ /dev/null @@ -1,55 +0,0 @@ -
-
- - - diff --git a/html/includes/header.inc.php b/html/includes/header.inc.php index 158fff80fd..024aadb9c8 100644 --- a/html/includes/header.inc.php +++ b/html/includes/header.inc.php @@ -3,13 +3,15 @@ - ".$_SESSION['username']." (Logout)"); - } else { - echo("Not logged in!"); - } -# if( Net_IPv6::checkIPv6($_SERVER['REMOTE_ADDR'])) { echo(" via IPv6"); } else { echo(" via IPv4"); } +".$_SESSION['username']." (Logout)"); +} else { + echo("Not logged in!"); +} +# FIXME worksforme, why was this disabled again? -TL +# if (Net_IPv6::checkIPv6($_SERVER['REMOTE_ADDR'])) { echo(" via IPv6"); } else { echo(" via IPv4"); } ?> @@ -22,34 +24,16 @@ - $cur_major) { -# echo("New Version!
$major.$minor.$release
"); -# } elseif ($major == $cur_major && $minor > $cur_minor) { -# echo("New Version!
$major.$minor.$release
"); -# } elseif ($major == $cur_major && $minor == $cur_minor && $release > $cur_release) { -# echo("New Version!
$major.$minor.$release
"); -# } elseif($major < $cur_major || ($major == $cur_major && $minor < $cur_minor) || ($major == $cur_major && $minor == $cur_minor && $release < $cur_release)) { -# } -?> -
- +
- diff --git a/html/includes/port-edit.inc.php b/html/includes/port-edit.inc.php index 5433288429..0cd808d87e 100644 --- a/html/includes/port-edit.inc.php +++ b/html/includes/port-edit.inc.php @@ -23,7 +23,7 @@ foreach ($_POST as $key => $val) { continue; } - + if (!mysql_query('UPDATE `ports` SET `ignore`='.$newval.' WHERE `device_id`='.$device_id.' AND `interface_id`='.$interface_id)) { $n = -1; @@ -38,7 +38,7 @@ foreach ($_POST as $key => $val) $rows_updated = -1; break; } - + $rows_updated += $n; } } diff --git a/html/includes/print-interface.inc.php b/html/includes/print-interface.inc.php index 91762676e3..c14b312412 100644 --- a/html/includes/print-interface.inc.php +++ b/html/includes/print-interface.inc.php @@ -4,254 +4,264 @@ #print_r($interface); #echo(""); -# This file prints a table row for each interface - - $interface['device_id'] = $device['device_id']; - $interface['hostname'] = $device['hostname']; +# This file prints a table row for each interface - $if_id = $interface['interface_id']; +$interface['device_id'] = $device['device_id']; +$interface['hostname'] = $device['hostname']; - $interface = ifLabel($interface); +$if_id = $interface['interface_id']; - if(!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } +$interface = ifLabel($interface); - $port_adsl_query = mysql_query("SELECT * FROM `ports_adsl` WHERE `interface_id` = '".$interface['interface_id']."'"); - $port_adsl = mysql_fetch_assoc($port_adsl_query); +if (!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } +$port_adsl_query = mysql_query("SELECT * FROM `ports_adsl` WHERE `interface_id` = '".$interface['interface_id']."'"); +$port_adsl = mysql_fetch_assoc($port_adsl_query); - if($interface['ifInErrors_delta'] > 0 || $interface['ifOutErrors_delta'] > 0) { - $error_img = generate_port_link($interface, "Interface Errors", "port_errors"); - } else { $error_img = ""; } +if ($interface['ifInErrors_delta'] > 0 || $interface['ifOutErrors_delta'] > 0) +{ + $error_img = generate_port_link($interface, "Interface Errors", "port_errors"); +} else { $error_img = ""; } - if(mysql_result(mysql_query("SELECT count(*) FROM mac_accounting WHERE interface_id = '".$interface['interface_id']."'"),0)){ - $mac = ""; - } else { $mac = ""; } +if (mysql_result(mysql_query("SELECT count(*) FROM mac_accounting WHERE interface_id = '".$interface['interface_id']."'"),0)) +{ + $mac = ""; +} else { $mac = ""; } - echo(" - "); +echo(" + "); +echo(" + " . generate_port_link($interface, $interface['ifIndex'] . ". ".$interface['label']) . " $error_img $mac - echo(" - " . generate_port_link($interface, $interface['ifIndex'] . ". ".$interface['label']) . " $error_img $mac +
".$interface['ifAlias'].""); -

".$interface['ifAlias'].""); +if ($interface['ifAlias']) { echo("
"); } - if($interface['ifAlias']) { echo("
"); } - - unset ($break); - if($port_details) { - $ipdata = mysql_query("SELECT * FROM `ipv4_addresses` WHERE `interface_id` = '" . $interface['interface_id'] . "'"); - while($ip = mysql_fetch_Array($ipdata)) { - echo("$break $ip[ipv4_address]/$ip[ipv4_prefixlen]"); - $break = "
"; - } - $ip6data = mysql_query("SELECT * FROM `ipv6_addresses` WHERE `interface_id` = '" . $interface['interface_id'] . "'"); - while($ip6 = mysql_fetch_Array($ip6data)) { - echo("$break ".Net_IPv6::compress($ip6['ipv6_address'])."/".$ip6['ipv6_prefixlen'].""); - $break = "
"; - } +unset ($break); +if ($port_details) +{ + $ipdata = mysql_query("SELECT * FROM `ipv4_addresses` WHERE `interface_id` = '" . $interface['interface_id'] . "'"); + while ($ip = mysql_fetch_Array($ipdata)) { + echo("$break $ip[ipv4_address]/$ip[ipv4_prefixlen]"); + $break = "
"; } - - echo(""); - - echo(""); - - if($port_details) { - $interface['graph_type'] = "port_bits"; - echo(generate_port_link($interface, "")); - $interface['graph_type'] = "port_upkts"; - echo(generate_port_link($interface, "")); - $interface['graph_type'] = "port_errors"; - echo(generate_port_link($interface, "")); + $ip6data = mysql_query("SELECT * FROM `ipv6_addresses` WHERE `interface_id` = '" . $interface['interface_id'] . "'"); + while ($ip6 = mysql_fetch_Array($ip6data)) { + echo("$break ".Net_IPv6::compress($ip6['ipv6_address'])."/".$ip6['ipv6_prefixlen'].""); + $break = "
"; } +} - echo(""); - if($interface['ifOperStatus'] == "up") { - $interface['in_rate'] = $interface['ifInOctets_rate'] * 8; - $interface['out_rate'] = $interface['ifOutOctets_rate'] * 8; - $in_perc = @round($interface['in_rate']/$interface['ifSpeed']*100); - $out_perc = @round($interface['in_rate']/$interface['ifSpeed']*100); - echo(" ".formatRates($interface['in_rate'])."
- ".formatRates($interface['out_rate']) . "
- ".format_bi($interface['ifInUcastPkts_rate'])."pps

- ".format_bi($interface['ifOutUcastPkts_rate'])."pps
"); +echo(""); + +echo(""); + +if ($port_details) +{ + $interface['graph_type'] = "port_bits"; + echo(generate_port_link($interface, "")); + $interface['graph_type'] = "port_upkts"; + echo(generate_port_link($interface, "")); + $interface['graph_type'] = "port_errors"; + echo(generate_port_link($interface, "")); +} + +echo(""); + +if ($interface['ifOperStatus'] == "up") +{ + $interface['in_rate'] = $interface['ifInOctets_rate'] * 8; + $interface['out_rate'] = $interface['ifOutOctets_rate'] * 8; + $in_perc = @round($interface['in_rate']/$interface['ifSpeed']*100); + $out_perc = @round($interface['in_rate']/$interface['ifSpeed']*100); + echo(" ".formatRates($interface['in_rate'])."
+ ".formatRates($interface['out_rate']) . "
+ ".format_bi($interface['ifInUcastPkts_rate'])."pps

+ ".format_bi($interface['ifOutUcastPkts_rate'])."pps
"); +} + +echo(""); +if ($interface['ifSpeed']) { echo("".humanspeed($interface['ifSpeed']).""); } +echo("
"); + +if ($interface[ifDuplex] != "unknown") { echo("" . $interface['ifDuplex'] . ""); } else { echo("-"); } + +if ($device['os'] == "ios" || $device['os'] == "iosxe") +{ + if ($interface['ifTrunk']) { + echo("" . $interface['ifTrunk'] . ""); + } 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'] . ""); } +} - echo(""); - if($interface['ifSpeed']) { echo("".humanspeed($interface['ifSpeed']).""); } +if ($port_adsl['adslLineCoding']) +{ + echo(""); + echo($port_adsl['adslLineCoding']."/".$port_adsl['adslLineType']); echo("
"); - - if($interface[ifDuplex] != "unknown") { echo("" . $interface['ifDuplex'] . ""); } else { echo("-"); } - - if($device['os'] == "ios" || $device['os'] == "iosxe") { - if($interface['ifTrunk']) { - echo("" . $interface['ifTrunk'] . ""); - } 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'] . ""); - } - } - - if($port_adsl['adslLineCoding']) { - echo(""); - echo($port_adsl['adslLineCoding']."/".$port_adsl['adslLineType']); - echo("
"); - echo("Sync:".formatRates($port_adsl['adslAtucChanCurrTxRate']) . "/". formatRates($port_adsl['adslAturChanCurrTxRate'])); - echo("
"); - echo("Max:".formatRates($port_adsl['adslAtucCurrAttainableRate']) . "/". formatRates($port_adsl['adslAturCurrAttainableRate'])); - echo(""); - echo("Atten:".$port_adsl['adslAtucCurrAtn'] . "dB/". $port_adsl['adslAturCurrAtn'] . "dB"); - echo("
"); - echo("SNR:".$port_adsl['adslAtucCurrSnrMgn'] . "dB/". $port_adsl['adslAturCurrSnrMgn']. "dB"); - } else { - echo(""); - if($interface['ifType'] && $interface['ifType'] != "") { echo("" . fixiftype($interface['ifType']) . ""); } else { echo("-"); } - echo("
"); - if($ifHardType && $ifHardType != "") { echo("" . $ifHardType . ""); } else { echo("-"); } - echo(""); - if($interface['ifPhysAddress'] && $interface['ifPhysAddress'] != "") { echo("" . $interface['ifPhysAddress'] . ""); } else { echo("-"); } - echo("
"); - if($interface['ifMtu'] && $interface['ifMtu'] != "") { echo("MTU " . $interface['ifMtu'] . ""); } else { echo("-"); } - } -#} + echo("Sync:".formatRates($port_adsl['adslAtucChanCurrTxRate']) . "/". formatRates($port_adsl['adslAturChanCurrTxRate'])); + echo("
"); + echo("Max:".formatRates($port_adsl['adslAtucCurrAttainableRate']) . "/". formatRates($port_adsl['adslAturCurrAttainableRate'])); + echo(""); + echo("Atten:".$port_adsl['adslAtucCurrAtn'] . "dB/". $port_adsl['adslAturCurrAtn'] . "dB"); + echo("
"); + echo("SNR:".$port_adsl['adslAtucCurrSnrMgn'] . "dB/". $port_adsl['adslAturCurrSnrMgn']. "dB"); +} else { + echo(""); + if ($interface['ifType'] && $interface['ifType'] != "") { echo("" . fixiftype($interface['ifType']) . ""); } else { echo("-"); } + echo("
"); + if ($ifHardType && $ifHardType != "") { echo("" . $ifHardType . ""); } else { echo("-"); } + echo(""); + if ($interface['ifPhysAddress'] && $interface['ifPhysAddress'] != "") { echo("" . $interface['ifPhysAddress'] . ""); } else { echo("-"); } + echo("
"); + if ($interface['ifMtu'] && $interface['ifMtu'] != "") { echo("MTU " . $interface['ifMtu'] . ""); } else { echo("-"); } +} echo(""); - echo(""); - if ( strpos($interface['label'], "oopback") === false && !$graph_type) { - $link_query = mysql_query("select * from links AS L, ports AS I, devices AS D WHERE L.local_interface_id = '$if_id' AND L.remote_interface_id = I.interface_id AND I.device_id = D.device_id"); - while($link = mysql_fetch_array($link_query)) { +echo(""); +if (strpos($interface['label'], "oopback") === false && !$graph_type) +{ + $link_query = mysql_query("select * from links AS L, ports AS I, devices AS D WHERE L.local_interface_id = '$if_id' AND L.remote_interface_id = I.interface_id AND I.device_id = D.device_id"); + while ($link = mysql_fetch_array($link_query)) + { # echo("Directly Connected " . generate_port_link($link, makeshortif($link['label'])) . " on " . generate_device_link($link, shorthost($link['hostname'])) . "
"); # $br = "
"; - $int_links[$link['interface_id']] = $link['interface_id']; - $int_links_phys[$link['interface_id']] = 1; - } - - unset($br); - - if($port_details) { ## Show which other devices are on the same subnet as this interface - - $sql = "SELECT `ipv4_network_id` FROM `ipv4_addresses` WHERE `interface_id` = '".$interface['interface_id']."' AND `ipv4_address` NOT LIKE '127.%'"; - $nets_query = mysql_query($sql); - while($net = mysql_fetch_array($nets_query)) { - $ipv4_network_id = $net['ipv4_network_id']; - $sql = "SELECT I.interface_id FROM ipv4_addresses AS A, ports AS I, devices AS D - WHERE A.interface_id = I.interface_id - AND A.ipv4_network_id = '".$net['ipv4_network_id']."' AND D.device_id = I.device_id - AND D.device_id != '".$device['device_id']."'"; - $new_query = mysql_query($sql); - while($new = mysql_fetch_array($new_query)) { - echo($new['ipv4_network_id']); - $this_ifid = $new['interface_id']; - $this_hostid = $new['device_id']; - $this_hostname = $new['hostname']; - $this_ifname = fixifName($new['label']); - $int_links[$this_ifid] = $this_ifid; - $int_links_v4[$this_ifid] = 1; - } - } - - $sql = "SELECT ipv6_network_id FROM ipv6_addresses WHERE interface_id = '".$interface['interface_id']."'"; - $nets_query = mysql_query($sql); - while($net = mysql_fetch_array($nets_query)) { - $ipv6_network_id = $net['ipv6_network_id']; - $sql = "SELECT I.interface_id FROM ipv6_addresses AS A, ports AS I, devices AS D - WHERE A.interface_id = I.interface_id - AND A.ipv6_network_id = '".$net['ipv6_network_id']."' AND D.device_id = I.device_id - AND D.device_id != '".$device['device_id']."' AND A.ipv6_origin != 'linklayer' AND A.ipv6_origin != 'wellknown'"; - $new_query = mysql_query($sql); - while($new = mysql_fetch_array($new_query)) { - echo($new['ipv6_network_id']); - $this_ifid = $new['interface_id']; - $this_hostid = $new['device_id']; - $this_hostname = $new['hostname']; - $this_ifname = fixifName($new['label']); - $int_links[$this_ifid] = $this_ifid; - $int_links_v6[$this_ifid] = 1; - } - } - } - - foreach($int_links as $int_link) { - - $link_if = mysql_fetch_array(mysql_query("SELECT * from ports AS I, devices AS D WHERE I.device_id = D.device_id and I.interface_id = '".$int_link."'")); - - echo("$br"); - - if($int_links_phys[$int_link]) { echo(" "); } else { - echo(" "); } - - echo("" . generate_port_link($link_if, makeshortif($link_if['label'])) . " on " . generate_device_link($link_if, shorthost($link_if['hostname'])) ); - - if($int_links_v6[$int_link]) { echo(" v6"); } - if($int_links_v4[$int_link]) { echo(" v4"); } - $br = "
"; - } - -# unset($int_links, $int_links_v6, $int_links_v4, $int_links_phys, $br); - - } - - $pseudowires = mysql_query("SELECT * FROM `pseudowires` WHERE `interface_id` = '" . $interface['interface_id'] . "'"); - while($pseudowire = mysql_fetch_array($pseudowires)) { - #`interface_id`,`peer_device_id`,`peer_ldp_id`,`cpwVcID`,`cpwOid` - $pw_peer_dev = mysql_fetch_array(mysql_query("SELECT * from `devices` WHERE `device_id` = '" . $pseudowire['peer_device_id'] . "'")); - $pw_peer_int = mysql_fetch_array(mysql_query("SELECT * from `ports` 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")); - $pw_peer_int = ifNameDescr($pw_peer_int); - echo("$br " . generate_port_link($pw_peer_int, makeshortif($pw_peer_int['label'])) ." on ". generate_device_link($pw_peer_dev, shorthost($pw_peer_dev['hostname'])) . ""); - $br = "
"; + $int_links[$link['interface_id']] = $link['interface_id']; + $int_links_phys[$link['interface_id']] = 1; } - $members = mysql_query("SELECT * FROM `ports` WHERE `pagpGroupIfIndex` = '".$interface['ifIndex']."' and `device_id` = '".$device['device_id']."'"); - while($member = mysql_fetch_array($members)) { - echo("$br " . generate_port_link($member) . " (PAgP)"); - $br = "
"; - } + unset($br); - if($interface['pagpGroupIfIndex'] && $interface['pagpGroupIfIndex'] != $interface['ifIndex']) { - $parent = mysql_fetch_array(mysql_query("SELECT * FROM `ports` WHERE `ifIndex` = '".$interface['pagpGroupIfIndex']."' and `device_id` = '".$device['device_id']."'")); - echo("$br " . generate_port_link($parent) . " (PAgP)"); - $br = "
"; - } - - - unset($int_links, $int_links_v6, $int_links_v4, $int_links_phys, $br); - - - echo(""); - - // If we're showing graphs, generate the graph and print the img tags - - if($graph_type == "etherlike") - { - $graph_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/port-". safename($interface['ifIndex']) . "-dot3.rrd"; - } else { - $graph_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/port-". safename($interface['ifIndex']) . ".rrd"; + if ($port_details) + { ## Show which other devices are on the same subnet as this interface + $sql = "SELECT `ipv4_network_id` FROM `ipv4_addresses` WHERE `interface_id` = '".$interface['interface_id']."' AND `ipv4_address` NOT LIKE '127.%'"; + $nets_query = mysql_query($sql); + while ($net = mysql_fetch_array($nets_query)) + { + $ipv4_network_id = $net['ipv4_network_id']; + $sql = "SELECT I.interface_id FROM ipv4_addresses AS A, ports AS I, devices AS D + WHERE A.interface_id = I.interface_id + AND A.ipv4_network_id = '".$net['ipv4_network_id']."' AND D.device_id = I.device_id + AND D.device_id != '".$device['device_id']."'"; + $new_query = mysql_query($sql); + while ($new = mysql_fetch_array($new_query)) + { + echo($new['ipv4_network_id']); + $this_ifid = $new['interface_id']; + $this_hostid = $new['device_id']; + $this_hostname = $new['hostname']; + $this_ifname = fixifName($new['label']); + $int_links[$this_ifid] = $this_ifid; + $int_links_v4[$this_ifid] = 1; + } } - if($graph_type && is_file($graph_file)) { - - $type = $graph_type; + $sql = "SELECT ipv6_network_id FROM ipv6_addresses WHERE interface_id = '".$interface['interface_id']."'"; + $nets_query = mysql_query($sql); + while ($net = mysql_fetch_array($nets_query)) + { + $ipv6_network_id = $net['ipv6_network_id']; + $sql = "SELECT I.interface_id FROM ipv6_addresses AS A, ports AS I, devices AS D + WHERE A.interface_id = I.interface_id + AND A.ipv6_network_id = '".$net['ipv6_network_id']."' AND D.device_id = I.device_id + AND D.device_id != '".$device['device_id']."' AND A.ipv6_origin != 'linklayer' AND A.ipv6_origin != 'wellknown'"; + $new_query = mysql_query($sql); + while ($new = mysql_fetch_array($new_query)) + { + echo($new['ipv6_network_id']); + $this_ifid = $new['interface_id']; + $this_hostid = $new['device_id']; + $this_hostname = $new['hostname']; + $this_ifname = fixifName($new['label']); + $int_links[$this_ifid] = $this_ifid; + $int_links_v6[$this_ifid] = 1; + } + } + } - $daily_traffic = "graph.php?id=$if_id&type=" . $graph_type . "&from=$day&to=$now&width=210&height=100"; - $daily_url = "graph.php?id=$if_id&type=" . $graph_type . "&from=$day&to=$now&width=500&height=150"; + foreach ($int_links as $int_link) + { + $link_if = mysql_fetch_array(mysql_query("SELECT * from ports AS I, devices AS D WHERE I.device_id = D.device_id and I.interface_id = '".$int_link."'")); - $weekly_traffic = "graph.php?id=$if_id&type=" . $graph_type . "&from=$week&to=$now&width=210&height=100"; - $weekly_url = "graph.php?id=$if_id&type=" . $graph_type . "&from=$week&to=$now&width=500&height=150"; + echo("$br"); - $monthly_traffic = "graph.php?id=$if_id&type=" . $graph_type . "&from=$month&to=$now&width=210&height=100"; - $monthly_url = "graph.php?id=$if_id&type=" . $graph_type . "&from=$month&to=$now&width=500&height=150"; + if ($int_links_phys[$int_link]) { echo(" "); } else { + echo(" "); } - $yearly_traffic = "graph.php?id=$if_id&type=" . $graph_type . "&from=$year&to=$now&width=210&height=100"; - $yearly_url = "graph.php?id=$if_id&type=" . $graph_type . "&from=$year&to=$now&width=500&height=150"; + echo("" . generate_port_link($link_if, makeshortif($link_if['label'])) . " on " . generate_device_link($link_if, shorthost($link_if['hostname'])) ); + + if ($int_links_v6[$int_link]) { echo(" v6"); } + if ($int_links_v4[$int_link]) { echo(" v4"); } + $br = "
"; + } +# unset($int_links, $int_links_v6, $int_links_v4, $int_links_phys, $br); +} + +$pseudowires = mysql_query("SELECT * FROM `pseudowires` WHERE `interface_id` = '" . $interface['interface_id'] . "'"); +while ($pseudowire = mysql_fetch_array($pseudowires)) +{ +#`interface_id`,`peer_device_id`,`peer_ldp_id`,`cpwVcID`,`cpwOid` + $pw_peer_dev = mysql_fetch_array(mysql_query("SELECT * from `devices` WHERE `device_id` = '" . $pseudowire['peer_device_id'] . "'")); + $pw_peer_int = mysql_fetch_array(mysql_query("SELECT * from `ports` 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")); + $pw_peer_int = ifNameDescr($pw_peer_int); + echo("$br " . generate_port_link($pw_peer_int, makeshortif($pw_peer_int['label'])) ." on ". generate_device_link($pw_peer_dev, shorthost($pw_peer_dev['hostname'])) . ""); + $br = "
"; +} + +$members = mysql_query("SELECT * FROM `ports` WHERE `pagpGroupIfIndex` = '".$interface['ifIndex']."' and `device_id` = '".$device['device_id']."'"); +while ($member = mysql_fetch_array($members)) +{ + echo("$br " . generate_port_link($member) . " (PAgP)"); + $br = "
"; +} + +if ($interface['pagpGroupIfIndex'] && $interface['pagpGroupIfIndex'] != $interface['ifIndex']) +{ + $parent = mysql_fetch_array(mysql_query("SELECT * FROM `ports` WHERE `ifIndex` = '".$interface['pagpGroupIfIndex']."' and `device_id` = '".$device['device_id']."'")); + echo("$br " . generate_port_link($parent) . " (PAgP)"); + $br = "
"; +} + +unset($int_links, $int_links_v6, $int_links_v4, $int_links_phys, $br); + +echo(""); + +// If we're showing graphs, generate the graph and print the img tags + +if ($graph_type == "etherlike") +{ + $graph_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/port-". safename($interface['ifIndex']) . "-dot3.rrd"; +} else { + $graph_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/port-". safename($interface['ifIndex']) . ".rrd"; +} + +if ($graph_type && is_file($graph_file)) +{ + $type = $graph_type; + + $daily_traffic = "graph.php?id=$if_id&type=" . $graph_type . "&from=$day&to=$now&width=210&height=100"; + $daily_url = "graph.php?id=$if_id&type=" . $graph_type . "&from=$day&to=$now&width=500&height=150"; + + $weekly_traffic = "graph.php?id=$if_id&type=" . $graph_type . "&from=$week&to=$now&width=210&height=100"; + $weekly_url = "graph.php?id=$if_id&type=" . $graph_type . "&from=$week&to=$now&width=500&height=150"; + + $monthly_traffic = "graph.php?id=$if_id&type=" . $graph_type . "&from=$month&to=$now&width=210&height=100"; + $monthly_url = "graph.php?id=$if_id&type=" . $graph_type . "&from=$month&to=$now&width=500&height=150"; + + $yearly_traffic = "graph.php?id=$if_id&type=" . $graph_type . "&from=$year&to=$now&width=210&height=100"; + $yearly_url = "graph.php?id=$if_id&type=" . $graph_type . "&from=$year&to=$now&width=500&height=150"; echo(""); -include("includes/print-interface-graphs.inc.php"); + include("includes/print-interface-graphs.inc.php"); -# echo("', LEFT".$config['overlib_defaults'].");\" +# echo("', LEFT".$config['overlib_defaults'].");\" # onmouseout=\"return nd();\"> "); # echo("', LEFT".$config['overlib_defaults'].");\" # onmouseout=\"return nd();\"> "); @@ -262,6 +272,6 @@ include("includes/print-interface-graphs.inc.php"); echo(""); - } +} - ?> +?> \ No newline at end of file diff --git a/html/includes/print-quadgraphs.inc.php b/html/includes/print-quadgraphs.inc.php index 2bbd06075a..051abb53d2 100644 --- a/html/includes/print-quadgraphs.inc.php +++ b/html/includes/print-quadgraphs.inc.php @@ -1,22 +1,23 @@ +?> \ No newline at end of file