Skip to content

Commit

Permalink
New Template - cisco_nxos_show_environment.textfsm (#838)
Browse files Browse the repository at this point in the history
Removed `cisco_nxos_show_environments.textfsm` as it's not a valid command.
  • Loading branch information
diepes authored Dec 28, 2020
1 parent 25821f3 commit a8389f5
Show file tree
Hide file tree
Showing 7 changed files with 302 additions and 30 deletions.
66 changes: 66 additions & 0 deletions templates/cisco_nxos_show_environment.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Value POWER_SUPPLY (\d+)
Value POWER_SUPPLY_MODEL (\S+)
Value POWER_SUPPLY_OUTPUT (\d+)
Value POWER_SUPPLY_INPUT (\d+)
Value POWER_SUPPLY_CAPACITY (\d+)
Value POWER_SUPPLY_STATUS (\w+)
Value FAN (Fan\S+)
Value FAN_STATUS (\S+)
Value TEMPERATURE_MODULE (\d+)
Value TEMPERATURE_SENSOR ([^\s\(\)]+)
Value TEMPERATURE_MAJOR_THRESH (\d+)
Value TEMPERATURE_MINOR_THRESH (\d+)
Value TEMPERATURE_CURRENT (\d+)
Value TEMPERATURE_STATUS (\S+)

Start
# Note: 2020-12 this template is broken, mashing 3 tables into one.
^Power Supply:\s*$$ -> Power
^Fan:\s*$$ -> Fan
^Temperature:\s*$$ -> Temperature
#^Fan\s+Model\s+Hw\s+(Direction\s+)?Status -> Fan

Power
#Capture Power with only Out
^Power\s+Actual\s+Total
^${POWER_SUPPLY}\s+${POWER_SUPPLY_MODEL}\s+${POWER_SUPPLY_OUTPUT}\s+\w+\s+${POWER_SUPPLY_CAPACITY}\s+\w+\s+${POWER_SUPPLY_STATUS}\s*$$ -> Record
#
# Capture Power with Out and In
^Power\s+Actual\s+Actual\s+Total
^${POWER_SUPPLY}\s+${POWER_SUPPLY_MODEL}\s+${POWER_SUPPLY_OUTPUT}\s+\w+\s+${POWER_SUPPLY_INPUT}\s+\w+\s+${POWER_SUPPLY_CAPACITY}\s+\w+\s+${POWER_SUPPLY_STATUS}\s*$$ -> Record
#
# Done with Power section back to Start
^Module\s+Model\s+Draw\s+Allocated\s+Status\s* -> Start
^Power\s+Usage\s+Summary: -> Start
#
# Skip junk in Power section
^Voltage:\s+\d+\s+Volts
^\s*$$ -> Start
^Supply\s+Model\s+Output\s+Capacity\s+Status
^Supply\s+Model\s+Output\s+Input\s+Capacity\s+Status
^\s+\(Watts\s\)\s+
^-+\s+-+
^. -> Error

Fan
^\s*Fan\s+Model\s+Hw\s+Status
^${FAN}\s+\S+\s+\S+\s+${FAN_STATUS}\s*$$ -> Record
^\s*Fan\s+Model\s+Hw\s+Direction\s+Status
^${FAN}\s+\S+\s+\S+\s+\S+\s+${FAN_STATUS}\s*$$ -> Record
#
# Blank line back to Start
^\s*$$ -> Start
#
# Fan Ignore
^Fan\s+Zone\s+Speed\s*:
^Fan\sAir\sFilter\s:
^-+\s*$$
^. -> Error

Temperature
^Module\s+Sensor\s+MajorThresh\s+MinorThres\s+CurTemp\s+Status
^${TEMPERATURE_MODULE}\s+${TEMPERATURE_SENSOR}(\s*\(\S+\))?\s+${TEMPERATURE_MAJOR_THRESH}\s+${TEMPERATURE_MINOR_THRESH}\s+${TEMPERATURE_CURRENT}\s+${TEMPERATURE_STATUS}\s* -> Record
^\s*\(Celsius\)\s+\(Celsius\)
^-+\s*$$
^\s*$$
^. -> Error
29 changes: 0 additions & 29 deletions templates/cisco_nxos_show_environments.textfsm

This file was deleted.

2 changes: 1 addition & 1 deletion templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ cisco_nxos_show_license_usage.textfsm, .*, cisco_nxos, sh[[ow]] lic[[ense]] us[[
cisco_nxos_show_processes_cpu.textfsm, .*, cisco_nxos, sh[[ow]] proc[[esses]] c[[pu]]
cisco_nxos_show_vrf_interface.textfsm, .*, cisco_nxos, sh[[ow]] vrf int[[erface]]
cisco_nxos_show_access-lists.textfsm, .*, cisco_nxos, sh[[ow]] acc[[ess-lists]]
cisco_nxos_show_environments.textfsm, .*, cisco_nxos, sh[[ow]] envi[[ronments]]
cisco_nxos_show_ip_adjacency.textfsm, .*, cisco_nxos, sh[[ow]] ip ad[[jacency]]
cisco_nxos_show_ip_interface.textfsm, .*, cisco_nxos, sh[[ow]] ip int[[erface]]
cisco_nxos_show_environment.textfsm, .*, cisco_nxos, sh[[ow]] env[[ironment]]
cisco_nxos_show_interface.textfsm, .*, cisco_nxos, sh[[ow]] inte[[rface]]
cisco_nxos_show_inventory.textfsm, .*, cisco_nxos, sh[[ow]] inv[[entory]]
cisco_nxos_show_route-map.textfsm, .*, cisco_nxos, sh[[ow]] route-m[[ap]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ parsed_sample:
- power_supply: "1"
power_supply_model: "N7K-AC-3KW"
power_supply_output: "407"
power_supply_input: ""
power_supply_capacity: "3000"
power_supply_status: "Ok"
fan: ""
Expand All @@ -16,6 +17,7 @@ parsed_sample:
- power_supply: "2"
power_supply_model: "N7K-AC-3KW"
power_supply_output: "370"
power_supply_input: ""
power_supply_capacity: "3000"
power_supply_status: "Ok"
fan: ""
Expand All @@ -29,6 +31,7 @@ parsed_sample:
- power_supply: ""
power_supply_model: ""
power_supply_output: ""
power_supply_input: ""
power_supply_capacity: ""
power_supply_status: ""
fan: "Fan1(sys_fan1)"
Expand All @@ -42,6 +45,7 @@ parsed_sample:
- power_supply: ""
power_supply_model: ""
power_supply_output: ""
power_supply_input: ""
power_supply_capacity: ""
power_supply_status: ""
fan: "Fan_in_PS1"
Expand All @@ -55,6 +59,7 @@ parsed_sample:
- power_supply: ""
power_supply_model: ""
power_supply_output: ""
power_supply_input: ""
power_supply_capacity: ""
power_supply_status: ""
fan: "Fan_in_PS2"
Expand All @@ -68,6 +73,7 @@ parsed_sample:
- power_supply: ""
power_supply_model: ""
power_supply_output: ""
power_supply_input: ""
power_supply_capacity: ""
power_supply_status: ""
fan: ""
Expand All @@ -81,6 +87,7 @@ parsed_sample:
- power_supply: ""
power_supply_model: ""
power_supply_output: ""
power_supply_input: ""
power_supply_capacity: ""
power_supply_status: ""
fan: ""
Expand All @@ -94,6 +101,7 @@ parsed_sample:
- power_supply: ""
power_supply_model: ""
power_supply_output: ""
power_supply_input: ""
power_supply_capacity: ""
power_supply_status: ""
fan: ""
Expand All @@ -107,6 +115,7 @@ parsed_sample:
- power_supply: ""
power_supply_model: ""
power_supply_output: ""
power_supply_input: ""
power_supply_capacity: ""
power_supply_status: ""
fan: ""
Expand All @@ -120,6 +129,7 @@ parsed_sample:
- power_supply: ""
power_supply_model: ""
power_supply_output: ""
power_supply_input: ""
power_supply_capacity: ""
power_supply_status: ""
fan: ""
Expand All @@ -133,6 +143,7 @@ parsed_sample:
- power_supply: ""
power_supply_model: ""
power_supply_output: ""
power_supply_input: ""
power_supply_capacity: ""
power_supply_status: ""
fan: ""
Expand All @@ -146,6 +157,7 @@ parsed_sample:
- power_supply: ""
power_supply_model: ""
power_supply_output: ""
power_supply_input: ""
power_supply_capacity: ""
power_supply_status: ""
fan: ""
Expand All @@ -159,6 +171,7 @@ parsed_sample:
- power_supply: ""
power_supply_model: ""
power_supply_output: ""
power_supply_input: ""
power_supply_capacity: ""
power_supply_status: ""
fan: ""
Expand All @@ -172,6 +185,7 @@ parsed_sample:
- power_supply: ""
power_supply_model: ""
power_supply_output: ""
power_supply_input: ""
power_supply_capacity: ""
power_supply_status: ""
fan: ""
Expand All @@ -185,6 +199,7 @@ parsed_sample:
- power_supply: ""
power_supply_model: ""
power_supply_output: ""
power_supply_input: ""
power_supply_capacity: ""
power_supply_status: ""
fan: ""
Expand All @@ -198,6 +213,7 @@ parsed_sample:
- power_supply: ""
power_supply_model: ""
power_supply_output: ""
power_supply_input: ""
power_supply_capacity: ""
power_supply_status: ""
fan: ""
Expand All @@ -211,6 +227,7 @@ parsed_sample:
- power_supply: ""
power_supply_model: ""
power_supply_output: ""
power_supply_input: ""
power_supply_capacity: ""
power_supply_status: ""
fan: ""
Expand Down
48 changes: 48 additions & 0 deletions tests/cisco_nxos/show_environment/cisco_nxos_show_environment2.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Power Supply:
Voltage: 12 Volts
Power Actual Actual Total
Supply Model Output Input Capacity Status
(Watts ) (Watts ) (Watts )
------- ------------------- ---------- ---------- ---------- --------------
1 N9K-PAC-650W 101 W 103 W 650 W Ok
2 N9K-PAC-650W 96 W 102 W 650 W Ok


Power Usage Summary:
--------------------
Power Supply redundancy mode (configured) PS-Redundant
Power Supply redundancy mode (operational) PS-Redundant

Total Power Capacity (based on configured mode) 650.00 W
Total Grid-A (first half of PS slots) Power Capacity 650.00 W
Total Grid-B (second half of PS slots) Power Capacity 650.00 W
Total Power of all Inputs (cumulative) 1300.00 W
Total Power Output (actual draw) 197.00 W
Total Power Input (actual draw) 206.00 W
Total Power Allocated (budget) N/A
Total Power Available for additional modules N/A

Fan:
---------------------------------------------------------------------------
Fan Model Hw Direction Status
---------------------------------------------------------------------------
Fan1(sys_fan1) N9K-C9300-FAN2 -- front-to-back Ok
Fan2(sys_fan2) N9K-C9300-FAN2 -- front-to-back Ok
Fan3(sys_fan3) N9K-C9300-FAN2 -- front-to-back Ok
Fan_in_PS1 -- -- front-to-back Ok
Fan_in_PS2 -- -- front-to-back Ok
Fan Zone Speed: Zone 1: 0x80
Fan Air Filter : NotSupported


Temperature:
--------------------------------------------------------------------
Module Sensor MajorThresh MinorThres CurTemp Status
(Celsius) (Celsius) (Celsius)
--------------------------------------------------------------------
1 FRONT 70 42 24 Ok
1 BACK 80 70 26 Ok
1 CPU 90 80 42 Ok
1 TD2-1 105 90 35 Ok
1 NS-1 105 90 37 Ok

Loading

0 comments on commit a8389f5

Please sign in to comment.