Skip to content

Commit

Permalink
Add new templates for Alcatel AOS: show interfaces ethernet (#1946)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilmonkey19 authored Jan 7, 2025
1 parent 5235423 commit da70dba
Show file tree
Hide file tree
Showing 9 changed files with 357 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
Value PORT (\S+)
Value STATUS (\S+)
Value ADMIN_STATUS (\S+)
Value PORT_DOWN_VIOLATION_REASON (\S.+\S)
Value LAST_TIME_LINK_CHANGED (\S.+\S)
Value NUMBER_OF_STATUS_CHANGE (\d+)
Value PORT_TYPE (\S.+\S)
Value SFP_XFP (\S.+\S)
Value INTERFACE_TYPE (\S.+\S)
Value ETHERNET_POWER_POLICY (\S.+\S)
Value LINK_QUALITY (\S.+\S)
Value MAC_ADDRESS (\S.+\S)
Value BANDWIDTH (\d+)
Value DUPLEX (\S+)
Value AUTONEGOTIATION (\S.+\S)
Value LONG_FRAME_SIZE (\d+)
Value INTER_FRAME_GAP (\d+)
Value LOOPBACK_MODE (\S.+\S)
Value RX_BYTES_RECEIVED (\d+)
Value RX_BROADCAST_FRAMES (\d+)
Value RX_UNDERSIZE_FRAMES (\d+)
Value RX_LOST_FRAMES (\d+)
Value RX_CRC_ERROR_FRAMES (\d+)
Value RX_UNICAST_FRAMES (\d+)
Value RX_MULTICAST_FRAMES (\d+)
Value RX_OVERSIZE_FRAMES (\d+)
Value RX_ERROR_FRAMES (\d+)
Value RX_ALIGNMENT_ERRORS (\d+)
Value TX_BYTES_TRANSMITTED (\d+)
Value TX_BROADCAST_FRAMES (\d+)
Value TX_UNDERSIZE_FRAMES (\d+)
Value TX_LOST_FRAMES (\d+)
Value TX_ERROR_FRAMES (\d+)
Value TX_UNICAST_FRAMES (\d+)
Value TX_MULTICAST_FRAMES (\d+)
Value TX_OVERSIZE_FRAMES (\d+)
Value TX_COLLIDED_FRAMES (\d+)
Value TX_COLLISIONS (\d+)
Value TX_LATE_COLLISIONS (\d+)
Value TX_EXCESSIVE_COLLISIONS (\d+)


Start
# R6
^\s*Slot\/Port\s*${PORT}\s*:\s*$$
# R8
^\s*Chassis\/Slot\/Port\s*:\s*${PORT}\s*$$
^\s*Operational\s*Status\s*:\s*${STATUS},\s*(?:"(?:${ADMIN_STATUS})?"\s*)?$$
^\s*Port-Down\/Violation\s*Reason\s*:\s*${PORT_DOWN_VIOLATION_REASON},\s*$$
^\s*Last\s*Time\s*Link\s*Changed\s*:\s*${LAST_TIME_LINK_CHANGED}\s*,\s*$$
^\s*Number\s*of\s*Status\s*Change\s*:\s*${NUMBER_OF_STATUS_CHANGE},\s*$$
^\s*Type\s*:\s*${PORT_TYPE},\s*$$
^\s*SFP\/(?:SFP\+\/)?XFP\s*:\s*${SFP_XFP},\s*$$
^\s*Interface\s*Type\s*:\s*${INTERFACE_TYPE},\s*$$
^\s*EPP\s*:\s*${ETHERNET_POWER_POLICY},\s*$$
^\s*Link-Quality\s*:\s*${LINK_QUALITY},\s*$$
^\s*MAC\s*address\s*:\s*${MAC_ADDRESS},\s*$$
^\s*BandWidth\s*\(Megabits\)\s*:\s*(-|${BANDWIDTH})\s*,\s*Duplex\s*:\s*(-|${DUPLEX})\s*,\s*$$
^\s*Autonegotiation\s*:\s*\d+\s*\[(\s*|\s*${AUTONEGOTIATION}\s*)\],\s*$$
^\s*Long\s*Frame\s*Size\(Bytes\)\s*:\s*${LONG_FRAME_SIZE},\s*$$
^\s*Inter\s*Frame\s*Gap\(Bytes\)\s*:\s*${INTER_FRAME_GAP},\s*$$
^\s*loopback\s*mode\s*:\s*${LOOPBACK_MODE},\s*$$
^\s*Rx\s*:\s*$$ -> RX_Table
^\s*Tx\s*:\s*$$ -> TX_Table
^\s*$$
^.+ -> Error

RX_Table
^\s*Bytes\s*Received\s*:\s*${RX_BYTES_RECEIVED},\s*Unicast\s*Frames\s*:\s*${RX_UNICAST_FRAMES},\s*$$
^\s*Broadcast\s*Frames\s*:\s*${RX_BROADCAST_FRAMES},\s*M-cast\s*Frames\s*:\s*${RX_MULTICAST_FRAMES},\s*$$
^\s*UnderSize\s*Frames\s*:\s*${RX_UNDERSIZE_FRAMES},\s*OverSize\s*Frames\s*:\s*${RX_OVERSIZE_FRAMES},\s*$$
^\s*Lost\s*Frames\s*:\s*${RX_LOST_FRAMES},\s*Error\s*Frames\s*:\s*${RX_ERROR_FRAMES},\s*$$
^\s*CRC\s*Error\s*Frames\s*:\s*${RX_CRC_ERROR_FRAMES},\s*Alignments\s*Err\s*:\s*${RX_ALIGNMENT_ERRORS},\s*$$ -> Start
^\s*$$
^. -> Error

TX_Table
^\s*Bytes\s*Xmitted\s*:\s*${TX_BYTES_TRANSMITTED},\s*Unicast\s*Frames\s*:\s*${TX_UNICAST_FRAMES},\s*$$
^\s*Broadcast\s*Frames\s*:\s*${TX_BROADCAST_FRAMES},\s*M-cast\s*Frames\s*:\s*${TX_MULTICAST_FRAMES},\s*$$
^\s*UnderSize\s*Frames\s*:\s*${TX_UNDERSIZE_FRAMES},\s*OverSize\s*Frames\s*:\s*${TX_OVERSIZE_FRAMES},\s*$$
^\s*Lost\s*Frames\s*:\s*${TX_LOST_FRAMES},\s*Collided\s*Frames\s*:\s*${TX_COLLIDED_FRAMES},\s*$$
^\s*Error\s*Frames\s*:\s*${TX_ERROR_FRAMES}\s*$$ -> Record Start
^\s*Error\s*Frames\s*:\s*${TX_ERROR_FRAMES}(?:,\s*Collisions\s*:\s*${TX_COLLISIONS},)?\s*$$
^\s*Late\s*collisions\s*:\s*${TX_LATE_COLLISIONS},\s*Exc-Collisions\s*:\s*${TX_EXCESSIVE_COLLISIONS}\s*$$ -> Record Start
^\s*$$
^. -> Error
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Value Filldown PORT (\S+)
Value Key,Filldown PORT (\S+)
Value Key ONT_ID (\d+)
Value Required RUN_STATE (\w+)
Value LAST_UPTIME (\S+\s*\S+)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Value Key,Filldown PORT (\S+)
Value Key ONT_ID (\d+)
Value SERIAL_NUMBER (\w+)
Value ONT_MODEL_TYPE (\S+)
Expand All @@ -8,7 +9,7 @@ Value DESCRIPTION (\S.+\S)

Start
^\s*Command\s*is\s*being\s*executed\.\s*Please\s*wait\s*$$
^\s*In\s*port\s*\S+,\s*the\s*total\s*of\s*ONTs\s*are:\s*\d+,\s*online:\s*\d+\s*$$
^\s*In\s*port\s*${PORT},\s*the\s*total\s*of\s*ONTs\s*are:\s*\d+,\s*online:\s*\d+\s*$$
^\s*ONT\s*Run\s*Last\s*Last\s*Last\s*$$
^\s*ID\s*State\s*UpTime\s*DownTime\s*DownCause\s*$$
^\s*\d+\s*\S+\s*(-|\S+\s\S+)\s*(-|\S+\s*\S+)\s*\S+\s*$$
Expand Down
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#
Template, Hostname, Platform, Command

alcatel_aos_show_interfaces_ethernet.textfsm, .*, alcatel_aos, sh[[ow]] (in[[terfaces]] e[[thernet]]|in[[terfaces]])$$
alcatel_aos_show_lldp_remote-system.textfsm, .*, alcatel_aos, sh[[ow]] lldp r[[emote-system]]
alcatel_aos_show_interfaces_status.textfsm, .*, alcatel_aos, sh[[ow]] in[[terfaces]] st[[atus]]
alcatel_aos_show_mac-address-table.textfsm, .*, alcatel_aos, sh[[ow]] mac-(a[[ddress-table]]|l[[earning]])
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Chassis/Slot/Port : 1/1/30
Operational Status : up,
Port-Down/Violation Reason: None,
Last Time Link Changed : Sun Jan 08 01:14:25 2024,
Number of Status Change : 1,
Type : Ethernet,
SFP/XFP : GBIC_LX,
Interface Type : Fiber,
EPP : Disabled,
Link-Quality : N/A,
MAC address : aa:bb:cc:dd:ee:ff,
BandWidth (Megabits) : 1000, Duplex : Full,
Autonegotiation : 1 [ 1000-F ],
Long Frame Size(Bytes) : 9216,
Inter Frame Gap(Bytes) : 12,
loopback mode : N/A,
Rx :
Bytes Received : 9419904, Unicast Frames : 0,
Broadcast Frames: 0, M-cast Frames : 73593,
UnderSize Frames: 0, OverSize Frames: 0,
Lost Frames : 0, Error Frames : 0,
CRC Error Frames: 0, Alignments Err : 0,
Tx :
Bytes Xmitted : 155215209608, Unicast Frames : 3121178,
Broadcast Frames: 1616888391, M-cast Frames : 80210193,
UnderSize Frames: 0, OverSize Frames: 0,
Lost Frames : 0, Collided Frames: 0,
Error Frames : 0, Collisions : 0,
Late collisions : 0, Exc-Collisions : 0
Chassis/Slot/Port : 1/1/31
Operational Status : up,
Port-Down/Violation Reason: None,
Last Time Link Changed : Sun Jan 22 01:14:25 2024,
Number of Status Change : 1,
Type : Ethernet,
SFP/XFP : GBIC_LX,
Interface Type : Fiber,
EPP : Disabled,
Link-Quality : N/A,
MAC address : ab:cd:ef:12:34:56,
BandWidth (Megabits) : 1000, Duplex : Full,
Autonegotiation : 0 [ ],
Long Frame Size(Bytes) : 9216,
Inter Frame Gap(Bytes) : 12,
loopback mode : N/A,
Rx :
Bytes Received : 542857246503, Unicast Frames : 631292769,
Broadcast Frames: 366413, M-cast Frames : 777995,
UnderSize Frames: 0, OverSize Frames: 0,
Lost Frames : 0, Error Frames : 0,
CRC Error Frames: 0, Alignments Err : 0,
Tx :
Bytes Xmitted : 361668198206, Unicast Frames : 488416804,
Broadcast Frames: 1618263684, M-cast Frames : 79968048,
UnderSize Frames: 0, OverSize Frames: 0,
Lost Frames : 0, Collided Frames: 0,
Error Frames : 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
parsed_sample:
- admin_status: ""
autonegotiation: "1000-F"
bandwidth: "1000"
duplex: "Full"
ethernet_power_policy: "Disabled"
inter_frame_gap: "12"
interface_type: "Fiber"
last_time_link_changed: "Sun Jan 08 01:14:25 2024"
link_quality: "N/A"
long_frame_size: "9216"
loopback_mode: "N/A"
mac_address: "aa:bb:cc:dd:ee:ff"
number_of_status_change: "1"
port: "1/1/30"
port_down_violation_reason: "None"
port_type: "Ethernet"
rx_alignment_errors: "0"
rx_broadcast_frames: "0"
rx_bytes_received: "9419904"
rx_crc_error_frames: "0"
rx_error_frames: "0"
rx_lost_frames: "0"
rx_multicast_frames: "73593"
rx_oversize_frames: "0"
rx_undersize_frames: "0"
rx_unicast_frames: "0"
sfp_xfp: "GBIC_LX"
status: "up"
tx_broadcast_frames: "1616888391"
tx_bytes_transmitted: "155215209608"
tx_collided_frames: "0"
tx_collisions: "0"
tx_error_frames: "0"
tx_excessive_collisions: "0"
tx_late_collisions: "0"
tx_lost_frames: "0"
tx_multicast_frames: "80210193"
tx_oversize_frames: "0"
tx_undersize_frames: "0"
tx_unicast_frames: "3121178"
- admin_status: ""
autonegotiation: ""
bandwidth: "1000"
duplex: "Full"
ethernet_power_policy: "Disabled"
inter_frame_gap: "12"
interface_type: "Fiber"
last_time_link_changed: "Sun Jan 22 01:14:25 2024"
link_quality: "N/A"
long_frame_size: "9216"
loopback_mode: "N/A"
mac_address: "ab:cd:ef:12:34:56"
number_of_status_change: "1"
port: "1/1/31"
port_down_violation_reason: "None"
port_type: "Ethernet"
rx_alignment_errors: "0"
rx_broadcast_frames: "366413"
rx_bytes_received: "542857246503"
rx_crc_error_frames: "0"
rx_error_frames: "0"
rx_lost_frames: "0"
rx_multicast_frames: "777995"
rx_oversize_frames: "0"
rx_undersize_frames: "0"
rx_unicast_frames: "631292769"
sfp_xfp: "GBIC_LX"
status: "up"
tx_broadcast_frames: "1618263684"
tx_bytes_transmitted: "361668198206"
tx_collided_frames: "0"
tx_collisions: ""
tx_error_frames: "0"
tx_excessive_collisions: ""
tx_late_collisions: ""
tx_lost_frames: "0"
tx_multicast_frames: "79968048"
tx_oversize_frames: "0"
tx_undersize_frames: "0"
tx_unicast_frames: "488416804"
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Slot/Port 1/1 :
Operational Status : up, ""
Last Time Link Changed : MON JAN 08 20:38:47 ,
Number of Status Change: 2,
Type : Ethernet,
SFP/SFP+/XFP : Not Present,
MAC address : aa:aa:aa:aa:aa:aa,
BandWidth (Megabits) : 1000, Duplex : Full,
Autonegotiation : 1 [ 1000-F 100-F 100-H 10-F 10-H ],
Long Frame Size(Bytes) : 9216,
Rx :
Bytes Received : 28902644070, Unicast Frames : 62119123,
Broadcast Frames: 123797, M-cast Frames : 358499,
UnderSize Frames: 0, OverSize Frames: 0,
Lost Frames : 0, Error Frames : 0,
CRC Error Frames: 0, Alignments Err : 0,
Tx :
Bytes Xmitted : 274375376582, Unicast Frames : 97599952,
Broadcast Frames: 1746630116, M-cast Frames : 87217616,
UnderSize Frames: 0, OverSize Frames: 0,
Lost Frames : 0, Collided Frames: 0,
Error Frames : 0
Slot/Port 1/2 :
Operational Status : down, "Admin-Down"
Last Time Link Changed : WED JAN 10 10:00:26 ,
Number of Status Change: 2,
Type : Ethernet,
SFP/SFP+/XFP : GBIC_LX,
MAC address : bb:bb:bb:bb:bb:bb,
BandWidth (Megabits) : - , Duplex : -,
Autonegotiation : 1 [ 1000-F ],
Long Frame Size(Bytes) : 9216,
Rx :
Bytes Received : 1602614019301, Unicast Frames : 1423093884,
Broadcast Frames: 131096783, M-cast Frames : 9298965,
UnderSize Frames: 0, OverSize Frames: 0,
Lost Frames : 0, Error Frames : 0,
CRC Error Frames: 0, Alignments Err : 0,
Tx :
Bytes Xmitted : 313945899784, Unicast Frames : 702405038,
Broadcast Frames: 94040, M-cast Frames : 3193107,
UnderSize Frames: 0, OverSize Frames: 0,
Lost Frames : 0, Collided Frames: 0,
Error Frames : 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
parsed_sample:
- admin_status: ""
autonegotiation: "1000-F 100-F 100-H 10-F 10-H"
bandwidth: "1000"
duplex: "Full"
ethernet_power_policy: ""
inter_frame_gap: ""
interface_type: ""
last_time_link_changed: "MON JAN 08 20:38:47"
link_quality: ""
long_frame_size: "9216"
loopback_mode: ""
mac_address: "aa:aa:aa:aa:aa:aa"
number_of_status_change: "2"
port: "1/1"
port_down_violation_reason: ""
port_type: "Ethernet"
rx_alignment_errors: "0"
rx_broadcast_frames: "123797"
rx_bytes_received: "28902644070"
rx_crc_error_frames: "0"
rx_error_frames: "0"
rx_lost_frames: "0"
rx_multicast_frames: "358499"
rx_oversize_frames: "0"
rx_undersize_frames: "0"
rx_unicast_frames: "62119123"
sfp_xfp: "Not Present"
status: "up"
tx_broadcast_frames: "1746630116"
tx_bytes_transmitted: "274375376582"
tx_collided_frames: "0"
tx_collisions: ""
tx_error_frames: "0"
tx_excessive_collisions: ""
tx_late_collisions: ""
tx_lost_frames: "0"
tx_multicast_frames: "87217616"
tx_oversize_frames: "0"
tx_undersize_frames: "0"
tx_unicast_frames: "97599952"
- admin_status: "Admin-Down"
autonegotiation: "1000-F"
bandwidth: ""
duplex: ""
ethernet_power_policy: ""
inter_frame_gap: ""
interface_type: ""
last_time_link_changed: "WED JAN 10 10:00:26"
link_quality: ""
long_frame_size: "9216"
loopback_mode: ""
mac_address: "bb:bb:bb:bb:bb:bb"
number_of_status_change: "2"
port: "1/2"
port_down_violation_reason: ""
port_type: "Ethernet"
rx_alignment_errors: "0"
rx_broadcast_frames: "131096783"
rx_bytes_received: "1602614019301"
rx_crc_error_frames: "0"
rx_error_frames: "0"
rx_lost_frames: "0"
rx_multicast_frames: "9298965"
rx_oversize_frames: "0"
rx_undersize_frames: "0"
rx_unicast_frames: "1423093884"
sfp_xfp: "GBIC_LX"
status: "down"
tx_broadcast_frames: "94040"
tx_bytes_transmitted: "313945899784"
tx_collided_frames: "0"
tx_collisions: ""
tx_error_frames: "0"
tx_excessive_collisions: ""
tx_late_collisions: ""
tx_lost_frames: "0"
tx_multicast_frames: "3193107"
tx_oversize_frames: "0"
tx_undersize_frames: "0"
tx_unicast_frames: "702405038"
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ parsed_sample:
rx_power_dbm: "-7.92"
serial_number: "1234567890ABCDEF"
tx_power_dbm: "2.21"
- description: "huawei_ont_0"
- description: "huawei_ont_1"
distance_m: "1"
last_downcause: ""
last_downtime: ""
Expand All @@ -22,5 +22,5 @@ parsed_sample:
port: "0/2/12"
run_state: "online"
rx_power_dbm: "-7.92"
serial_number: "1234567890ABCDEF"
serial_number: "AAAAAAAAAAAAAAAA"
tx_power_dbm: "2.21"

0 comments on commit da70dba

Please sign in to comment.