Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: cisco_ios_show_redundancy - Add New fields #667

Merged
merged 9 commits into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 36 additions & 27 deletions templates/cisco_ios_show_redundancy.textfsm
Original file line number Diff line number Diff line change
@@ -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+)
Expand All @@ -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+)
Expand All @@ -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+)
Expand All @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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: ""
39 changes: 39 additions & 0 deletions tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy2.raw
Original file line number Diff line number Diff line change
@@ -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
42 changes: 42 additions & 0 deletions tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy2.yml
Original file line number Diff line number Diff line change
@@ -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: ""
26 changes: 26 additions & 0 deletions tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy3.raw
Original file line number Diff line number Diff line change
@@ -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
42 changes: 42 additions & 0 deletions tests/cisco_ios/show_redundancy/cisco_ios_show_redundancy3.yml
Original file line number Diff line number Diff line change
@@ -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"