-
Notifications
You must be signed in to change notification settings - Fork 737
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new template: show interface link on cisco ios (#1290)
- Loading branch information
Showing
6 changed files
with
423 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
ntc_templates/templates/cisco_ios_show_interface_link.textfsm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Value PORT ([a-zA-Z]{2,3}[0-9]{1,2}\/[0-9]{1,2}(\/[0-9]{1,2})?) | ||
Value NAME (.+?) | ||
Value DOWNTIME ((00:00:00)|(([0-9]{1,2} year[s]? , )?([0-9]{1,2} week[s]?, )?([0-9]{1,2} day[s]?, )?([0-9]{1,2} hour[s]?, )?([0-9]{1,2} minute[s]? )?([0-9]{1,2} secs))|((([0-9]{1,2}y)?([0-9]{1,2}w)?([0-9]{1,2}d)([0-9]{1,2}h)?|[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}))) | ||
Value SINCE (.+?) | ||
Value UPTIME ((([0-9]{1,2}m)?([0-9]{1,2}w)?([0-9]{1,2}d)|[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2})) | ||
|
||
Start | ||
^\s*\^\s* -> EOF | ||
^.*Invalid input detected.* -> EOF | ||
^Load\s+for\s+ | ||
# Capture time-stamp if vty line has command time-stamping turned on | ||
^Time\s+source\s+is | ||
^-+\s*$$ | ||
^\s*Port\s+Name\s+Down Time\s+Down Since\s*$$ -> DownSince | ||
^\s*Port\s+Name\s+Down Time\s+Up Time\s*$$ -> UpTime | ||
^\s*$$ | ||
^. -> Error | ||
|
||
DownSince | ||
^\s*${PORT}\s+${DOWNTIME}\s*$$ -> Record | ||
^\s*${PORT}\s+${DOWNTIME}\s*${SINCE}\s*$$ -> Record | ||
^\s*${PORT}\s+${NAME}\s*${DOWNTIME}\s*$$ -> Record | ||
^\s*${PORT}\s+${NAME}\s*${DOWNTIME}\s+${SINCE}\s*$$ -> Record | ||
^\s*$$ | ||
^. -> Error | ||
|
||
UpTime | ||
^\s*${PORT}\s+${NAME}\s+00:00:00\s+${UPTIME}?\s*$$ -> Record | ||
^\s*${PORT}\s+${DOWNTIME}\s+${UPTIME}?\s*$$ -> Record | ||
^\s*${PORT}\s+${NAME}\s+${DOWNTIME}\s*$$ -> Record | ||
^\s*$$ | ||
^. -> Error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
tests/cisco_ios/show_interface_link/cisco_ios_show_interface_link.raw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
Port Name Down Time Up Time | ||
Gi1/0/1 30w6d | ||
Gi1/0/3 0308-ab15mgm0007-d 00:00:00 30w5d | ||
Gi1/0/5 23PD-PDU-a 00:00:00 30w5d | ||
Gi1/0/11 1001-HP3parStorage 30w6d | ||
Gi1/0/15 3201-ab15erp0006-d 00:00:00 5d01h | ||
Gi1/0/20 6502-ab15adc0001-d 30w5d | ||
Gi1/0/21 4512-ab15fil0001-s 00:00:00 30w5d | ||
Te1/0/26 5803-gh01erp8003-d 00:00:00 2w1d | ||
Te1/0/29 53609-ab15sql0001-d 00:00:00 4d08h | ||
Te1/0/30 54024-ab15san009-s 00:00:00 3w0d | ||
Te1/0/31 53PD-PDU-b 00:00:00 30w5d | ||
Te1/0/32 5504-ab15bac0004-d 14w0d | ||
Te1/0/33 56602-ab15mgm0005-d 10w3d | ||
Te1/0/34 5654-ab15msx0005-d 00:00:00 30w5d | ||
Te1/0/35 5665-ghsrv181-d 00:00:00 30w5d | ||
Te1/0/37 5781-ab15srv0006-d 22w3d | ||
Te1/0/38 5902-ab15srv0009-d 00:00:00 6w5d | ||
Te1/0/39 5106-ghsrv548-d 30w6d | ||
Te1/0/41 5835-maintenance-d 00:00:00 4w0d | ||
Te1/0/43 58029-maintenance-d 00:00:00 4w0d | ||
Te1/0/44 Access Port 00:00:00 01:59:13 | ||
Te1/0/45 Access Port 00:00:00 10w3d | ||
Gi2/0/22 Access Port 00:17:18 | ||
Te2/0/25 Access Port 2d06h | ||
Te2/0/26 Access Port 30w6d | ||
Te2/0/27 Access Port 3w4d | ||
Te2/0/29 CRXNLLE1051AP51 00:00:00 6w5d | ||
Gi1/0/13 DI01-ab15ups002-s 30w6d | ||
Gi1/0/19 DPYghZW1234WI001 L 00:00:00 30w5d | ||
Gi1/0/24 GFS-MGMT1 00:00:00 30w5d | ||
Te1/0/31 ICE Port 00:00:00 7w2d | ||
Te1/0/32 ICE Port 46w5d | ||
Te1/0/33 ITSghZW1561FW015-F 00:00:00 30w5d | ||
Te1/0/34 ITSghZWNB10 00:00:00 30w5d | ||
Te1/0/36 ITSghZWTL01.tld.co 00:00:00 4w0d | ||
Te1/0/37 NO POLL 4507-ab15f 00:00:00 14w0d | ||
Te1/0/40 Space Port 00:00:00 2w3d | ||
Te1/0/42 gh20mgm0002-d 5w0d | ||
Te1/0/43 dpyghzwnasc01n1r-i 00:00:00 30w5d | ||
Te1/0/44 itsghzwdd03m 00:00:00 13w1d | ||
Te1/0/45 jnjghllnas02n1.hos 00:00:00 14w0d | ||
Gi2/0/2 to DGYghGF1234BV00 00:00:00 30w5d | ||
Gi2/0/3 wlc-service-port-t 00:00:00 30w5d |
217 changes: 217 additions & 0 deletions
217
tests/cisco_ios/show_interface_link/cisco_ios_show_interface_link.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,217 @@ | ||
--- | ||
parsed_sample: | ||
- port: "Gi1/0/1" | ||
name: " " | ||
downtime: "30w6d" | ||
since: "" | ||
uptime: "" | ||
- port: "Gi1/0/3" | ||
name: "0308-ab15mgm0007-d" | ||
downtime: "" | ||
since: "" | ||
uptime: "30w5d" | ||
- port: "Gi1/0/5" | ||
name: "23PD-PDU-a" | ||
downtime: "" | ||
since: "" | ||
uptime: "30w5d" | ||
- port: "Gi1/0/11" | ||
name: "1001-HP3parStorage" | ||
downtime: "30w6d" | ||
since: "" | ||
uptime: "" | ||
- port: "Gi1/0/15" | ||
name: "3201-ab15erp0006-d 00:00:00" | ||
downtime: "5d01h" | ||
since: "" | ||
uptime: "" | ||
- port: "Gi1/0/20" | ||
name: "6502-ab15adc0001-d" | ||
downtime: "30w5d" | ||
since: "" | ||
uptime: "" | ||
- port: "Gi1/0/21" | ||
name: "4512-ab15fil0001-s" | ||
downtime: "" | ||
since: "" | ||
uptime: "30w5d" | ||
- port: "Te1/0/26" | ||
name: "5803-gh01erp8003-d" | ||
downtime: "" | ||
since: "" | ||
uptime: "2w1d" | ||
- port: "Te1/0/29" | ||
name: "53609-ab15sql0001-d 00:00:00" | ||
downtime: "4d08h" | ||
since: "" | ||
uptime: "" | ||
- port: "Te1/0/30" | ||
name: "54024-ab15san009-s" | ||
downtime: "" | ||
since: "" | ||
uptime: "3w0d" | ||
- port: "Te1/0/31" | ||
name: "53PD-PDU-b" | ||
downtime: "" | ||
since: "" | ||
uptime: "30w5d" | ||
- port: "Te1/0/32" | ||
name: "5504-ab15bac0004-d" | ||
downtime: "14w0d" | ||
since: "" | ||
uptime: "" | ||
- port: "Te1/0/33" | ||
name: "56602-ab15mgm0005-d" | ||
downtime: "10w3d" | ||
since: "" | ||
uptime: "" | ||
- port: "Te1/0/34" | ||
name: "5654-ab15msx0005-d" | ||
downtime: "" | ||
since: "" | ||
uptime: "30w5d" | ||
- port: "Te1/0/35" | ||
name: "5665-ghsrv181-d" | ||
downtime: "" | ||
since: "" | ||
uptime: "30w5d" | ||
- port: "Te1/0/37" | ||
name: "5781-ab15srv0006-d" | ||
downtime: "22w3d" | ||
since: "" | ||
uptime: "" | ||
- port: "Te1/0/38" | ||
name: "5902-ab15srv0009-d" | ||
downtime: "" | ||
since: "" | ||
uptime: "6w5d" | ||
- port: "Te1/0/39" | ||
name: "5106-ghsrv548-d" | ||
downtime: "30w6d" | ||
since: "" | ||
uptime: "" | ||
- port: "Te1/0/41" | ||
name: "5835-maintenance-d" | ||
downtime: "" | ||
since: "" | ||
uptime: "4w0d" | ||
- port: "Te1/0/43" | ||
name: "58029-maintenance-d" | ||
downtime: "" | ||
since: "" | ||
uptime: "4w0d" | ||
- port: "Te1/0/44" | ||
name: "Access Port" | ||
downtime: "" | ||
since: "" | ||
uptime: "01:59:13" | ||
- port: "Te1/0/45" | ||
name: "Access Port" | ||
downtime: "" | ||
since: "" | ||
uptime: "10w3d" | ||
- port: "Gi2/0/22" | ||
name: "Access Port" | ||
downtime: "00:17:18" | ||
since: "" | ||
uptime: "" | ||
- port: "Te2/0/25" | ||
name: "Access Port" | ||
downtime: "2d06h" | ||
since: "" | ||
uptime: "" | ||
- port: "Te2/0/26" | ||
name: "Access Port" | ||
downtime: "30w6d" | ||
since: "" | ||
uptime: "" | ||
- port: "Te2/0/27" | ||
name: "Access Port" | ||
downtime: "3w4d" | ||
since: "" | ||
uptime: "" | ||
- port: "Te2/0/29" | ||
name: "CRXNLLE1051AP51" | ||
downtime: "" | ||
since: "" | ||
uptime: "6w5d" | ||
- port: "Gi1/0/13" | ||
name: "DI01-ab15ups002-s" | ||
downtime: "30w6d" | ||
since: "" | ||
uptime: "" | ||
- port: "Gi1/0/19" | ||
name: "DPYghZW1234WI001 L" | ||
downtime: "" | ||
since: "" | ||
uptime: "30w5d" | ||
- port: "Gi1/0/24" | ||
name: "GFS-MGMT1" | ||
downtime: "" | ||
since: "" | ||
uptime: "30w5d" | ||
- port: "Te1/0/31" | ||
name: "ICE Port" | ||
downtime: "" | ||
since: "" | ||
uptime: "7w2d" | ||
- port: "Te1/0/32" | ||
name: "ICE Port" | ||
downtime: "46w5d" | ||
since: "" | ||
uptime: "" | ||
- port: "Te1/0/33" | ||
name: "ITSghZW1561FW015-F" | ||
downtime: "" | ||
since: "" | ||
uptime: "30w5d" | ||
- port: "Te1/0/34" | ||
name: "ITSghZWNB10" | ||
downtime: "" | ||
since: "" | ||
uptime: "30w5d" | ||
- port: "Te1/0/36" | ||
name: "ITSghZWTL01.tld.co" | ||
downtime: "" | ||
since: "" | ||
uptime: "4w0d" | ||
- port: "Te1/0/37" | ||
name: "NO POLL 4507-ab15f" | ||
downtime: "" | ||
since: "" | ||
uptime: "14w0d" | ||
- port: "Te1/0/40" | ||
name: "Space Port" | ||
downtime: "" | ||
since: "" | ||
uptime: "2w3d" | ||
- port: "Te1/0/42" | ||
name: "gh20mgm0002-d" | ||
downtime: "5w0d" | ||
since: "" | ||
uptime: "" | ||
- port: "Te1/0/43" | ||
name: "dpyghzwnasc01n1r-i" | ||
downtime: "" | ||
since: "" | ||
uptime: "30w5d" | ||
- port: "Te1/0/44" | ||
name: "itsghzwdd03m" | ||
downtime: "" | ||
since: "" | ||
uptime: "13w1d" | ||
- port: "Te1/0/45" | ||
name: "jnjghllnas02n1.hos" | ||
downtime: "" | ||
since: "" | ||
uptime: "14w0d" | ||
- port: "Gi2/0/2" | ||
name: "to DGYghGF1234BV00" | ||
downtime: "" | ||
since: "" | ||
uptime: "30w5d" | ||
- port: "Gi2/0/3" | ||
name: "wlc-service-port-t" | ||
downtime: "" | ||
since: "" | ||
uptime: "30w5d" |
22 changes: 22 additions & 0 deletions
22
tests/cisco_ios/show_interface_link/cisco_ios_show_interface_link2.raw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Port Name Down Time Down Since | ||
Gi1/1 37 weeks, 3 days, 5 hours, 52 minutes 18 secs 08:07:10 Mon Feb 14 2022 | ||
Gi1/6 15 weeks, 11 minutes 57 secs 13:47:31 Thu Jul 21 2022 | ||
Gi1/10 Fitness 10 weeks, 5 days, 20 hours, 26 minutes 38 secs 17:32:50 Fri Aug 19 2022 | ||
Gi1/11 00 secs | ||
Gi1/24 SV-Service-Office 1 year , 25 weeks, 2 days, 4 hours, 17 minutes 24 secs 09:42:04 Mon May 10 2021 | ||
Gi1/48 WERFBZW5236KARA 00 secs | ||
Gi2/3 00 secs | ||
Gi2/6 4 hours, 58 minutes 17 secs 09:01:11 Thu Nov 3 2022 | ||
Gi2/8 Fitness 00 secs | ||
Gi2/9 Fit area 00 secs | ||
Gi2/10 Guest access 00 secs | ||
Gi2/11 3 weeks, 1 day, 23 hours, 49 minutes 40 secs 14:09:48 Tue Oct 11 2022 | ||
Gi2/12 21 hours, 17 minutes 27 secs 16:42:01 Wed Nov 2 2022 | ||
Gi2/17 1 week, 1 day, 22 hours, 51 minutes 28 secs 15:08:00 Tue Oct 25 2022 | ||
Gi2/23 5 weeks, 1 day, 23 hours, 22 minutes 02 secs 14:37:26 Tue Sep 27 2022 | ||
Gi2/25 00 secs | ||
Gi2/27 1 year , 25 weeks, 2 days, 4 hours, 17 minutes 24 secs 09:42:04 Mon May 10 2021 | ||
Gi2/29 43 weeks, 3 days, 2 hours, 18 minutes 11 secs 11:41:17 Mon Jan 3 2022 | ||
Gi4/47 DOFKYLW5823AP83 00 secs | ||
Tw1/0/48 WERFBZW5236KARA 00 secs | ||
Te6/1 ICN-DOFKYLW5823TV000 secs |
Oops, something went wrong.