From fa65ea199a726d8c946e317669cd25dabca34549 Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Fri, 25 Dec 2020 17:08:47 -0500 Subject: [PATCH] New Template: cisco_wlc_ssh_show_port_summary/stats_port_summary --- .../cisco_wlc_ssh_show_port_summary.textfsm | 23 +++++++ ...co_wlc_ssh_show_stats_port_summary.textfsm | 23 +++++++ templates/index | 2 + .../cisco_wlc_ssh_show_port_summary.raw | 11 ++++ .../cisco_wlc_ssh_show_port_summary.yml | 65 +++++++++++++++++++ .../cisco_wlc_ssh_show_stats_port_summary.raw | 9 +++ .../cisco_wlc_ssh_show_stats_port_summary.yml | 50 ++++++++++++++ 7 files changed, 183 insertions(+) create mode 100644 templates/cisco_wlc_ssh_show_port_summary.textfsm create mode 100644 templates/cisco_wlc_ssh_show_stats_port_summary.textfsm create mode 100644 tests/cisco_wlc_ssh/show_port_summary/cisco_wlc_ssh_show_port_summary.raw create mode 100644 tests/cisco_wlc_ssh/show_port_summary/cisco_wlc_ssh_show_port_summary.yml create mode 100644 tests/cisco_wlc_ssh/show_stats_port_summary/cisco_wlc_ssh_show_stats_port_summary.raw create mode 100644 tests/cisco_wlc_ssh/show_stats_port_summary/cisco_wlc_ssh_show_stats_port_summary.yml diff --git a/templates/cisco_wlc_ssh_show_port_summary.textfsm b/templates/cisco_wlc_ssh_show_port_summary.textfsm new file mode 100644 index 0000000000..690218fc3c --- /dev/null +++ b/templates/cisco_wlc_ssh_show_port_summary.textfsm @@ -0,0 +1,23 @@ +Value PORT (\S+) +Value TYPE (\S+) +Value STP_STATUS (\S+) +Value ADMIN_MODE (\S+) +Value PHYSICAL_MODE (\w+\s?\w+) +Value PHYSICAL_STATUS (\w+\s?\w+) +Value LINK_STATUS (\S+) +Value LINK_TRAP (\S+) +Value POE (\S+(\s+\S+\s+\S+)?) + +Start + ^\s+STP\s+Admin\s+(Physical\s+){2}\s*(Link\s*){2}\s*$$ + ^\s*Pr\s+Type\s+Stat\s+(Mode\s+){2}\s*(Status\s+){2}\s*Trap\s+POE\s*$$ + # + # Port Status and Modes (after the dashed line) + ^\s*[-\s]+$$ -> Port_Status + ^\s*$$ + ^. -> Error + +Port_Status + ^\s*${PORT}\s+${TYPE}\s+${STP_STATUS}\s+${ADMIN_MODE}\s+${PHYSICAL_MODE}\s+${PHYSICAL_STATUS}\s+${LINK_STATUS}\s+${LINK_TRAP}\s+${POE}\s*$$ -> Record + ^\s*$$ + ^. -> Error diff --git a/templates/cisco_wlc_ssh_show_stats_port_summary.textfsm b/templates/cisco_wlc_ssh_show_stats_port_summary.textfsm new file mode 100644 index 0000000000..993a9b6daf --- /dev/null +++ b/templates/cisco_wlc_ssh_show_stats_port_summary.textfsm @@ -0,0 +1,23 @@ +Value PORT (\d) +Value LINK_STATUS (\S+) +Value PACKETS_IN (\d+) +Value PACKETS_OUT (\d+) +Value BROADCAST_IN (\d+) +Value ERRORS_IN (\d+) +Value ERRORS_OUT (\d+) +Value COLLISIONS (\d+) + +Start + ^\s+Link\s+(Pkts In\s+){2}\s*Pkts Out\s*$$ + ^\s*Pr\s+Status\s+(Pkts (In|Out)\s+){2}\s*Bcast\s+(?:Errors\s+){2}\s*Collisions\s*$$ + # + # Port Statistics (after the dashed line) + ^\s*[-\s]+$$ -> Port_Stats + ^\s*$$ + ^. -> Error + +Port_Stats + # make the Port ID optional so the Total line will be captured without error + ^\s*${PORT}?\s+${LINK_STATUS}\s+${PACKETS_IN}\s+${PACKETS_OUT}\s+${BROADCAST_IN}\s+${ERRORS_IN}\s+${ERRORS_OUT}\s+${COLLISIONS}\s*$$ -> Record + ^\s*$$ + ^. -> Error diff --git a/templates/index b/templates/index index 4b48563c71..762175be7a 100644 --- a/templates/index +++ b/templates/index @@ -311,6 +311,7 @@ cisco_wlc_ssh_show_interface_detailed_id.textfsm, .*, cisco_wlc_ssh, sh[[ow]] in cisco_wlc_ssh_show_cdp_neighbors_detail.textfsm, .*, cisco_wlc_ssh, sh[[ow]] c[[dp]] neig[[hbors]] det[[ail]] cisco_wlc_ssh_show_redundancy_summary.textfsm, .*, cisco_wlc_ssh, sh[[ow]] red[[undancy]] su[[mmary]] cisco_wlc_ssh_show_rf-profile_summary.textfsm, .*, cisco_wlc_ssh, sh[[ow]] rf-[[profile]] s[[ummary]] +cisco_wlc_ssh_show_stats_port_summary.textfsm, .*, cisco_wlc_ssh, sh[[ow]] st[[ats]] p[[ort]] s[[ummary]] cisco_wlc_ssh_show_ap_config_general.textfsm, .*, cisco_wlc_ssh, sh[[ow]] ap con[[fig]] ge[[neral]] cisco_wlc_ssh_show_interface_summary.textfsm, .*, cisco_wlc_ssh, sh[[ow]] int[[erface]] s[[ummary]] cisco_wlc_ssh_show_redundancy_detail.textfsm, .*, cisco_wlc_ssh, sh[[ow]] red[[undancy]] d[[etail]] @@ -318,6 +319,7 @@ cisco_wlc_ssh_show_client_detail.textfsm, .*, cisco_wlc_ssh, sh[[ow]] cl[[ient]] cisco_wlc_ssh_show_exclusionlist.textfsm, .*, cisco_wlc_ssh, sh[[ow]] ex[[clusionlist]] cisco_wlc_ssh_show_ap_image_all.textfsm, .*, cisco_wlc_ssh, sh[[ow]] ap ima[[ge]] a[[ll]] cisco_wlc_ssh_show_mobility_sum.textfsm, .*, cisco_wlc_ssh, sh[[ow]] mo[[bility]] su[[mmary]] +cisco_wlc_ssh_show_port_summary.textfsm, .*, cisco_wlc_ssh, sh[[ow]] por[[t]] s[[ummary]] cisco_wlc_ssh_show_band-select.textfsm, .*, cisco_wlc_ssh, sh[[ow]] ba[[nd-select]] cisco_wlc_ssh_show_ap_summary.textfsm, .*, cisco_wlc_ssh, sh[[ow]] ap sum[[mary]] cisco_wlc_ssh_show_inventory.textfsm, .*, cisco_wlc_ssh, sh[[ow]] inve[[ntory]] diff --git a/tests/cisco_wlc_ssh/show_port_summary/cisco_wlc_ssh_show_port_summary.raw b/tests/cisco_wlc_ssh/show_port_summary/cisco_wlc_ssh_show_port_summary.raw new file mode 100644 index 0000000000..3d6f5dc549 --- /dev/null +++ b/tests/cisco_wlc_ssh/show_port_summary/cisco_wlc_ssh_show_port_summary.raw @@ -0,0 +1,11 @@ + + STP Admin Physical Physical Link Link +Pr Type Stat Mode Mode Status Status Trap POE +-- ------- ---- ------- ---------- ---------- ------ ------- --------- +1 Normal Forw Enable Auto 1000 Full Up Enable N/A +2 Normal Disa Disable Auto Auto Down Enable N/A +3 Normal Disa Disable Auto Auto Down Enable Disable +4 Normal Forw Enable Auto 1000 Full Up Enable Enable (Power Off) +5 Normal Disa Enable Auto Auto Down Enable N/A +RP Normal Forw Enable Auto Auto Up Enable N/A +SP Normal Disa Enable Auto Auto Down Enable N/A diff --git a/tests/cisco_wlc_ssh/show_port_summary/cisco_wlc_ssh_show_port_summary.yml b/tests/cisco_wlc_ssh/show_port_summary/cisco_wlc_ssh_show_port_summary.yml new file mode 100644 index 0000000000..26a20588ac --- /dev/null +++ b/tests/cisco_wlc_ssh/show_port_summary/cisco_wlc_ssh_show_port_summary.yml @@ -0,0 +1,65 @@ +--- +parsed_sample: + - port: "1" + type: "Normal" + stp_status: "Forw" + admin_mode: "Enable" + physical_mode: "Auto" + physical_status: "1000 Full" + link_status: "Up" + link_trap: "Enable" + poe: "N/A" + - port: "2" + type: "Normal" + stp_status: "Disa" + admin_mode: "Disable" + physical_mode: "Auto" + physical_status: "Auto" + link_status: "Down" + link_trap: "Enable" + poe: "N/A" + - port: "3" + type: "Normal" + stp_status: "Disa" + admin_mode: "Disable" + physical_mode: "Auto" + physical_status: "Auto" + link_status: "Down" + link_trap: "Enable" + poe: "Disable" + - port: "4" + type: "Normal" + stp_status: "Forw" + admin_mode: "Enable" + physical_mode: "Auto" + physical_status: "1000 Full" + link_status: "Up" + link_trap: "Enable" + poe: "Enable (Power Off)" + - port: "5" + type: "Normal" + stp_status: "Disa" + admin_mode: "Enable" + physical_mode: "Auto" + physical_status: "Auto" + link_status: "Down" + link_trap: "Enable" + poe: "N/A" + - port: "RP" + type: "Normal" + stp_status: "Forw" + admin_mode: "Enable" + physical_mode: "Auto" + physical_status: "Auto" + link_status: "Up" + link_trap: "Enable" + poe: "N/A" + - port: "SP" + type: "Normal" + stp_status: "Disa" + admin_mode: "Enable" + physical_mode: "Auto" + physical_status: "Auto" + link_status: "Down" + link_trap: "Enable" + poe: "N/A" diff --git a/tests/cisco_wlc_ssh/show_stats_port_summary/cisco_wlc_ssh_show_stats_port_summary.raw b/tests/cisco_wlc_ssh/show_stats_port_summary/cisco_wlc_ssh_show_stats_port_summary.raw new file mode 100644 index 0000000000..0ba4acca08 --- /dev/null +++ b/tests/cisco_wlc_ssh/show_stats_port_summary/cisco_wlc_ssh_show_stats_port_summary.raw @@ -0,0 +1,9 @@ + Link Pkts In Pkts In Pkts Out +Pr Status Pkts In Pkts Out Bcast Errors Errors Collisions +-- ------ ------- ------- ------- ------- ------- ---------- +1 Up 2364509905 2472568024 66473417 0 0 0 +2 Down 0 0 0 0 0 0 +3 Down 0 0 0 0 0 0 +4 Up 335582045 124686415 3515026 0 0 0 +5 Down 0 0 0 0 0 0 + Total 2700091950 2597254439 69988443 0 0 0 diff --git a/tests/cisco_wlc_ssh/show_stats_port_summary/cisco_wlc_ssh_show_stats_port_summary.yml b/tests/cisco_wlc_ssh/show_stats_port_summary/cisco_wlc_ssh_show_stats_port_summary.yml new file mode 100644 index 0000000000..2591033f3a --- /dev/null +++ b/tests/cisco_wlc_ssh/show_stats_port_summary/cisco_wlc_ssh_show_stats_port_summary.yml @@ -0,0 +1,50 @@ +--- +parsed_sample: + - port: "1" + link_status: "Up" + packets_in: "2364509905" + packets_out: "2472568024" + broadcast_in: "66473417" + errors_in: "0" + errors_out: "0" + collisions: "0" + - port: "2" + link_status: "Down" + packets_in: "0" + packets_out: "0" + broadcast_in: "0" + errors_in: "0" + errors_out: "0" + collisions: "0" + - port: "3" + link_status: "Down" + packets_in: "0" + packets_out: "0" + broadcast_in: "0" + errors_in: "0" + errors_out: "0" + collisions: "0" + - port: "4" + link_status: "Up" + packets_in: "335582045" + packets_out: "124686415" + broadcast_in: "3515026" + errors_in: "0" + errors_out: "0" + collisions: "0" + - port: "5" + link_status: "Down" + packets_in: "0" + packets_out: "0" + broadcast_in: "0" + errors_in: "0" + errors_out: "0" + collisions: "0" + - port: "" + link_status: "Total" + packets_in: "2700091950" + packets_out: "2597254439" + broadcast_in: "69988443" + errors_in: "0" + errors_out: "0" + collisions: "0"