diff --git a/lib/App/Netdisco/DB/Result/DevicePort.pm b/lib/App/Netdisco/DB/Result/DevicePort.pm index d90b6cd6..64662835 100644 --- a/lib/App/Netdisco/DB/Result/DevicePort.pm +++ b/lib/App/Netdisco/DB/Result/DevicePort.pm @@ -379,6 +379,14 @@ Returns true if the remote LLDP neighbor has reported Telephone capability. sub remote_is_phone { return (shift)->get_column('remote_is_phone') } +=head2 ifindex + +Returns the interface index (C) of the port. + +=cut + +sub ifindex { return (shift)->get_column('ifindex') } + =head2 remote_inventory Returns a synthesized description of the remote LLDP device if inventory diff --git a/lib/App/Netdisco/DB/ResultSet/DevicePort.pm b/lib/App/Netdisco/DB/ResultSet/DevicePort.pm index 8dcfbfee..0f042acf 100644 --- a/lib/App/Netdisco/DB/ResultSet/DevicePort.pm +++ b/lib/App/Netdisco/DB/ResultSet/DevicePort.pm @@ -136,6 +136,8 @@ will add the following additional synthesized columns to the result set: =item remote_is_phone (boolean) +=item ifindex + =back =cut @@ -152,10 +154,12 @@ sub with_properties { properties.remote_is_discoverable properties.remote_is_wap properties.remote_is_phone + properties.ifindex /], '+as' => [qw/ error_disable_cause remote_is_discoverable remote_is_wap remote_is_phone + ifindex /], join => 'properties', }); diff --git a/share/config.yml b/share/config.yml index 88411efc..287a9d6a 100644 --- a/share/config.yml +++ b/share/config.yml @@ -116,16 +116,17 @@ sidebar_defaults: c_descr: { label: 'Description', default: null, idx: 2 } c_comment: { label: 'Last Comment', default: null, idx: 3 } c_type: { label: 'Type', default: null, idx: 4 } - c_lastchange: { label: 'Last Change', default: null, idx: 5 } - c_name: { label: 'Name', default: checked, idx: 6 } - c_speed_admin: { label: 'Speed (configured)', default: null, idx: 7 } - c_speed: { label: 'Speed (running)', default: null, idx: 8 } - c_duplex: { label: 'Duplex', default: null, idx: 9 } - c_error: { label: 'Error Message', default: null, idx: 10 } - c_mac: { label: 'Port MAC', default: null, idx: 11 } - c_mtu: { label: 'MTU', default: null, idx: 12 } - c_pvid: { label: 'Native VLAN', default: checked, idx: 13 } - c_vmember: { label: 'VLAN Membership', default: checked, idx: 14 } + c_ifindex: { label: 'Interface Index', default: null, idx: 5 } + c_lastchange: { label: 'Last Change', default: null, idx: 6 } + c_name: { label: 'Name', default: checked, idx: 7 } + c_speed_admin: { label: 'Speed (configured)', default: null, idx: 8 } + c_speed: { label: 'Speed (running)', default: null, idx: 9 } + c_duplex: { label: 'Duplex', default: null, idx: 10 } + c_error: { label: 'Error Message', default: null, idx: 11 } + c_mac: { label: 'Port MAC', default: null, idx: 12 } + c_mtu: { label: 'MTU', default: null, idx: 13 } + c_pvid: { label: 'Native VLAN', default: checked, idx: 14 } + c_vmember: { label: 'VLAN Membership', default: checked, idx: 15 } c_power: { label: 'PoE', default: null, idx: 16 } c_ssid: { label: 'SSID', default: null, idx: 17 } c_nodes: { label: 'Connected Nodes', default: null, idx: 18 } diff --git a/share/views/ajax/device/ports.tt b/share/views/ajax/device/ports.tt index efc069a1..dde16ebd 100644 --- a/share/views/ajax/device/ports.tt +++ b/share/views/ajax/device/ports.tt @@ -153,6 +153,10 @@ [% END %] + [% IF params.c_ifindex %] + [% row.ifindex | html_entity %] + [% END %] + [% IF params.c_lastchange %] [% row.lastchange_stamp | html_entity %] [% END %] diff --git a/share/views/ajax/device/ports_csv.tt b/share/views/ajax/device/ports_csv.tt index 23956362..42d756a3 100644 --- a/share/views/ajax/device/ports_csv.tt +++ b/share/views/ajax/device/ports_csv.tt @@ -79,6 +79,10 @@ [% END %] [% END %] + [% IF params.c_ifindex %] + [% myport.push(row.ifindex) %] + [% END %] + [% IF params.c_lastchange %] [% myport.push(row.lastchange_stamp) %] [% END %]