Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes missing interfaces on down interfaces #734

Merged
merged 2 commits into from
Jun 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions templates/cisco_asa_show_interface.textfsm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Value Required INTERFACE (\S+)
Value INTERFACE_ZONE (.+?)
Value LINK_STATUS (\w+)
Value LINK_STATUS (.+?)
Value PROTOCOL_STATUS (.*)
Value HARDWARE_TYPE ([\w ]+)
Value BANDWIDTH (\d+\s+\w+)
Expand All @@ -25,12 +25,14 @@ Value FIVEMIN_DROP_RATE (\d+)

Start
^Interface.* -> Continue.Record
^.*Interface ${INTERFACE} "${INTERFACE_ZONE}", is ${LINK_STATUS}.*protocol is ${PROTOCOL_STATUS}
jvanderaa marked this conversation as resolved.
Show resolved Hide resolved
^.*Interface ${INTERFACE} "${INTERFACE_ZONE}", is ${LINK_STATUS},.*protocol\s+is\s+${PROTOCOL_STATUS}
^.*Interface ${INTERFACE}.*is\s+${LINK_STATUS},.*protocol\s+is\s+${PROTOCOL_STATUS}
jvanderaa marked this conversation as resolved.
Show resolved Hide resolved
^\s+Hardware is ${HARDWARE_TYPE} -> Continue
^.*BW ${BANDWIDTH}.*DLY ${DELAY}
^.*\(${DUPLEX}.*Auto-Speed\(${SPEED}\)
^.*Description: ${DESCRIPTION}
^.*MAC address ${ADDRESS}.*MTU ${MTU}
^.*MAC address ${ADDRESS},\s+MTU not set
^.*IP address ${IP_ADDRESS}, .*subnet mask ${NET_MASK}
^.*1 minute input rate ${ONEMIN_IN_PPS} pkts/sec,\s+${ONEMIN_IN_RATE} bytes/sec
^.*1 minute output rate ${ONEMIN_OUT_PPS} pkts/sec,\s+${ONEMIN_OUT_RATE} bytes/sec
Expand Down
142 changes: 142 additions & 0 deletions tests/cisco_asa/show_interface/cisco_asa_show_interface1.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
Interface GigabitEthernet0/0 "outside", is up, line protocol is up
Hardware is net_virtio, BW 1000 Mbps, DLY 10 usec
Auto-Duplex(Full-duplex), Auto-Speed(1000 Mbps)
Input flow control is unsupported, output flow control is unsupported
Description: to iosv-1
MAC address 5254.000d.da4c, MTU 1500
IP address 10.99.99.2, subnet mask 255.255.255.0
107 packets input, 35506 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 pause input, 0 resume input
101 L2 decode drops
6 packets output, 612 bytes, 0 underruns
0 pause output, 0 resume output
0 output errors, 0 collisions, 0 interface resets
0 late collisions, 0 deferred
0 input reset drops, 0 output reset drops
input queue (blocks free curr/low): hardware (0/0)
output queue (blocks free curr/low): hardware (0/0)
Traffic Statistics for "outside":
6 packets input, 492 bytes
6 packets output, 456 bytes
0 packets dropped
1 minute input rate 0 pkts/sec, 0 bytes/sec
1 minute output rate 0 pkts/sec, 0 bytes/sec
1 minute drop rate, 0 pkts/sec
5 minute input rate 0 pkts/sec, 0 bytes/sec
5 minute output rate 0 pkts/sec, 0 bytes/sec
5 minute drop rate, 0 pkts/sec
Interface GigabitEthernet0/1 "inside", is up, line protocol is up
Hardware is net_virtio, BW 1000 Mbps, DLY 10 usec
Auto-Duplex(Full-duplex), Auto-Speed(1000 Mbps)
Input flow control is unsupported, output flow control is unsupported
MAC address 5254.0005.1b55, MTU 1500
IP address 10.90.90.1, subnet mask 255.255.255.0
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 pause input, 0 resume input
0 L2 decode drops
1 packets output, 54 bytes, 0 underruns
0 pause output, 0 resume output
0 output errors, 0 collisions, 0 interface resets
0 late collisions, 0 deferred
0 input reset drops, 0 output reset drops
input queue (blocks free curr/low): hardware (0/0)
output queue (blocks free curr/low): hardware (0/0)
Traffic Statistics for "inside":
0 packets input, 0 bytes
1 packets output, 28 bytes
0 packets dropped
1 minute input rate 0 pkts/sec, 0 bytes/sec
1 minute output rate 0 pkts/sec, 0 bytes/sec
1 minute drop rate, 0 pkts/sec
5 minute input rate 0 pkts/sec, 0 bytes/sec
5 minute output rate 0 pkts/sec, 0 bytes/sec
5 minute drop rate, 0 pkts/sec
Interface GigabitEthernet0/2 "", is administratively down, line protocol is up
Hardware is net_virtio, BW 1000 Mbps, DLY 10 usec
Auto-Duplex(Full-duplex), Auto-Speed(1000 Mbps)
Input flow control is unsupported, output flow control is unsupported
Available but not configured via nameif
MAC address 5254.0017.e9c0, MTU not set
IP address unassigned
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 pause input, 0 resume input
0 L2 decode drops
0 packets output, 0 bytes, 0 underruns
0 pause output, 0 resume output
0 output errors, 0 collisions, 0 interface resets
0 late collisions, 0 deferred
0 input reset drops, 0 output reset drops
input queue (blocks free curr/low): hardware (0/0)
output queue (blocks free curr/low): hardware (0/0)
Interface GigabitEthernet0/3 "", is administratively down, line protocol is up
Hardware is net_virtio, BW 1000 Mbps, DLY 10 usec
Auto-Duplex(Full-duplex), Auto-Speed(1000 Mbps)
Input flow control is unsupported, output flow control is unsupported
Available but not configured via nameif
MAC address 5254.001c.5b3a, MTU not set
IP address unassigned
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 pause input, 0 resume input
0 L2 decode drops
0 packets output, 0 bytes, 0 underruns
0 pause output, 0 resume output
0 output errors, 0 collisions, 0 interface resets
0 late collisions, 0 deferred
0 input reset drops, 0 output reset drops
input queue (blocks free curr/low): hardware (0/0)
output queue (blocks free curr/low): hardware (0/0)
Interface GigabitEthernet0/4 "", is administratively down, line protocol is up
Hardware is net_virtio, BW 1000 Mbps, DLY 10 usec
Auto-Duplex(Full-duplex), Auto-Speed(1000 Mbps)
Input flow control is unsupported, output flow control is unsupported
Available but not configured via nameif
MAC address 5254.0008.9da4, MTU not set
IP address unassigned
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 pause input, 0 resume input
0 L2 decode drops
0 packets output, 0 bytes, 0 underruns
0 pause output, 0 resume output
0 output errors, 0 collisions, 0 interface resets
0 late collisions, 0 deferred
0 input reset drops, 0 output reset drops
input queue (blocks free curr/low): hardware (0/0)
output queue (blocks free curr/low): hardware (0/0)
Interface Management0/0 "management", is up, line protocol is up
Hardware is net_virtio, BW 1000 Mbps, DLY 10 usec
Auto-Duplex(Full-duplex), Auto-Speed(1000 Mbps)
Input flow control is unsupported, output flow control is unsupported
MAC address 5254.0006.b468, MTU 1500
IP address 10.100.100.2, subnet mask 255.255.255.0
975 packets input, 106522 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 pause input, 0 resume input
0 L2 decode drops
881 packets output, 108542 bytes, 0 underruns
0 pause output, 0 resume output
0 output errors, 0 collisions, 0 interface resets
0 late collisions, 0 deferred
0 input reset drops, 0 output reset drops
input queue (blocks free curr/low): hardware (0/0)
output queue (blocks free curr/low): hardware (0/0)
Traffic Statistics for "management":
975 packets input, 92872 bytes
883 packets output, 85916 bytes
109 packets dropped
1 minute input rate 1 pkts/sec, 90 bytes/sec
1 minute output rate 1 pkts/sec, 95 bytes/sec
1 minute drop rate, 0 pkts/sec
5 minute input rate 0 pkts/sec, 17 bytes/sec
5 minute output rate 0 pkts/sec, 18 bytes/sec
5 minute drop rate, 0 pkts/sec
146 changes: 146 additions & 0 deletions tests/cisco_asa/show_interface/cisco_asa_show_interface1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
---
parsed_sample:
- address: "5254.000d.da4c"
bandwidth: "1000 Mbps"
delay: "10 usec"
description: "to iosv-1"
duplex: "Full-duplex"
fivemin_drop_rate: "0"
fivemin_in_pps: "0"
fivemin_in_rate: "0"
fivemin_out_pps: "0"
fivemin_out_rate: "0"
hardware_type: "net_virtio"
interface: "GigabitEthernet0/0"
interface_zone: "outside"
ip_address: "10.99.99.2"
link_status: "up"
mtu: "1500"
net_mask: "255.255.255.0"
onemin_drop_rate: "0"
onemin_in_pps: "0"
onemin_in_rate: "0"
onemin_out_pps: "0"
onemin_out_rate: "0"
protocol_status: "up"
speed: "1000 Mbps"
- address: "5254.0005.1b55"
bandwidth: "1000 Mbps"
delay: "10 usec"
description: ""
duplex: "Full-duplex"
fivemin_drop_rate: "0"
fivemin_in_pps: "0"
fivemin_in_rate: "0"
fivemin_out_pps: "0"
fivemin_out_rate: "0"
hardware_type: "net_virtio"
interface: "GigabitEthernet0/1"
interface_zone: "inside"
ip_address: "10.90.90.1"
link_status: "up"
mtu: "1500"
net_mask: "255.255.255.0"
onemin_drop_rate: "0"
onemin_in_pps: "0"
onemin_in_rate: "0"
onemin_out_pps: "0"
onemin_out_rate: "0"
protocol_status: "up"
speed: "1000 Mbps"
- address: "5254.0017.e9c0"
bandwidth: "1000 Mbps"
delay: "10 usec"
description: ""
duplex: "Full-duplex"
fivemin_drop_rate: ""
fivemin_in_pps: ""
fivemin_in_rate: ""
fivemin_out_pps: ""
fivemin_out_rate: ""
hardware_type: "net_virtio"
interface: "GigabitEthernet0/2"
interface_zone: ""
ip_address: ""
link_status: "administratively down"
mtu: ""
net_mask: ""
onemin_drop_rate: ""
onemin_in_pps: ""
onemin_in_rate: ""
onemin_out_pps: ""
onemin_out_rate: ""
protocol_status: "up"
speed: "1000 Mbps"
- address: "5254.001c.5b3a"
bandwidth: "1000 Mbps"
delay: "10 usec"
description: ""
duplex: "Full-duplex"
fivemin_drop_rate: ""
fivemin_in_pps: ""
fivemin_in_rate: ""
fivemin_out_pps: ""
fivemin_out_rate: ""
hardware_type: "net_virtio"
interface: "GigabitEthernet0/3"
interface_zone: ""
ip_address: ""
link_status: "administratively down"
mtu: ""
net_mask: ""
onemin_drop_rate: ""
onemin_in_pps: ""
onemin_in_rate: ""
onemin_out_pps: ""
onemin_out_rate: ""
protocol_status: "up"
speed: "1000 Mbps"
- address: "5254.0008.9da4"
bandwidth: "1000 Mbps"
delay: "10 usec"
description: ""
duplex: "Full-duplex"
fivemin_drop_rate: ""
fivemin_in_pps: ""
fivemin_in_rate: ""
fivemin_out_pps: ""
fivemin_out_rate: ""
hardware_type: "net_virtio"
interface: "GigabitEthernet0/4"
interface_zone: ""
ip_address: ""
link_status: "administratively down"
mtu: ""
net_mask: ""
onemin_drop_rate: ""
onemin_in_pps: ""
onemin_in_rate: ""
onemin_out_pps: ""
onemin_out_rate: ""
protocol_status: "up"
speed: "1000 Mbps"
- address: "5254.0006.b468"
bandwidth: "1000 Mbps"
delay: "10 usec"
description: ""
duplex: "Full-duplex"
fivemin_drop_rate: "0"
fivemin_in_pps: "0"
fivemin_in_rate: "17"
fivemin_out_pps: "0"
fivemin_out_rate: "18"
hardware_type: "net_virtio"
interface: "Management0/0"
interface_zone: "management"
ip_address: "10.100.100.2"
link_status: "up"
mtu: "1500"
net_mask: "255.255.255.0"
onemin_drop_rate: "0"
onemin_in_pps: "1"
onemin_in_rate: "90"
onemin_out_pps: "1"
onemin_out_rate: "95"
protocol_status: "up"
speed: "1000 Mbps"