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

New Templates: Cisco IOS show vrrp brief and all #856

Merged
merged 1 commit into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
41 changes: 41 additions & 0 deletions templates/cisco_ios_show_vrrp_all.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Value IFACE (\S+)
Value GROUP (\d+)
Value ADDR_FAMILY (\S+)
Value STATE (\w+)
Value STATE_DURATION (.+)
Value VIRTUALIP ([a-fA-F\d\.\:]+)
Value VIRTUAL_MAC ([a-fA-F\d\.\:]+)
Value ADV_INTERVAL (\S+)
Value PREEMPT (\w+)
Value PRIORITY (\d+)
Value PRIORITY_CONFIGURED (\d+)
Value TRACK_OBJ (\d+)
Value TRACK_STATUS (\S+)
Value TRACK_ACTION (\S+(\s+\S+)?)
Value MASTER_IP (\S+)
Value MASTER_PRIORITY (\S+)
Value MASTER_ADV_INTERVAL (\S+)
Value MASTER_DOWN_INTERVAL (\S+)

Start
^\S+\s+-\s+Group\s+\d+.*$$ -> Continue.Record
^\s*${IFACE}\s+-\s+Group\s+${GROUP}(\s+-\s+Address-Family\s+${ADDR_FAMILY})?\s*$$
^\s+State is\s+${STATE}.*\s*$$
^\s*State duration\s+${STATE_DURATION}\s*$$
^\s+Virtual IP address is\s+${VIRTUALIP}\s*$$
^\s+Virtual MAC address is\s+${VIRTUAL_MAC}\s*$$
^\s+Advertisement interval is\s+${ADV_INTERVAL}
^\s+Preemption\s+${PREEMPT}\s*$$
^\s+Priority is\s+${PRIORITY}(\s+\((cfgd|[cC]onfigured)\s+${PRIORITY_CONFIGURED}\))?\s*$$
^\s*Track object\s+${TRACK_OBJ}\s+state\s+${TRACK_STATUS}\s+${TRACK_ACTION}\s*$$
# ignore authentication output since later VRRP versions do not even support it
^\s+Authentication\s
# ignoring the "local" designation since we can use the STATE value to determine who the master is
^\s+Master Router is\s+${MASTER_IP}(\s+\(local\))?, priority is\s+${MASTER_PRIORITY}\s*$$
^\s+Master Advertisement interval is\s+${MASTER_ADV_INTERVAL}
^\s+Master Down interval is\s+${MASTER_DOWN_INTERVAL}
# Capture time-stamp if vty line has command time-stamping turned on
^Load\s+for\s+
^Time\s+source\s+is
^\s*$$
^. -> Error
38 changes: 38 additions & 0 deletions templates/cisco_ios_show_vrrp_brief.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Value IFACE (\S+)
Value GROUP (\d+)
Value ADDR_FAMILY (\S+)
Value PRIORITY (\d+)
Value TIME (\d+)
Value OWN (.?)
Value PREEMPT (.)
Value STATE (\w+)
Value MASTER_IP ([a-fA-F\d\.\:]+)
Value VIRTUALIP ([a-fA-F\d\.\:]+)

Start
^Interface\s+Grp\s+Pri\s+Time\s+Own\s+Pre\s+State\s+Master addr\s+Group addr\s*$$ -> Vrrp
^\s*Interface\s+Grp\s+A-F\s+Pri\s+Time\s+Own\s+Pre\s+State\s+Master addr\/Group addr\s*$$ -> Vrrpv3
# Capture time-stamp if vty line has command time-stamping turned on
^Load\s+for\s+
^Time\s+source\s+is

Vrrp
# VRRP Legacy (VRRPv2 for IPv4)
^${IFACE}\s+${GROUP}\s*${PRIORITY}\s+${TIME}\s+${OWN}\s+${PREEMPT}\s+${STATE}\s+${MASTER_IP}\s+${VIRTUALIP} -> Record
^${IFACE}\s*$$
^\s*${GROUP}\s+${PRIORITY}\s+${TIME}\s+${OWN}\s+${PREEMPT}\s+${STATE}\s+${MASTER_IP}\s+${VIRTUALIP} -> Record
^\s*$$
^. -> Error

Vrrpv3
# VRRP Unified (VRRPv3 for IPv4 and IPv6)
# - ignoring the "local" designation since we can use the STATE value to determine who the master is
^\s*${IFACE}\s+${GROUP}\s+${ADDR_FAMILY}\s+${PRIORITY}\s+${TIME}\s+${OWN}\s+${PREEMPT}\s+${STATE}\s+${MASTER_IP}\(local\)\s+${VIRTUALIP} -> Record
^\s*${IFACE}\s+${GROUP}\s+${ADDR_FAMILY}\s+${PRIORITY}\s+${TIME}\s+${OWN}\s+${PREEMPT}\s+${STATE}\s+${MASTER_IP}\s+${VIRTUALIP} -> Record
# rows that roll over to a second line
^\s*${IFACE}\s*$$
^\s*${GROUP}\s+${ADDR_FAMILY}\s+${PRIORITY}\s+${TIME}\s+${OWN}\s+${PREEMPT}\s+${STATE}\s+${MASTER_IP}\(local\)\s+${VIRTUALIP} -> Record
^\s*${IFACE}\s*$$
^\s*${GROUP}\s+${ADDR_FAMILY}\s+${PRIORITY}\s+${TIME}\s+${OWN}\s+${PREEMPT}\s+${STATE}\s+${MASTER_IP}\s+${VIRTUALIP} -> Record
^\s*$$
^. -> Error
2 changes: 2 additions & 0 deletions templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ cisco_ios_show_access-list.textfsm, .*, cisco_ios, sh[[ow]] acc[[ess-list]]
cisco_ios_show_isdn_status.textfsm, .*, cisco_ios, sh[[ow]] isd[[n]] st[[atus]]
cisco_ios_show_interfaces.textfsm, .*, cisco_ios, sh[[ow]] int[[erfaces]]
cisco_ios_show_redundancy.textfsm, .*, cisco_ios, sh[[ow]] redu[[ndancy]]
cisco_ios_show_vrrp_brief.textfsm, .*, cisco_ios, sh[[ow]] vrr[[p]] b[[rief]]
cisco_ios_show_vtp_status.textfsm, .*, cisco_ios, sh[[ow]] vtp stat[[us]]
cisco_ios_show_adjacency.textfsm, .*, cisco_ios, sh[[ow]] ad[[jacency]]
cisco_ios_show_dot1x_all.textfsm, .*, cisco_ios, sh[[ow]] dot1x a[[ll]]
Expand All @@ -225,6 +226,7 @@ cisco_ios_show_ip_mroute.textfsm, .*, cisco_ios, sh[[ow]] ip mr[[oute]]
cisco_ios_show_route-map.textfsm, .*, cisco_ios, sh[[ow]] route-m[[ap]]
cisco_ios_show_snmp_user.textfsm, .*, cisco_ios, sh[[ow]] sn[[mp]] u[[ser]]
cisco_ios_show_ip_route.textfsm, .*, cisco_ios, sh[[ow]] ip r[[oute]]
cisco_ios_show_vrrp_all.textfsm, .*, cisco_ios, sh[[ow]] vrr[[p]] a[[ll]]
cisco_ios_show_aliases.textfsm, .*, cisco_ios, sh[[ow]] alia[[ses]]
cisco_ios_show_archive.textfsm, .*, cisco_ios, sh[[ow]] arc[[hive]]
cisco_ios_show_license.textfsm, .*, cisco_ios, sh[[ow]] lic[[ense]]
Expand Down
60 changes: 60 additions & 0 deletions tests/cisco_ios/show_vrrp_all/cisco_ios_show_vrrp_all.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
FastEthernet0/1 - Group 1
State is Master
Virtual IP address is 192.168.88.1
Virtual MAC address is 0000.5e00.0101
Advertisement interval is 1.000 sec
Preemption enabled
Priority is 110
Track object 1 state Up decrement 10
Authentication MD5, key-string "highavailability"
Master Router is 192.168.88.2 (local), priority is 110
Master Advertisement interval is 1.000 sec
Master Down interval is 3.570 sec

FastEthernet0/1.2 - Group 2
State is Master
Virtual IP address is 10.0.2.1
Virtual MAC address is 0000.5e00.0102
Advertisement interval is 1.000 sec
Preemption enabled
Priority is 110
Track object 1 state Up decrement 10
Master Router is 10.0.2.2 (local), priority is 110
Master Advertisement interval is 1.000 sec
Master Down interval is 3.570 sec

FastEthernet0/1.3 - Group 3
State is Backup
Virtual IP address is 10.0.3.1
Virtual MAC address is 0000.5e00.0103
Advertisement interval is 1.000 sec
Preemption enabled
Priority is 110
Track object 1 state Up decrement 10
Master Router is 10.0.3.3, priority is 120
Master Advertisement interval is 1.000 sec
Master Down interval is 3.570 sec (expires in 2.738 sec)

FastEthernet0/1.4 - Group 4
State is Init
Virtual IP address is 10.0.4.1
Virtual MAC address is 0000.5e00.0104
Advertisement interval is 1.000 sec
Preemption enabled
Priority is 100
Master Router is 10.0.4.3, priority is 120
Master Advertisement interval is 1.000 sec
Master Down interval is 3.609 sec

FastEthernet0/1.5 - Group 5
State is Backup
Virtual IP address is 10.0.5.1
Virtual MAC address is 0000.5e00.0105
Advertisement interval is 1.000 sec
Preemption enabled
Priority is 90 (cfgd 110)
Track object 2 state Down decrement 20
Master Router is 10.0.5.3, priority is 105
Master Advertisement interval is 1.000 sec
Master Down interval is 3.570 sec (expires in 2.706 sec)

92 changes: 92 additions & 0 deletions tests/cisco_ios/show_vrrp_all/cisco_ios_show_vrrp_all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
parsed_sample:
- iface: "FastEthernet0/1"
group: "1"
addr_family: ""
state: "Master"
state_duration: ""
virtualip: "192.168.88.1"
virtual_mac: "0000.5e00.0101"
adv_interval: "1.000"
preempt: "enabled"
priority: "110"
priority_configured: ""
track_obj: "1"
track_status: "Up"
track_action: "decrement 10"
master_ip: "192.168.88.2"
master_priority: "110"
master_adv_interval: "1.000"
master_down_interval: "3.570"
- iface: "FastEthernet0/1.2"
group: "2"
addr_family: ""
state: "Master"
state_duration: ""
virtualip: "10.0.2.1"
virtual_mac: "0000.5e00.0102"
adv_interval: "1.000"
preempt: "enabled"
priority: "110"
priority_configured: ""
track_obj: "1"
track_status: "Up"
track_action: "decrement 10"
master_ip: "10.0.2.2"
master_priority: "110"
master_adv_interval: "1.000"
master_down_interval: "3.570"
- iface: "FastEthernet0/1.3"
group: "3"
addr_family: ""
state: "Backup"
state_duration: ""
virtualip: "10.0.3.1"
virtual_mac: "0000.5e00.0103"
adv_interval: "1.000"
preempt: "enabled"
priority: "110"
priority_configured: ""
track_obj: "1"
track_status: "Up"
track_action: "decrement 10"
master_ip: "10.0.3.3"
master_priority: "120"
master_adv_interval: "1.000"
master_down_interval: "3.570"
- iface: "FastEthernet0/1.4"
group: "4"
addr_family: ""
state: "Init"
state_duration: ""
virtualip: "10.0.4.1"
virtual_mac: "0000.5e00.0104"
adv_interval: "1.000"
preempt: "enabled"
priority: "100"
priority_configured: ""
track_obj: ""
track_status: ""
track_action: ""
master_ip: "10.0.4.3"
master_priority: "120"
master_adv_interval: "1.000"
master_down_interval: "3.609"
- iface: "FastEthernet0/1.5"
group: "5"
addr_family: ""
state: "Backup"
state_duration: ""
virtualip: "10.0.5.1"
virtual_mac: "0000.5e00.0105"
adv_interval: "1.000"
preempt: "enabled"
priority: "90"
priority_configured: "110"
track_obj: "2"
track_status: "Down"
track_action: "decrement 20"
master_ip: "10.0.5.3"
master_priority: "105"
master_adv_interval: "1.000"
master_down_interval: "3.570"
80 changes: 80 additions & 0 deletions tests/cisco_ios/show_vrrp_all/cisco_ios_show_vrrpv3_all.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@

GigabitEthernet0/0 - Group 1 - Address-Family IPv4
State is MASTER
State duration 37 mins 23.080 secs
Virtual IP address is 10.0.1.1
Virtual MAC address is 0000.5E00.0101
Advertisement interval is 1000 msec
Preemption enabled
Priority is 110
Track object 1 state UP decrement 10
Master Router is 10.0.1.2 (local), priority is 110
Master Advertisement interval is 1000 msec (expires in 32 msec)
Master Down interval is unknown

GigabitEthernet0/0 - Group 6 - Address-Family IPv6
State is MASTER
State duration 37 mins 22.120 secs
Virtual IP address is FE80::1:1
Virtual MAC address is 0000.5E00.0206
Advertisement interval is 1000 msec
Preemption enabled
Priority is 110
Track object 1 state UP shutdown
Master Router is FE80::1:A (local), priority is 110
Master Advertisement interval is 1000 msec (expires in 260 msec)
Master Down interval is unknown


GigabitEthernet0/0.4010 - Group 1 - Address-Family IPv4
State is BACKUP
State duration 37 mins 14.859 secs
Virtual IP address is 10.254.1.1
Virtual MAC address is 0000.5E00.0101
Advertisement interval is 1000 msec
Preemption enabled
Priority is 110
Master Router is 10.254.1.3, priority is 120
Master Advertisement interval is 1000 msec (learned)
Master Down interval is 3570 msec (expires in 3194 msec)

GigabitEthernet0/0.4010 - Group 6 - Address-Family IPv6
State is BACKUP
State duration 37 mins 13.888 secs
Virtual IP address is FE80::4010:1
Virtual MAC address is 0000.5E00.0206
Advertisement interval is 1000 msec
Preemption enabled
Priority is 110
Master Router is FE80::4010:3, priority is 120
Master Advertisement interval is 1000 msec (learned)
Master Down interval is 3570 msec (expires in 3420 msec)


GigabitEthernet0/0.2600 - Group 1 - Address-Family IPv4
State is BACKUP
State duration 2 mins 48.646 secs
Virtual IP address is 172.26.0.1
Virtual MAC address is 0000.5E00.0101
Advertisement interval is 1000 msec
Preemption enabled
Priority is 90 (Configured 110)
Track object 2 state DOWN decrement 20
Master Router is 172.26.0.3, priority is 100
Master Advertisement interval is 1000 msec (learned)
Master Down interval is 3648 msec (expires in 3427 msec)

GigabitEthernet0/0.2600 - Group 6 - Address-Family IPv6
State is INIT (Group is shutdown - Tracked object down)
State duration 8 mins 57.183 secs
Virtual IP address is FE80::2600:1
Virtual MAC address is 0000.5E00.0206
Advertisement interval is 1000 msec
Preemption enabled
Priority is 110
Track object 2 state DOWN shutdown
Master Router is unknown, priority is unknown
Master Advertisement interval is unknown
Master Down interval is unknown


Loading