From 8835e5d08f9d3f71270f9aea41e6be10283c6946 Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Fri, 25 Dec 2020 17:29:01 -0500 Subject: [PATCH] New Template: cisco_wlc_ssh_show_time (for time and NTP information) --- templates/cisco_wlc_ssh_show_time.textfsm | 28 +++++++++++++++ templates/index | 1 + .../show_time/cisco_wlc_ssh_show_time.raw | 14 ++++++++ .../show_time/cisco_wlc_ssh_show_time.yml | 35 +++++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 templates/cisco_wlc_ssh_show_time.textfsm create mode 100644 tests/cisco_wlc_ssh/show_time/cisco_wlc_ssh_show_time.raw create mode 100644 tests/cisco_wlc_ssh/show_time/cisco_wlc_ssh_show_time.yml diff --git a/templates/cisco_wlc_ssh_show_time.textfsm b/templates/cisco_wlc_ssh_show_time.textfsm new file mode 100644 index 0000000000..4ad75367a1 --- /dev/null +++ b/templates/cisco_wlc_ssh_show_time.textfsm @@ -0,0 +1,28 @@ +Value Filldown TIME (.+) +Value Filldown TZ_DELTA (\S+) +Value Filldown TIMEZONE (.+) +Value Filldown TZ_NAME (.+) +Value Filldown NTP_VERSION (\d) +Value Filldown NTP_POLLING_INTERVAL (\d+) +Value INDEX (\d+) +Value NTP_KEY_INDEX (\d+) +Value NTP_SERVER (\S+) +Value STATUS (\S+\s?\S+) +Value NTP_MSG_AUTH_STATUS (\S+\s?\S+) + +Start + ^\s*Time\s*\.+\s+${TIME}\s*$$ + ^\s*Timezone [dD]elta\s*\.+\s+${TZ_DELTA}\s*$$ + ^\s*Timezone [lL]ocation\s*\.+\s+\(${TIMEZONE}\)\s+${TZ_NAME}\s*$$ + ^\s*NTP [sS]ervers\s*$$ + ^\s*NTP [vV]ersion\s*\.+\s+${NTP_VERSION}\s*$$ + ^\s*NTP [pP]olling [iI]nterval\s*\.+\s+${NTP_POLLING_INTERVAL}\s*$$ + # + # NTP Server Table + ^\s+Index\s+NTP Key Index\s+NTP Server\s+Status\s+NTP Msg Auth Status\s*$$ -> NTP_Servers + +NTP_Servers + ^\s+${INDEX}\s+${NTP_KEY_INDEX}\s+${NTP_SERVER}\s+${STATUS}\s+${NTP_MSG_AUTH_STATUS}\s*$$ -> Record + ^\s+[-\s]+$$ + ^\s*$$ + ^. -> Error diff --git a/templates/index b/templates/index index 4b48563c71..de4617c2e7 100644 --- a/templates/index +++ b/templates/index @@ -324,6 +324,7 @@ cisco_wlc_ssh_show_inventory.textfsm, .*, cisco_wlc_ssh, sh[[ow]] inve[[ntory]] cisco_wlc_ssh_show_wlan_sum.textfsm, .*, cisco_wlc_ssh, sh[[ow]] wl[[an]] s[[ummary]] cisco_wlc_ssh_show_802.11a.textfsm, .*, cisco_wlc_ssh, show 802\.11[ab] cisco_wlc_ssh_show_sysinfo.textfsm, .*, cisco_wlc_ssh, sh[[ow]] sysi[[nfo]] +cisco_wlc_ssh_show_time.textfsm, .*, cisco_wlc_ssh, sh[[ow]] ti[[me]] cisco_xr_show_controllers_fabric_fia_errors_ingress_location.textfsm, .*, cisco_xr, sh[[ow]] contr[[ollers]] fabric fi[[a]] err[[ors]] in[[gress]] loc[[ation]] cisco_xr_show_controllers_fabric_fia_drops_ingress_location.textfsm, .*, cisco_xr, sh[[ow]] contr[[ollers]] fabric fi[[a]] dr[[ops]] in[[gress]] loc[[ation]] diff --git a/tests/cisco_wlc_ssh/show_time/cisco_wlc_ssh_show_time.raw b/tests/cisco_wlc_ssh/show_time/cisco_wlc_ssh_show_time.raw new file mode 100644 index 0000000000..f14665d260 --- /dev/null +++ b/tests/cisco_wlc_ssh/show_time/cisco_wlc_ssh_show_time.raw @@ -0,0 +1,14 @@ + +Time............................................. Tue Dec 22 11:02:42 2020 + +Timezone delta................................... 0:0 +Timezone location................................ (GMT -5:00) Eastern Time (US and Canada) + +NTP Servers + NTP Version.................................. 3 + NTP Polling Interval......................... 72000 + + Index NTP Key Index NTP Server Status NTP Msg Auth Status + ------- --------------------------------------------------------------------- + 1 0 1.1.1.1 In Sync AUTH DISABLED + 2 0 128.138.141.172 Not Tried AUTH DISABLED diff --git a/tests/cisco_wlc_ssh/show_time/cisco_wlc_ssh_show_time.yml b/tests/cisco_wlc_ssh/show_time/cisco_wlc_ssh_show_time.yml new file mode 100644 index 0000000000..f2e7ffd29a --- /dev/null +++ b/tests/cisco_wlc_ssh/show_time/cisco_wlc_ssh_show_time.yml @@ -0,0 +1,35 @@ +--- +parsed_sample: + - time: "Tue Dec 22 11:02:42 2020" + tz_delta: "0:0" + timezone: "GMT -5:00" + tz_name: "Eastern Time (US and Canada)" + ntp_version: "3" + ntp_polling_interval: "72000" + index: "1" + ntp_key_index: "0" + ntp_server: "1.1.1.1" + status: "In Sync" + ntp_msg_auth_status: "AUTH DISABLED" + - time: "Tue Dec 22 11:02:42 2020" + tz_delta: "0:0" + timezone: "GMT -5:00" + tz_name: "Eastern Time (US and Canada)" + ntp_version: "3" + ntp_polling_interval: "72000" + index: "2" + ntp_key_index: "0" + ntp_server: "128.138.141.172" + status: "Not Tried" + ntp_msg_auth_status: "AUTH DISABLED" + - time: "Tue Dec 22 11:02:42 2020" + tz_delta: "0:0" + timezone: "GMT -5:00" + tz_name: "Eastern Time (US and Canada)" + ntp_version: "3" + ntp_polling_interval: "72000" + index: "" + ntp_key_index: "" + ntp_server: "" + status: "" + ntp_msg_auth_status: ""