2017-02-03 21:20:25 +00:00
< script >
$ ( function () {
$ ( '[data-toggle="popover"]' ) . popover ()
})
</ script >
2011-04-27 17:42:11 +00:00
< ? php
2007-04-03 14:10:23 +00:00
2018-04-07 20:55:28 +00:00
use LibreNMS\Authentication\Auth ;
2017-08-08 19:14:58 +00:00
use LibreNMS\Util\IP ;
2015-07-13 18:10:26 +00:00
// This file prints a table row for each interface
2011-09-18 13:11:04 +00:00
$port [ 'device_id' ] = $device [ 'device_id' ];
2015-07-13 18:10:26 +00:00
$port [ 'hostname' ] = $device [ 'hostname' ];
2008-11-05 15:24:44 +00:00
2012-05-16 13:25:50 +00:00
$if_id = $port [ 'port_id' ];
2010-02-02 19:24:12 +00:00
2017-04-04 07:08:23 +00:00
$port = cleanPort ( $port );
2007-04-07 21:15:23 +00:00
2015-07-13 18:10:26 +00:00
if ( $int_colour ) {
$row_colour = $int_colour ;
2016-08-19 01:28:22 +00:00
} else {
2015-07-13 18:10:26 +00:00
if ( ! is_integer ( $i / 2 )) {
2018-02-12 09:15:44 +00:00
$row_colour = $config [ 'list_colour' ][ 'even' ];
2016-08-19 01:28:22 +00:00
} else {
2018-02-12 09:15:44 +00:00
$row_colour = $config [ 'list_colour' ][ 'odd' ];
2015-07-13 18:10:26 +00:00
}
2011-05-01 12:37:43 +00:00
}
2010-07-18 11:38:38 +00:00
2015-07-13 18:10:26 +00:00
$port_adsl = dbFetchRow ( 'SELECT * FROM `ports_adsl` WHERE `port_id` = ?' , array ( $port [ 'port_id' ]));
if ( $port [ 'ifInErrors_delta' ] > 0 || $port [ 'ifOutErrors_delta' ] > 0 ) {
2017-01-25 17:42:26 +00:00
$error_img = generate_port_link ( $port , " <i class='fa fa-flag fa-lg' style='color:red' aria-hidden='true'></i> " , 'port_errors' );
2016-08-19 01:28:22 +00:00
} else {
2015-07-13 18:10:26 +00:00
$error_img = '' ;
2011-03-17 11:29:23 +00:00
}
2015-07-13 18:10:26 +00:00
if ( dbFetchCell ( 'SELECT COUNT(*) FROM `mac_accounting` WHERE `port_id` = ?' , array ( $port [ 'port_id' ]))) {
2017-01-21 11:24:05 +00:00
$mac = " <a href=' " . generate_port_url ( $port , array ( 'view' => 'macaccounting' )) . " '><i class='fa fa-pie-chart fa-lg icon-theme' aria-hidden='true'></i></a> " ;
2016-08-19 01:28:22 +00:00
} else {
2015-07-13 18:10:26 +00:00
$mac = '' ;
}
2011-03-17 11:29:23 +00:00
2018-02-12 09:15:44 +00:00
echo " <tr style= \" background-color: $row_colour ; \" valign=top onmouseover= \" this.style.backgroundColor=' { $config [ 'list_colour' ][ 'highlight' ] } '; \" onmouseout= \" this.style.backgroundColor=' $row_colour '; \" style='cursor: pointer;'>
2016-01-10 17:19:58 +00:00
< td valign = top width = 350 > " ;
2015-12-04 14:35:02 +00:00
2018-04-07 20:55:28 +00:00
if ( Auth :: user () -> hasGlobalRead ()) {
2017-02-03 21:20:25 +00:00
$port_data = array_to_htmljson ( $port );
echo '<i class="fa fa-tag" data-toggle="popover" data-content="' . $port_data . '" data-html="true"></i>' ;
}
2015-12-04 14:35:02 +00:00
echo ' < span class = list - large >
'.generate_port_link($port, $port[' label ' ]) . " $error_img $mac
2017-04-04 07:08:23 +00:00
</ span >< br />< span class = interface - desc > " . $port['ifAlias'] .'</span>';
2011-03-17 11:29:23 +00:00
2015-07-13 18:10:26 +00:00
if ( $port [ 'ifAlias' ]) {
echo '<br />' ;
2011-03-17 11:29:23 +00:00
}
2015-07-13 18:10:26 +00:00
unset ( $break );
2011-03-17 11:29:23 +00:00
2015-07-13 18:10:26 +00:00
if ( $port_details ) {
foreach ( dbFetchRows ( 'SELECT * FROM `ipv4_addresses` WHERE `port_id` = ?' , array ( $port [ 'port_id' ])) as $ip ) {
2015-11-14 17:44:58 +00:00
echo " $break <a class=interface-desc href= \" javascript:popUp('netcmd.php?cmd=whois&query= $ip[ipv4_address] ') \" > " . $ip [ 'ipv4_address' ] . '/' . $ip [ 'ipv4_prefixlen' ] . '</a>' ;
2015-07-13 18:10:26 +00:00
$break = '<br />' ;
}
foreach ( dbFetchRows ( 'SELECT * FROM `ipv6_addresses` WHERE `port_id` = ?' , array ( $port [ 'port_id' ])) as $ip6 ) {
2017-08-08 19:14:58 +00:00
echo " $break <a class=interface-desc href= \" javascript:popUp('netcmd.php?cmd=whois&query= " . $ip6 [ 'ipv6_address' ] . " ') \" > " . IP :: parse ( $ip6 [ 'ipv6_address' ], true ) . '/' . $ip6 [ 'ipv6_prefixlen' ] . '</a>' ;
2015-07-13 18:10:26 +00:00
$break = '<br />' ;
}
2011-03-17 11:29:23 +00:00
}
2015-07-13 18:10:26 +00:00
echo '</span>' ;
2011-03-17 11:29:23 +00:00
2015-11-19 09:54:26 +00:00
echo " </td><td width=100 onclick= \" location.href=' " . generate_port_url ( $port ) . " ' \" > " ;
2011-03-17 11:29:23 +00:00
2015-07-13 18:10:26 +00:00
if ( $port_details ) {
$port [ 'graph_type' ] = 'port_bits' ;
echo generate_port_link ( $port , " <img src='graph.php?type=port_bits&id= " . $port [ 'port_id' ] . '&from=' . $config [ 'time' ][ 'day' ] . '&to=' . $config [ 'time' ][ 'now' ] . '&width=100&height=20&legend=no&bg=' . str_replace ( '#' , '' , $row_colour ) . " '> " );
$port [ 'graph_type' ] = 'port_upkts' ;
echo generate_port_link ( $port , " <img src='graph.php?type=port_upkts&id= " . $port [ 'port_id' ] . '&from=' . $config [ 'time' ][ 'day' ] . '&to=' . $config [ 'time' ][ 'now' ] . '&width=100&height=20&legend=no&bg=' . str_replace ( '#' , '' , $row_colour ) . " '> " );
$port [ 'graph_type' ] = 'port_errors' ;
echo generate_port_link ( $port , " <img src='graph.php?type=port_errors&id= " . $port [ 'port_id' ] . '&from=' . $config [ 'time' ][ 'day' ] . '&to=' . $config [ 'time' ][ 'now' ] . '&width=100&height=20&legend=no&bg=' . str_replace ( '#' , '' , $row_colour ) . " '> " );
}
2011-12-15 23:32:06 +00:00
2015-11-19 09:54:26 +00:00
echo " </td><td width=120 onclick= \" location.href=' " . generate_port_url ( $port ) . " ' \" > " ;
2015-07-13 18:10:26 +00:00
if ( $port [ 'ifOperStatus' ] == 'up' ) {
$port [ 'in_rate' ] = ( $port [ 'ifInOctets_rate' ] * 8 );
$port [ 'out_rate' ] = ( $port [ 'ifOutOctets_rate' ] * 8 );
$in_perc = @ round (( $port [ 'in_rate' ] / $port [ 'ifSpeed' ] * 100 ));
$out_perc = @ round (( $port [ 'in_rate' ] / $port [ 'ifSpeed' ] * 100 ));
2017-01-21 11:24:05 +00:00
echo " <i class='fa fa-long-arrow-left fa-lg' style='color:green' aria-hidden='true'></i> <span style='color: " . percent_colour ( $in_perc ) . " '> " . formatRates ( $port [ 'in_rate' ]) . " <br />
< i class = 'fa fa-long-arrow-right fa-lg' style = 'color:blue' aria - hidden = 'true' ></ i > < span style = 'color: ".percent_colour($out_perc)."' > " .formatRates( $port['out_rate'] ). " < br />
< i class = 'fa fa-long-arrow-left fa-lg' style = 'color:purple' aria - hidden = 'true' ></ i > " .format_bi( $port['ifInUcastPkts_rate'] ). " pps </ span >< br />
< i class = 'fa fa-long-arrow-right fa-lg' style = 'color:darkorange' aria - hidden = 'true' ></ i > " .format_bi( $port['ifOutUcastPkts_rate'] ).'pps</span>';
2011-03-17 11:29:23 +00:00
}
2009-04-23 21:13:56 +00:00
2015-11-19 09:54:26 +00:00
echo " </td><td width=75 onclick= \" location.href=' " . generate_port_url ( $port ) . " ' \" > " ;
2015-07-13 18:10:26 +00:00
if ( $port [ 'ifSpeed' ]) {
echo '<span class=box-desc>' . humanspeed ( $port [ 'ifSpeed' ]) . '</span>' ;
2011-03-17 11:29:23 +00:00
}
2007-04-03 14:10:23 +00:00
2015-07-13 18:10:26 +00:00
echo '<br />' ;
2018-07-13 22:08:00 +00:00
if ( $port [ 'ifDuplex' ] != 'unknown' ) {
2015-07-13 18:10:26 +00:00
echo '<span class=box-desc>' . $port [ 'ifDuplex' ] . '</span>' ;
2016-08-19 01:28:22 +00:00
} else {
2015-07-13 18:10:26 +00:00
echo '-' ;
}
2016-10-11 07:05:34 +00:00
$vlans = dbFetchColumn (
'SELECT vlan FROM `ports_vlans` AS PV, vlans AS V ' .
'WHERE PV.`port_id`=? AND PV.`device_id`=? AND V.`vlan_vlan`=PV.vlan AND V.device_id = PV.device_id' ,
array ( $port [ 'port_id' ], $device [ 'device_id' ])
);
$vlan_count = count ( $vlans );
if ( $vlan_count > 1 ) {
echo '<p class=box-desc><span class=purple><a href="' ;
echo generate_device_url ( $device , array ( 'tab' => 'vlans' ));
echo '" title="' ;
echo implode ( ', ' , $vlans );
echo '">VLANs: ' ;
echo $vlan_count ;
echo '</a></span></p>' ;
} elseif ( $vlan_count == 1 || $port [ 'ifVlan' ]) {
echo '<p class=box-desc><span class=blue>VLAN: ' ;
echo ( $vlans [ 0 ] ? : $port [ 'ifVlan' ]);
echo '</span></p>' ;
} elseif ( $port [ 'ifVrf' ]) {
$vrf = dbFetchRow ( 'SELECT * FROM vrfs WHERE vrf_id = ?' , array ( $port [ 'ifVrf' ]));
echo " <p style='color: green;'> " . $vrf [ 'vrf_name' ] . '</p>' ;
2015-07-13 18:10:26 +00:00
} //end if
if ( $port_adsl [ 'adslLineCoding' ]) {
2015-11-19 09:54:26 +00:00
echo " </td><td width=150 onclick= \" location.href=' " . generate_port_url ( $port ) . " ' \" > " ;
2015-07-13 18:10:26 +00:00
echo $port_adsl [ 'adslLineCoding' ] . '/' . rewrite_adslLineType ( $port_adsl [ 'adslLineType' ]);
echo '<br />' ;
echo 'Sync:' . formatRates ( $port_adsl [ 'adslAtucChanCurrTxRate' ]) . '/' . formatRates ( $port_adsl [ 'adslAturChanCurrTxRate' ]);
echo '<br />' ;
echo 'Max:' . formatRates ( $port_adsl [ 'adslAtucCurrAttainableRate' ]) . '/' . formatRates ( $port_adsl [ 'adslAturCurrAttainableRate' ]);
2015-11-19 09:54:26 +00:00
echo " </td><td width=150 onclick= \" location.href=' " . generate_port_url ( $port ) . " ' \" > " ;
2015-07-13 18:10:26 +00:00
echo 'Atten:' . $port_adsl [ 'adslAtucCurrAtn' ] . 'dB/' . $port_adsl [ 'adslAturCurrAtn' ] . 'dB' ;
echo '<br />' ;
echo 'SNR:' . $port_adsl [ 'adslAtucCurrSnrMgn' ] . 'dB/' . $port_adsl [ 'adslAturCurrSnrMgn' ] . 'dB' ;
2016-08-19 01:28:22 +00:00
} else {
2015-11-19 09:54:26 +00:00
echo " </td><td width=150 onclick= \" location.href=' " . generate_port_url ( $port ) . " ' \" > " ;
2015-07-13 18:10:26 +00:00
if ( $port [ 'ifType' ] && $port [ 'ifType' ] != '' ) {
echo '<span class=box-desc>' . fixiftype ( $port [ 'ifType' ]) . '</span>' ;
2016-08-19 01:28:22 +00:00
} else {
2015-07-13 18:10:26 +00:00
echo '-' ;
}
echo '<br />' ;
if ( $ifHardType && $ifHardType != '' ) {
echo '<span class=box-desc>' . $ifHardType . '</span>' ;
2016-08-19 01:28:22 +00:00
} else {
2015-07-13 18:10:26 +00:00
echo '-' ;
2011-03-17 11:29:23 +00:00
}
2010-02-25 01:30:07 +00:00
2015-11-19 09:54:26 +00:00
echo " </td><td width=150 onclick= \" location.href=' " . generate_port_url ( $port ) . " ' \" > " ;
2015-07-13 18:10:26 +00:00
if ( $port [ 'ifPhysAddress' ] && $port [ 'ifPhysAddress' ] != '' ) {
echo '<span class=box-desc>' . formatMac ( $port [ 'ifPhysAddress' ]) . '</span>' ;
2016-08-19 01:28:22 +00:00
} else {
2015-07-13 18:10:26 +00:00
echo '-' ;
2010-02-25 01:30:07 +00:00
}
2015-07-13 18:10:26 +00:00
echo '<br />' ;
if ( $port [ 'ifMtu' ] && $port [ 'ifMtu' ] != '' ) {
echo '<span class=box-desc>MTU ' . $port [ 'ifMtu' ] . '</span>' ;
2016-08-19 01:28:22 +00:00
} else {
2015-07-13 18:10:26 +00:00
echo '-' ;
}
} //end if
echo '</td>' ;
2015-11-19 09:54:26 +00:00
echo '<td width=375 valign=top class="interface-desc">' ;
$neighborsCount = 0 ;
2015-11-19 12:34:21 +00:00
$nbLinks = 0 ;
2015-07-13 18:10:26 +00:00
if ( strpos ( $port [ 'label' ], 'oopback' ) === false && ! $graph_type ) {
foreach ( dbFetchRows ( 'SELECT * FROM `links` AS L, `ports` AS I, `devices` AS D WHERE L.local_port_id = ? AND L.remote_port_id = I.port_id AND I.device_id = D.device_id' , array ( $if_id )) as $link ) {
$int_links [ $link [ 'port_id' ]] = $link [ 'port_id' ];
$int_links_phys [ $link [ 'port_id' ]] = 1 ;
2016-08-19 01:28:22 +00:00
$nbLinks ++ ;
2015-07-13 18:10:26 +00:00
}
2007-06-24 14:56:47 +00:00
2015-07-13 18:10:26 +00:00
unset ( $br );
if ( $port_details && $config [ 'enable_port_relationship' ] === true ) {
// Show which other devices are on the same subnet as this interface
foreach ( dbFetchRows ( " SELECT `ipv4_network_id` FROM `ipv4_addresses` WHERE `port_id` = ? AND `ipv4_address` NOT LIKE '127.%' " , array ( $port [ 'port_id' ])) as $net ) {
$ipv4_network_id = $net [ 'ipv4_network_id' ];
$sql = ' SELECT I . port_id FROM ipv4_addresses AS A , ports AS I , devices AS D
WHERE A . port_id = I . port_id
AND A . ipv4_network_id = ? AND D . device_id = I . device_id
AND D . device_id != ? ' ;
$array = array (
$net [ 'ipv4_network_id' ],
$device [ 'device_id' ],
);
foreach ( dbFetchRows ( $sql , $array ) as $new ) {
echo $new [ 'ipv4_network_id' ];
$this_ifid = $new [ 'port_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 ;
}
} //end foreach
foreach ( dbFetchRows ( 'SELECT ipv6_network_id FROM ipv6_addresses WHERE port_id = ?' , array ( $port [ 'port_id' ])) as $net ) {
$ipv6_network_id = $net [ 'ipv6_network_id' ];
$sql = " SELECT I.port_id FROM ipv6_addresses AS A, ports AS I, devices AS D
WHERE A . port_id = I . port_id
AND A . ipv6_network_id = ? AND D . device_id = I . device_id
AND D . device_id != ? AND A . ipv6_origin != 'linklayer' AND A . ipv6_origin != 'wellknown' " ;
$array = array (
$net [ 'ipv6_network_id' ],
$device [ 'device_id' ],
);
foreach ( dbFetchRows ( $sql , $array ) as $new ) {
echo $new [ 'ipv6_network_id' ];
$this_ifid = $new [ 'port_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 ;
}
} //end foreach
} //end if
2016-08-19 01:28:22 +00:00
if ( count ( $int_links ) > 3 ) {
2017-01-21 11:24:05 +00:00
echo ' < div class = " collapse-neighbors " >< i class = " neighbors-button fa fa-plus fa-lg " aria - hidden = " true " ></ i >
2015-11-19 12:34:21 +00:00
< span class = " neighbors-interface-list-firsts " style = " display: inline; " > ' ;
}
2016-08-19 01:28:22 +00:00
if ( $port_details && $config [ 'enable_port_relationship' ] === true && port_permitted ( $int_link , $device [ 'device_id' ])) {
2015-07-13 18:10:26 +00:00
foreach ( $int_links as $int_link ) {
2015-11-19 09:54:26 +00:00
$neighborsCount ++ ;
2016-08-19 01:28:22 +00:00
if ( $neighborsCount == 4 ) {
echo '<span class="neighbors-list-continued" style="display: inline;"></br>[...]</span>' ;
echo '</span>' ;
echo '<span class="neighbors-interface-list" style="display: none;">' ;
2015-11-19 09:54:26 +00:00
}
2015-07-13 18:10:26 +00:00
$link_if = dbFetchRow ( 'SELECT * from ports AS I, devices AS D WHERE I.device_id = D.device_id and I.port_id = ?' , array ( $int_link ));
2017-04-04 07:08:23 +00:00
$link_if = cleanPort ( $link_if );
2015-07-13 18:10:26 +00:00
echo " $br " ;
if ( $int_links_phys [ $int_link ]) {
2017-01-21 11:24:05 +00:00
echo " <i class='fa fa-plus fa-lg' style='color:black' aria-hidden='true'></i> " ;
2016-08-19 01:28:22 +00:00
} else {
2017-01-21 11:24:05 +00:00
echo " <i class='fa fa-arrow-right fa-lg' style='color:green' aria-hidden='true'></i> " ;
2015-07-13 18:10:26 +00:00
}
echo '<b>' . 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 " <b style='color: #a10000;'>v6</b> " ;
}
if ( $int_links_v4 [ $int_link ]) {
echo " <b style='color: #00a100'>v4</b> " ;
}
$br = '<br />' ;
} //end foreach
} //end if
// unset($int_links, $int_links_v6, $int_links_v4, $int_links_phys, $br);
} //end if
2015-08-23 20:01:09 +00:00
if ( $port_details && $config [ 'enable_port_relationship' ] === true && port_permitted ( $port [ 'port_id' ], $device [ 'device_id' ])) {
2015-07-13 18:10:26 +00:00
foreach ( dbFetchRows ( 'SELECT * FROM `pseudowires` WHERE `port_id` = ?' , array ( $port [ 'port_id' ])) as $pseudowire ) {
// `port_id`,`peer_device_id`,`peer_ldp_id`,`cpwVcID`,`cpwOid`
$pw_peer_dev = dbFetchRow ( 'SELECT * FROM `devices` WHERE `device_id` = ?' , array ( $pseudowire [ 'peer_device_id' ]));
$pw_peer_int = dbFetchRow ( 'SELECT * FROM `ports` AS I, pseudowires AS P WHERE I.device_id = ? AND P.cpwVcID = ? AND P.port_id = I.port_id' , array ( $pseudowire [ 'peer_device_id' ], $pseudowire [ 'cpwVcID' ]));
2017-04-04 07:08:23 +00:00
$pw_peer_int = cleanPort ( $pw_peer_int );
2017-01-21 11:24:05 +00:00
echo " $br <i class='fa fa-cube fa-lg' style='color:green' aria-hidden='true'></i><b> " . generate_port_link ( $pw_peer_int , makeshortif ( $pw_peer_int [ 'label' ])) . ' on ' . generate_device_link ( $pw_peer_dev , shorthost ( $pw_peer_dev [ 'hostname' ])) . '</b>' ;
2015-07-13 18:10:26 +00:00
$br = '<br />' ;
}
2007-06-24 14:56:47 +00:00
2015-07-13 18:10:26 +00:00
foreach ( dbFetchRows ( 'SELECT * FROM `ports` WHERE `pagpGroupIfIndex` = ? and `device_id` = ?' , array ( $port [ 'ifIndex' ], $device [ 'device_id' ])) as $member ) {
2017-04-04 07:08:23 +00:00
$member = cleanPort ( $member );
2017-01-21 11:24:05 +00:00
echo " $br <i class='fa fa-cube fa-lg icon-theme' aria-hidden='true'></i> <strong> " . generate_port_link ( $member ) . ' (PAgP)</strong>' ;
2015-07-13 18:10:26 +00:00
$br = '<br />' ;
}
2007-06-24 14:56:47 +00:00
2015-07-13 18:10:26 +00:00
if ( $port [ 'pagpGroupIfIndex' ] && $port [ 'pagpGroupIfIndex' ] != $port [ 'ifIndex' ]) {
$parent = dbFetchRow ( 'SELECT * FROM `ports` WHERE `ifIndex` = ? and `device_id` = ?' , array ( $port [ 'pagpGroupIfIndex' ], $device [ 'device_id' ]));
2017-04-04 07:08:23 +00:00
$parent = cleanPort ( $parent );
2017-01-21 11:24:05 +00:00
echo " $br <i class='fa fa-cube fa-lg icon-theme' aria-hidden='true'></i> <strong> " . generate_port_link ( $parent ) . ' (PAgP)</strong>' ;
2015-07-13 18:10:26 +00:00
$br = '<br />' ;
}
2007-06-24 14:56:47 +00:00
2015-07-13 18:10:26 +00:00
foreach ( dbFetchRows ( 'SELECT * FROM `ports_stack` WHERE `port_id_low` = ? and `device_id` = ?' , array ( $port [ 'ifIndex' ], $device [ 'device_id' ])) as $higher_if ) {
if ( $higher_if [ 'port_id_high' ]) {
$this_port = get_port_by_index_cache ( $device [ 'device_id' ], $higher_if [ 'port_id_high' ]);
2017-04-04 07:08:23 +00:00
$this_port = cleanPort ( $this_port );
2017-01-21 11:24:05 +00:00
echo " $br <i class='fa fa-expand fa-lg icon-theme' aria-hidden='true'></i> <strong> " . generate_port_link ( $this_port ) . '</strong>' ;
2015-07-13 18:10:26 +00:00
$br = '<br />' ;
}
}
2011-03-17 11:29:23 +00:00
2015-07-13 18:10:26 +00:00
foreach ( dbFetchRows ( 'SELECT * FROM `ports_stack` WHERE `port_id_high` = ? and `device_id` = ?' , array ( $port [ 'ifIndex' ], $device [ 'device_id' ])) as $lower_if ) {
if ( $lower_if [ 'port_id_low' ]) {
$this_port = get_port_by_index_cache ( $device [ 'device_id' ], $lower_if [ 'port_id_low' ]);
2017-04-04 07:08:23 +00:00
$this_port = cleanPort ( $this_port );
2017-01-21 11:24:05 +00:00
echo " $br <i class='fa fa-compress fa-lg icon-theme' aria-hidden='true'></i> <strong> " . generate_port_link ( $this_port ) . '</strong>' ;
2015-07-13 18:10:26 +00:00
$br = '<br />' ;
}
}
} //end if
2011-04-27 17:41:35 +00:00
2011-03-17 11:29:23 +00:00
unset ( $int_links , $int_links_v6 , $int_links_v4 , $int_links_phys , $br );
2016-08-19 01:28:22 +00:00
if ( $nbLinks > 3 ) {
echo '</span></div>' ;
2015-11-19 12:09:58 +00:00
}
echo '</td></tr>' ;
2011-03-17 11:29:23 +00:00
// If we're showing graphs, generate the graph and print the img tags
2015-07-13 18:10:26 +00:00
if ( $graph_type == 'etherlike' ) {
2016-08-19 01:28:22 +00:00
$graph_file = get_port_rrdfile_path ( $device [ 'hostname' ], $if_id , 'dot3' );
} else {
$graph_file = get_port_rrdfile_path ( $device [ 'hostname' ], $if_id );
2011-03-17 11:29:23 +00:00
}
2015-07-13 18:10:26 +00:00
if ( $graph_type && is_file ( $graph_file )) {
$type = $graph_type ;
2011-03-17 11:29:23 +00:00
2015-07-13 18:10:26 +00:00
echo " <tr style='background-color: $row_colour ; padding: 0px;'><td colspan=7> " ;
2007-06-24 14:56:47 +00:00
2015-07-13 18:10:26 +00:00
include 'includes/print-interface-graphs.inc.php' ;
2010-08-01 14:17:06 +00:00
2015-07-13 18:10:26 +00:00
echo '</td></tr>' ;
2011-03-17 11:29:23 +00:00
}