diff --git a/templates/cisco_ios_show_redundancy.textfsm b/templates/cisco_ios_show_redundancy.textfsm index b80e5b93e3..49e344f1e5 100644 --- a/templates/cisco_ios_show_redundancy.textfsm +++ b/templates/cisco_ios_show_redundancy.textfsm @@ -1,3 +1,5 @@ +Value SYSTEM_UPTIME_YEARS (\d+) +Value SYSTEM_UPTIME_WEEKS (\d+) Value SYSTEM_UPTIME_DAYS (\d+) Value SYSTEM_UPTIME_HOURS (\d+) Value SYSTEM_UPTIME_MINUTES (\d+) @@ -9,8 +11,10 @@ Value CONFIGURED_REDUNDANCY_MODE (.+?) Value OPERATING_REDUNDANCY_MODE (.+?) Value MAINTENANCE_MODE (.+?) Value COMMUNICATION_STATUS (.+?) -Value ACTIVE_SLOT (\d+) +Value ACTIVE_SLOT (\S+) Value ACTIVE_SOFTWARE_STATE (.+?) +Value ACTIVE_UPTIME_YEARS (\d+) +Value ACTIVE_UPTIME_WEEKS (\d+) Value ACTIVE_UPTIME_DAYS (\d+) Value ACTIVE_UPTIME_HOURS (\d+) Value ACTIVE_UPTIME_MINUTES (\d+) @@ -20,8 +24,10 @@ Value ACTIVE_MAINTENANCE_RELEASE (\S+) Value ACTIVE_BOOT_DIRECTORY (\S+) Value ACTIVE_BOOT_FILE (\S+) Value ACTIVE_CONFIG_REGISTER (\S+) -Value STANDBY_SLOT (\d+) +Value STANDBY_SLOT (\S+) Value STANDBY_SOFTWARE_STATE (.+?) +Value STANDBY_UPTIME_YEARS (\d+) +Value STANDBY_UPTIME_WEEKS (\d+) Value STANDBY_UPTIME_DAYS (\d+) Value STANDBY_UPTIME_HOURS (\d+) Value STANDBY_UPTIME_MINUTES (\d+) @@ -31,21 +37,22 @@ Value STANDBY_MAINTENANCE_RELEASE (\S+) Value STANDBY_BOOT_DIRECTORY (\S+) Value STANDBY_BOOT_FILE (\S+) Value STANDBY_CONFIG_REGISTER (\S+) +Value STANDBY_STATUS (.+?) Start ^Redundant\s+System\s+Information ^\s*-+\s*$$ - ^\s+Available\s+system\s+uptime\s*=\s*${SYSTEM_UPTIME_DAYS}\s+days,\s+${SYSTEM_UPTIME_HOURS}\s+hours,\s+${SYSTEM_UPTIME_MINUTES}\s+minutes\s*$$ - ^\s+Switchovers\s+system\s+experienced\s*=\s*${SWITCHOVERS}\s*$$ - ^\s+Standby\s+failures\s*=\s*${STANDBY_FAILURES}\s*$$ - ^\s+Last\s+switchover\s+reason\s*=\s*${LAST_SWITCHOVER_REASON}\s*$$ - ^\s+Hardware\s+Mode\s*=\s*${HARDWARE_MODE}\s*$$ - ^\s+Configured\s+Redundancy\s+Mode\s*=\s*${CONFIGURED_REDUNDANCY_MODE}\s*$$ - ^\s+Operating\s+Redundancy\s+Mode\s*=\s*${OPERATING_REDUNDANCY_MODE}\s*$$ - ^\s+Maintenance\s+Mode\s*=\s*${MAINTENANCE_MODE}\s*$$ - ^\s+Communications\s*=\s*${COMMUNICATION_STATUS}\s*$$ - ^\s+Current\s+Processor -> Current + ^\s*Available\s+system\s+uptime\s*=\s*(${SYSTEM_UPTIME_YEARS}\s*year(s)?,)?\s*(${SYSTEM_UPTIME_WEEKS}\s*week(s)?,)?\s*(${SYSTEM_UPTIME_DAYS}\s*day(s)?,)?\s*(${SYSTEM_UPTIME_HOURS}\s*hour(s)?,)?\s*${SYSTEM_UPTIME_MINUTES}\s*minute(s)?\s*$$ + ^\s*Switchovers\s+system\s+experienced\s*=\s*${SWITCHOVERS}\s*$$ + ^\s*Standby\s+failures\s*=\s*${STANDBY_FAILURES}\s*$$ + ^\s*Last\s+switchover\s+reason\s*=\s*${LAST_SWITCHOVER_REASON}\s*$$ + ^\s*Hardware\s+Mode\s*=\s*${HARDWARE_MODE}\s*$$ + ^\s*Configured\s+Redundancy\s+Mode\s*=\s*${CONFIGURED_REDUNDANCY_MODE}\s*$$ + ^\s*Operating\s+Redundancy\s+Mode\s*=\s*${OPERATING_REDUNDANCY_MODE}\s*$$ + ^\s*Maintenance\s+Mode\s*=\s*${MAINTENANCE_MODE}\s*$$ + ^\s*Communications\s*=\s*${COMMUNICATION_STATUS}\s*$$ + ^\s*Current\s+Processor -> Current # Capture time-stamp if vty line has command time-stamping turned on ^Load\s+for\s+ ^Time\s+source\s+is @@ -54,29 +61,31 @@ Start Current ^\s*-+\s*$$ - ^\s+Active\s+Location\s*=\s*slot\s+${ACTIVE_SLOT}\s*$$ - ^\s+Current\s+Software\s+state\s*=\s*${ACTIVE_SOFTWARE_STATE}\s*$$ - ^\s+Uptime\s+in\s+current\s+state\s*=\s*${ACTIVE_UPTIME_DAYS}\s+days,\s+${ACTIVE_UPTIME_HOURS}\s+hours,\s+${ACTIVE_UPTIME_MINUTES}\s+minutes\s*$$ - ^\s+Image\s+Version + ^\s*Active\s+Location\s*=\s*slot\s+${ACTIVE_SLOT}\s*$$ + ^\s*Current\s+Software\s+state\s*=\s*${ACTIVE_SOFTWARE_STATE}\s*$$ + ^\s*Uptime\s+in\s+current\s+state\s*=\s*(${ACTIVE_UPTIME_YEARS}\s*year(s)?,)?\s*(${ACTIVE_UPTIME_WEEKS}\s*week(s)?,)?\s*(${ACTIVE_UPTIME_DAYS}\s*day(s)?,)?\s*(${ACTIVE_UPTIME_HOURS}\s*hour(s)?,)?\s*${ACTIVE_UPTIME_MINUTES}\s*minute(s)?\s*$$ + ^\s*Image\s+Version ^.+Version\s+${ACTIVE_MAJOR_RELEASE}\.${ACTIVE_MINOR_RELEASE}\(${ACTIVE_MAINTENANCE_RELEASE}\) ^.+[Cc][Ii][Ss][Cc][Oo] - ^.+(?:Copyright|Compiled) - ^\s+BOOT\s*=\s*${ACTIVE_BOOT_DIRECTORY}:${ACTIVE_BOOT_FILE}\s*$$ - ^\s+Configuration\s+register\s*=\s*${ACTIVE_CONFIG_REGISTER}\s*$$ - ^\s+Peer\s+Processor -> Peer + ^.*(?:Copyright|Compiled|CONFIG_FILE|BOOTLDR) + ^\s*BOOT\s*=\s*${ACTIVE_BOOT_DIRECTORY}:${ACTIVE_BOOT_FILE}\s*$$ + ^\s*Configuration\s+register\s*=\s*${ACTIVE_CONFIG_REGISTER}\s*$$ + ^Peer\s*\(slot:\s*unavailable\)\s*\w*\s*\w*\s*\w*\s*\w*\s*\w\s*\w*\s*\w*\s*\w*\s*\w*\s*\'${STANDBY_STATUS}\'\s*state$$ -> EOF + ^\s*Peer\s+Processor -> Peer ^\s*$$ ^. -> Error Peer ^\s*-+\s*$$ - ^\s+Standby\s+Location\s*=\s*slot\s+${STANDBY_SLOT}\s*$$ - ^\s+Current\s+Software\s+state\s*=\s*${STANDBY_SOFTWARE_STATE}\s*$$ - ^\s+Uptime\s+in\s+current\s+state\s*=\s*${STANDBY_UPTIME_DAYS}\s+days,\s+${STANDBY_UPTIME_HOURS}\s+hours,\s+${STANDBY_UPTIME_MINUTES}\s+minutes\s*$$ - ^\s+Image\s+Version + ^\s*Standby\s+Location\s*=\s*slot\s+${STANDBY_SLOT}\s*$$ + ^\s*Current\s+Software\s+state\s*=\s*${STANDBY_SOFTWARE_STATE}\s*$$ + ^\s*Uptime\s+in\s+current\s+state\s*=\s*(${STANDBY_UPTIME_YEARS}\s*year(s)?,)?\s*(${STANDBY_UPTIME_WEEKS}\s*week(s)?,)?\s*(${STANDBY_UPTIME_DAYS}\s*day(s)?,)?\s*(${STANDBY_UPTIME_HOURS}\s*hour(s)?,)?\s*${STANDBY_UPTIME_MINUTES}\s*minute(s)?\s*$$ + ^\s*Image\s+Version ^.+Version\s+${STANDBY_MAJOR_RELEASE}\.${STANDBY_MINOR_RELEASE}\(${STANDBY_MAINTENANCE_RELEASE}\) ^.+[Cc][Ii][Ss][Cc][Oo] - ^.+(?:Copyright|Compiled) - ^\s+BOOT\s*=\s*${STANDBY_BOOT_DIRECTORY}:${STANDBY_BOOT_FILE}\s*$$ - ^\s+Configuration\s+register\s*=\s*${STANDBY_CONFIG_REGISTER}\s*$$ + ^.*(?:Copyright|Compiled|CONFIG_FILE|BOOTLDR) + ^\s*BOOT\s*=\s*${STANDBY_BOOT_DIRECTORY}:${STANDBY_BOOT_FILE}\s*$$ + ^\s*Configuration\s+register\s*=\s*${STANDBY_CONFIG_REGISTER}\s*$$ ^\s*$$ + ^\s*Compiled\s* ^. -> Error diff --git a/tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy.yml b/tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy.yml index 464f2904b0..73f0965000 100644 --- a/tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy.yml +++ b/tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy.yml @@ -1,6 +1,8 @@ --- parsed_sample: - - system_uptime_days: "2" + - system_uptime_years: "" + system_uptime_weeks: "" + system_uptime_days: "2" system_uptime_hours: "2" system_uptime_minutes: "39" switchovers: "0" @@ -13,6 +15,8 @@ parsed_sample: communication_status: "Up" active_slot: "1" active_software_state: "ACTIVE" + active_uptime_years: "" + active_uptime_weeks: "" active_uptime_days: "2" active_uptime_hours: "2" active_uptime_minutes: "39" @@ -24,6 +28,8 @@ parsed_sample: active_config_register: "0x2002" standby_slot: "2" standby_software_state: "STANDBY HOT" + standby_uptime_years: "" + standby_uptime_weeks: "" standby_uptime_days: "2" standby_uptime_hours: "2" standby_uptime_minutes: "39" @@ -33,3 +39,4 @@ parsed_sample: standby_boot_directory: "bootflash" standby_boot_file: "cat4000-i5s-mz.122_20_EWA_392,1" standby_config_register: "0x2002" + standby_status: "" diff --git a/tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy2.raw b/tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy2.raw new file mode 100644 index 0000000000..a8434d4d09 --- /dev/null +++ b/tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy2.raw @@ -0,0 +1,39 @@ +Redundant System Information : +------------------------------ + Available system uptime = 1 hour, 22 minutes +Switchovers system experienced = 0 + Standby failures = 0 + Last switchover reason = none + Hardware Mode = Duplex + Configured Redundancy Mode = sso + Operating Redundancy Mode = sso + Maintenance Mode = Disabled + Communications = Up + +Current Processor Information : +------------------------------- + Active Location = slot 1/5 + Current Software state = ACTIVE + Uptime in current state = 1 hour, 22 minutes + Image Version = Cisco IOS Software, s2t54 Software (s2t54-ADVENTERPRISEK9-M), Version 15.5(1)SY4, RELEASE SOFTWARE (fc4) +Technical Support: http://www.cisco.com/techsupport +Copyright (c) 1986-2019 by Cisco Systems, Inc. +Compiled Mon 02-Sep-19 07:17 by prod_rel_team + BOOT = bootdisk:s2t54-adventerprisek9-mz.SPA.155-1.SY4.bin,1; + CONFIG_FILE = + BOOTLDR = + Configuration register = 0x2102 + +Peer Processor Information : +---------------------------- + Standby Location = slot 2/5 + Current Software state = STANDBY HOT + Uptime in current state = 19 minutes + Image Version = Cisco IOS Software, s2t54 Software (s2t54-ADVENTERPRISEK9-M), Version 15.5(1)SY4, RELEASE SOFTWARE (fc4) +Technical Support: http://www.cisco.com/techsupport +Copyright (c) 1986-2019 by Cisco Systems, Inc. +Compiled Mon 02-Sep-19 07:17 by prod_rel_team + BOOT = bootdisk:s2t54-adventerprisek9-mz.SPA.155-1.SY4.bin,1; + CONFIG_FILE = + BOOTLDR = + Configuration register = 0x2102 \ No newline at end of file diff --git a/tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy2.yml b/tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy2.yml new file mode 100644 index 0000000000..46bfcb58f3 --- /dev/null +++ b/tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy2.yml @@ -0,0 +1,42 @@ +--- +parsed_sample: + - system_uptime_years: "" + system_uptime_weeks: "" + system_uptime_days: "" + system_uptime_hours: "1" + system_uptime_minutes: "22" + switchovers: "0" + standby_failures: "0" + last_switchover_reason: "none" + hardware_mode: "Duplex" + configured_redundancy_mode: "sso" + operating_redundancy_mode: "sso" + maintenance_mode: "Disabled" + communication_status: "Up" + active_slot: "1/5" + active_software_state: "ACTIVE" + active_uptime_years: "" + active_uptime_weeks: "" + active_uptime_days: "" + active_uptime_hours: "1" + active_uptime_minutes: "22" + active_major_release: "" + active_minor_release: "" + active_maintenance_release: "" + active_boot_directory: "bootdisk" + active_boot_file: "s2t54-adventerprisek9-mz.SPA.155-1.SY4.bin,1;" + active_config_register: "0x2102" + standby_slot: "2/5" + standby_software_state: "STANDBY HOT" + standby_uptime_years: "" + standby_uptime_weeks: "" + standby_uptime_days: "" + standby_uptime_hours: "" + standby_uptime_minutes: "19" + standby_major_release: "" + standby_minor_release: "" + standby_maintenance_release: "" + standby_boot_directory: "bootdisk" + standby_boot_file: "s2t54-adventerprisek9-mz.SPA.155-1.SY4.bin,1;" + standby_config_register: "0x2102" + standby_status: "" diff --git a/tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy3.raw b/tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy3.raw new file mode 100644 index 0000000000..4790dd4cfe --- /dev/null +++ b/tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy3.raw @@ -0,0 +1,26 @@ +Redundant System Information : +------------------------------ + Available system uptime = 46 weeks, 4 days, 22 hours, 52 minutes +Switchovers system experienced = 0 + Standby failures = 0 + Last switchover reason = none + + Hardware Mode = Simplex + Configured Redundancy Mode = sso + Operating Redundancy Mode = sso + Maintenance Mode = Disabled + Communications = Down Reason: Failure + +Current Processor Information : +------------------------------- + Active Location = slot 1 + Current Software state = ACTIVE + Uptime in current state = 46 weeks, 4 days, 22 hours, 52 minutes + Image Version = Cisco IOS Software, c6848x Software (c6848x-ADVENTERPRISEK9-M), Version 15.4(1)SY4, RELEASE SOFTWARE (fc3) +Technical Support: http://www.cisco.com/techsupport +Copyright (c) 1986-2018 by Cisco Systems, Inc. +Compiled Fri 02-Feb-18 02:00 by prod_rel_team + BOOT = bootdisk:/c6848x-adventerprisek9-mz.SPA.154-1.SY4.bin,12; + Configuration register = 0x2102 + +Peer (slot: unavailable) information is not available because it is in 'DISABLED' state \ No newline at end of file diff --git a/tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy3.yml b/tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy3.yml new file mode 100644 index 0000000000..28f7ce1dd6 --- /dev/null +++ b/tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy3.yml @@ -0,0 +1,42 @@ +--- +parsed_sample: + - system_uptime_years: "" + system_uptime_weeks: "46" + system_uptime_days: "4" + system_uptime_hours: "22" + system_uptime_minutes: "52" + switchovers: "0" + standby_failures: "0" + last_switchover_reason: "none" + hardware_mode: "Simplex" + configured_redundancy_mode: "sso" + operating_redundancy_mode: "sso" + maintenance_mode: "Disabled" + communication_status: "Down Reason: Failure" + active_slot: "1" + active_software_state: "ACTIVE" + active_uptime_years: "" + active_uptime_weeks: "46" + active_uptime_days: "4" + active_uptime_hours: "22" + active_uptime_minutes: "52" + active_major_release: "" + active_minor_release: "" + active_maintenance_release: "" + active_boot_directory: "bootdisk" + active_boot_file: "/c6848x-adventerprisek9-mz.SPA.154-1.SY4.bin,12;" + active_config_register: "0x2102" + standby_slot: "" + standby_software_state: "" + standby_uptime_years: "" + standby_uptime_weeks: "" + standby_uptime_days: "" + standby_uptime_hours: "" + standby_uptime_minutes: "" + standby_major_release: "" + standby_minor_release: "" + standby_maintenance_release: "" + standby_boot_directory: "" + standby_boot_file: "" + standby_config_register: "" + standby_status: "DISABLED"