diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index ed2f77ba37..a384b75f62 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -457,6 +457,7 @@ juniper_junos_show_arp_no-resolve.textfsm, .*, juniper_junos, sh[[ow]] a[[rp]] n juniper_junos_show_isis_adjacency.textfsm, .*, juniper_junos, sh[[ow]] is[[is]] ad[[jacency]] juniper_junos_show_lldp_neighbors.textfsm, .*, juniper_junos, sh[[ow]] ll[[dp]] n[[eighbors]] juniper_junos_show_ospf_neighbor.textfsm, .*, juniper_junos, sh[[ow]] ospf n[[eighbor]] +juniper_junos_show_system_uptime.textfsm, .*, juniper_junos, sh[[ow]] sys[[tem]] up[[time]] juniper_junos_show_interfaces.textfsm, .*, juniper_junos, sh[[ow]] inte[[rfaces]] juniper_junos_show_version.textfsm, .*, juniper_junos, sh[[ow]] ver[[sion]] diff --git a/ntc_templates/templates/juniper_junos_show_system_uptime.textfsm b/ntc_templates/templates/juniper_junos_show_system_uptime.textfsm new file mode 100644 index 0000000000..8393cd9979 --- /dev/null +++ b/ntc_templates/templates/juniper_junos_show_system_uptime.textfsm @@ -0,0 +1,36 @@ +Value TIME (\d+:\d+:\d+) +Value TIMEZONE (\S+) +Value MONTH (\w+) +Value DAY (\d+) +Value YEAR (\d+) +Value TIME_SOURCE (.*) +Value BOOT_TIME (\d+:\d+:\d+) +Value BOOT_TIMEZONE (\S+) +Value BOOT_MONTH (\w+) +Value BOOT_DAY (\d+) +Value BOOT_YEAR (\d+) +Value PROTOCOLS_TIME (\d+:\d+:\d+) +Value PROTOCOLS_TIMEZONE (\S+) +Value PROTOCOLS_MONTH (\w+) +Value PROTOCOLS_DAY (\d+) +Value PROTOCOLS_YEAR (\d+) +Value LAST_CONFIG_TIME (\d+:\d+:\d+) +Value LAST_CONFIG_TIMEZONE (\S+) +Value LAST_CONFIG_MONTH (\w+) +Value LAST_CONFIG_DAY (\d+) +Value LAST_CONFIG_YEAR (\d+) +Value LAST_CONFIG_USER (\w+) +Value USERS (\d+) +Value LOAD_AVERAGE_1MIN (\d+\.\d{2}) +Value LOAD_AVERAGE_5MIN (\d+\.\d{2}) +Value LOAD_AVERAGE_15MIN (\d+\.\d{2}) + +Start + ^Current\s+time:\s*${YEAR}-${MONTH}-${DAY}\s+${TIME}\s+${TIMEZONE} + ^Time\s+[Ss]ource:\s*${TIME_SOURCE} + ^System\s+booted:\s*${BOOT_YEAR}-${BOOT_MONTH}-${BOOT_DAY}\s+${BOOT_TIME}\s+${BOOT_TIMEZONE}\s+\([^)]+\) + ^Protocols\s+started:\s*${PROTOCOLS_YEAR}-${PROTOCOLS_MONTH}-${PROTOCOLS_DAY}\s+${PROTOCOLS_TIME}\s+${PROTOCOLS_TIMEZONE}\s+\([^)]+\) + ^Last\s+configured:\s*${LAST_CONFIG_YEAR}-${LAST_CONFIG_MONTH}-${LAST_CONFIG_DAY}\s+${LAST_CONFIG_TIME}\s+${LAST_CONFIG_TIMEZONE}\s+\([^)]+\)\s+by\s+${LAST_CONFIG_USER} + ^.*,\s*${USERS}\s+users?,\s*load\s+averages:\s*${LOAD_AVERAGE_1MIN},\s*${LOAD_AVERAGE_5MIN},\s*${LOAD_AVERAGE_15MIN} + ^\s*$$ + ^. -> Error \ No newline at end of file diff --git a/tests/juniper_junos/show_system_uptime/juniper_junos_show_system_uptime.raw b/tests/juniper_junos/show_system_uptime/juniper_junos_show_system_uptime.raw new file mode 100644 index 0000000000..d645472847 --- /dev/null +++ b/tests/juniper_junos/show_system_uptime/juniper_junos_show_system_uptime.raw @@ -0,0 +1,6 @@ +Current time: 2021-08-31 08:48:11 MSK +Time Source: NTP CLOCK +System booted: 2021-03-29 13:32:05 MSK (22w0d 19:16 ago) +Protocols started: 2021-03-29 13:37:11 MSK (22w0d 19:11 ago) +Last configured: 2021-07-13 16:35:35 MSK (6w6d 16:12 ago) by admin + 8:48AM up 154 days, 19:16, 2 users, load averages: 0.04, 0.04, 0.01 diff --git a/tests/juniper_junos/show_system_uptime/juniper_junos_show_system_uptime.yml b/tests/juniper_junos/show_system_uptime/juniper_junos_show_system_uptime.yml new file mode 100644 index 0000000000..b812c75e11 --- /dev/null +++ b/tests/juniper_junos/show_system_uptime/juniper_junos_show_system_uptime.yml @@ -0,0 +1,28 @@ +--- +parsed_sample: + - time: "08:48:11" + timezone: "MSK" + year: "2021" + month: "08" + day: "31" + time_source: "NTP CLOCK" + boot_time: "13:32:05" + boot_timezone: "MSK" + boot_year: "2021" + boot_month: "03" + boot_day: "29" + protocols_time: "13:37:11" + protocols_timezone: "MSK" + protocols_year: "2021" + protocols_month: "03" + protocols_day: "29" + last_config_time: "16:35:35" + last_config_timezone: "MSK" + last_config_year: "2021" + last_config_month: "07" + last_config_day: "13" + last_config_user: "admin" + users: "2" + load_average_1min: "0.04" + load_average_5min: "0.04" + load_average_15min: "0.01" diff --git a/tests/juniper_junos/show_system_uptime/juniper_junos_show_system_uptime_2.raw b/tests/juniper_junos/show_system_uptime/juniper_junos_show_system_uptime_2.raw new file mode 100644 index 0000000000..2a09b8717c --- /dev/null +++ b/tests/juniper_junos/show_system_uptime/juniper_junos_show_system_uptime_2.raw @@ -0,0 +1,6 @@ +Current time: 2021-08-31 12:29:34 MSK +Time Source: NTP CLOCK +System booted: 2021-02-26 18:30:12 MSK (26w3d 17:59 ago) +Protocols started: 2021-02-26 18:34:06 MSK (26w3d 17:55 ago) +Last configured: 2021-07-13 16:35:18 MSK (6w6d 19:54 ago) by admin +12:29PM up 185 days, 17:59, 1 user, load averages: 0.11, 0.05, 0.01 \ No newline at end of file diff --git a/tests/juniper_junos/show_system_uptime/juniper_junos_show_system_uptime_2.yml b/tests/juniper_junos/show_system_uptime/juniper_junos_show_system_uptime_2.yml new file mode 100644 index 0000000000..f13959c128 --- /dev/null +++ b/tests/juniper_junos/show_system_uptime/juniper_junos_show_system_uptime_2.yml @@ -0,0 +1,28 @@ +--- +parsed_sample: + - time: "12:29:34" + timezone: "MSK" + month: "08" + day: "31" + year: "2021" + time_source: "NTP CLOCK" + boot_time: "18:30:12" + boot_timezone: "MSK" + boot_month: "02" + boot_day: "26" + boot_year: "2021" + protocols_time: "18:34:06" + protocols_timezone: "MSK" + protocols_month: "02" + protocols_day: "26" + protocols_year: "2021" + last_config_time: "16:35:18" + last_config_timezone: "MSK" + last_config_month: "07" + last_config_day: "13" + last_config_year: "2021" + last_config_user: "admin" + users: "1" + load_average_1min: "0.11" + load_average_5min: "0.05" + load_average_15min: "0.01"