[% PROCESS 'externallinks.tt' -%] [% FOREACH item IN settings.port_columns %] [% NEXT IF item.name == 'c_admin' %] [% NEXT IF item.name == 'c_links' AND settings.external_links.device_port.size == 0 %] [% NEXT IF item.name == 'c_nodes' AND params.c_nodes AND params.c_neighbors %] [% NEXT UNLESS params.${item.name} %] [% SET th_class = '' %] [% IF (item.name == 'c_port' OR item.name == 'c_descr' OR item.name == 'c_name') %] [% SET th_class = ' class="portsort"' %] [% END %] [% IF item.name == 'c_neighbors' %] [% IF params.c_nodes %] Connected Nodes & Devices [% ELSE %] Connected Devices [% END %] [% ELSE %] [% item.label | html_entity %] [% END %] [% END %] [% FOREACH row IN results %] [% SET portname = row.port %] [% IF params.c_port %] [% IF params.c_admin AND row.port_acl_service %] [% IF row.up_admin == 'up' %] [% END %] [% IF params.c_descr %] [% END %] [% IF params.c_comment %] [% END %] [% IF params.c_type %] [% END %] [% IF params.c_ifindex %] [% END %] [% IF params.c_lastchange %] [% END %] [% IF params.c_name %] [% IF params.c_admin AND row.port_acl_name %] [% END %] [% IF params.c_tags %] [% END %] [% FOREACH config IN settings._extra_device_port_cols %] [% NEXT UNLESS config.position == 'left' AND params.${config.name} %] [% NEXT UNLESS permitted_by_acl(row, config) %] [% TRY %] [% CATCH %] [% CLEAR %] [% IF params.c_admin AND config.editable AND row.port_acl_name %] [% END %] [% END %] [% IF params.c_links AND settings.external_links.device_port.size > 0 %] [% END %] [% IF params.c_speed_admin %] [% END %] [% IF params.c_speed %] [% END %] [% IF params.c_duplex_admin %] [% END %] [% IF params.c_duplex %] [% END %] [% IF params.c_error %] [% END %] [% IF params.c_mac %] [% END %] [% IF params.c_mtu %] [% END %] [% IF params.c_pvid %] [% IF params.c_admin AND row.port_acl_pvid %] [% ELSE %] [% END %] [% END %] [% IF params.c_vmember %] [% END %] [% IF params.c_power %] [% IF row.power %] [% IF row.power.admin == 'true' %] [% IF params.c_admin AND row.port_acl_service %] [% ELSE %] [% END %] [% END %] [% IF params.c_ssid %] [% END %] [% IF params.c_nac_summary %] [% END %] [% FOREACH config IN settings._extra_device_port_cols %] [% NEXT UNLESS config.position == 'mid' AND params.${config.name} %] [% NEXT UNLESS permitted_by_acl(row, config) %] [% TRY %] [% CATCH %] [% CLEAR %] [% IF params.c_admin AND config.editable AND row.port_acl_name %] [% END %] [% END %] [% IF params.c_nodes OR params.c_neighbors %] [% END %] [% IF params.c_stp %] [% END %] [% IF params.c_up %] [% END %] [% FOREACH config IN settings._extra_device_port_cols %] [% NEXT UNLESS config.position == 'right' AND params.${config.name} %] [% NEXT UNLESS permitted_by_acl(row, config) %] [% TRY %] [% CATCH %] [% CLEAR %] [% IF params.c_admin AND config.editable AND row.port_acl_name %] [% END %] [% END %] [% END %]
[% IF row.up_admin != 'up' %] [% ELSIF row.up == 'up' AND row.stp == 'blocking' AND vlans.$portname.vlan_count < 2 %] [% ELSIF row.error_disable_cause %] [% ELSIF row.has_column_loaded('is_free') AND row.is_free %] [% ELSIF row.up_admin == 'up' AND (row.up != 'up' AND row.up != 'dormant') %] [% IF params.port_state == 'free' %] [% ELSE %] [% END %] [% ELSE %] [% END %] [% IF row.slave_of %]
[% IF row.get_column('agg_master_up_admin') != 'up' %] [% ELSIF row.get_column('agg_master_up') == 'up' %] [% ELSE %] [% END %] [% END %]
[% ELSE %] [% END %] [% ELSE %] [% END %] [% IF params.c_admin AND row.port_acl_service %] [% IF row.up_admin == 'up' %] [% ELSE %] [% END %] [% END %] [% IF row.is_master OR row.has_subinterfaces %]   [% END %] [% row.port | html_entity %] [% IF row.slave_of %]
[% row.slave_of | html_entity %] [% END %]
[% row.descr | html_entity %][% row.last_comment | html_entity %][% row.type | html_entity %][% row.ifindex | html_entity %][% row.lastchange_stamp | html_entity %] [% ELSE %] [% END %]
[% row.name | html_entity %]
[% FOREACH t IN row.filtered_tags.sort %] [% t | html_entity %] [% END %] [% INCLUDE "plugin/${config.name}/device_port_column.tt" %] [% ELSE %] [% END %]
[% row.get_column(config.field) | html_entity %]
[% INCLUDE external_device_port_links item = row d = device %] [% row.speed_admin | html_entity %][% row.speed_running | html_entity %][% row.duplex_admin.ucfirst | html_entity %][% row.duplex.ucfirst | html_entity %][% row.error_disable_cause | html_entity %][% row.mac | html_entity %][% row.mtu | html_entity %]
[% IF row.vlan AND row.vlan > 0 %][% row.vlan | html_entity %][% END %]
[% IF row.vlan AND row.vlan > 0 %] [% row.get_column('native_vlan_name') | html_entity %] [% ELSE %] href="[% uri_for('/search') | none %]?tab=vlan&q=[% row.vlan | uri %]"> [% row.vlan | html_entity %] [% END %] [% END %] [% IF vlans.$portname.size %] [% IF vlans.$portname.vlan_count <= settings.devport_vlan_limit %] [% SET vlan_count = vlans.$portname.vlan_count %] [% IF params.p_vlan_names %][% SET vlanlist = vlans.$portname.vlan_name_set %] [% ELSE %][% SET vlanlist = vlans.$portname.vlan_set %][% END %] [% IF vlan_count > 10 %] [%# TODO make this a settable variable %]
([% vlan_count %])
Show VLANs
[% END %] [% FOREACH vlan IN vlanlist %] [% vlan | html_entity %] [% ', ' IF NOT loop.last %] [% END %] [% IF vlan_count > 10 %] [%# TODO make this a settable variable %]
[% END %] [% ELSE %] ([% vlans.$portname.vlan_count %] is too many to list) [% END %] [% END %]
[% ELSE %] [% END %] [% IF row.power.power AND row.power.power > 0 %] [% row.power.power | html_entity %] mW [% ELSE %] ([% row.power.status | html_entity %]) [% END %] [% ELSE %] [% IF params.c_admin AND row.port_acl_service %] [% ELSE %] [% END %] [% END %] [% row.ssid.ssid | html_entity %] [% IF row.up == 'up' AND (row.pae_authconfig_port_status OR row.pae_authconfig_state) %] [% SET sessuser = (row.pae_authsess_user_net_mac.$mac_format_call || row.pae_authsess_user.remove(settings.domain_suffix)) %] [% sessuser | html_entity %] [% END %] [% INCLUDE "plugin/${config.name}/device_port_column.tt" %] [% ELSE %] [% END %]
[% row.get_column(config.field) | html_entity %]
[% IF params.c_neighbors AND (row.remote_ip OR row.is_uplink) %] [% IF row.get_column('neighbor_ip') %] [% IF row.remote_is_phone %]   [% ELSIF row.remote_is_wap %]   [% END %] [% row.get_column('neighbor_dns').remove(settings.domain_suffix) || row.get_column('neighbor_ip') | html_entity %] [% IF row.remote_port %] - [% row.remote_port | html_entity %] [% END %]
[% IF params.n_inventory and row.remote_inventory %] [% row.remote_inventory | html_entity %]
[% END %] [% IF params.n_detailed_inventory %] ([% 'IP: '_ row.remote_ip IF row.remote_ip %] [% ' id: '_ row.remote_id IF row.remote_id %] [% ' type: '_ row.remote_type IF row.remote_type %])
[% END %] [% ELSIF row.remote_ip %]   [% IF row.remote_is_phone %]   [% ELSIF row.remote_is_wap %]   [% END %] [% row.remote_dns || row.remote_ip | html_entity %] [% IF row.remote_port %] - [% row.remote_port | html_entity %] [% END %]
[% IF params.n_inventory and row.remote_inventory %] [% row.remote_inventory | html_entity %]
[% END %] [% IF params.n_detailed_inventory and (row.remote_id or row.remote_type) %] ([% 'id: '_ row.remote_id IF row.remote_id %] [% ' type: '_ row.remote_type IF row.remote_type %])
[% END %] [% ELSE %]   (possible uplink) [% END %] [% END %] [% IF params.c_nodes %] [% FOREACH node IN row.$nodes %] [% '
' IF (row.remote_ip OR row.is_uplink) OR NOT loop.first %] [% '  ' IF NOT node.active %] [% ' ' IF node.wireless.defined %] [% node.net_mac.$mac_format_call | html_entity %] [% IF (node.vlan > 0) && (node.vlan != row.vlan) %] (on vlan [% node.vlan | html_entity %]) [% END %] [% IF params.n_ssid AND node.wireless.defined %] (SSID: [% FOREACH wlan IN node.wireless %] [% wlan.ssid | html_entity %] [% END %] ) [% END %] [% IF params.n_vendor AND node.manufacturer.defined %] (Vendor: [% FOREACH manufacturer IN node.manufacturer %] [% manufacturer.abbrev | html_entity %] [% END %] ) [% END %] [% ' (' _ node.time_last_age _ ')' IF params.n_age %] [% IF params.n_ip4 OR params.n_ip6 %] [% FOREACH ip IN node.$ips %]
  [% '  ' IF NOT ip.active %] [% SET dns = ip.dns %] [% IF dns %] [% dns | html_entity %] ([% ip.ip | html_entity %]) [% ELSE %] [% ip.ip | html_entity %] [% END %] [% END %] [% END %] [% IF params.n_netbios %] [% FOREACH nbt IN node.netbios %]
     \\[% nbt.domain | html_entity %]\[% nbt.nbname | html_entity %]
     [% nbt.nbuser || '[No User]' | html_entity %]@[% nbt.ip | html_entity %] [% END %] [% END %] [% END %] [% END %] [% IF params.c_admin AND settings.portctl_topology AND row.port_acl_service %] [% END %]
[% row.stp | html_entity %] [% row.up_admin.ucfirst | html_entity %] / [% row.up.ucfirst | html_entity %] [% INCLUDE "plugin/${config.name}/device_port_column.tt" %] [% ELSE %] [% END %]
[% row.get_column(config.field) | html_entity %]
[% IF params.c_admin AND user_has_role('port_control', device.ip) %] [% END %]