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

Bugfix: Account for "powered-up" value in the output of nxos show module #774

Merged
merged 1 commit into from
Jul 3, 2020

Conversation

mtbutler07
Copy link
Contributor

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT

nxos_show_module
Cisco NXOS
show module

SUMMARY
  1. Added an additional value powered-up for the status parameter

  2. Added an additional pattern to match on. This was necessary due to the missing adjacent value when the status is in a powered-up state

      ^${MODULE}\s+${PORTS}\s+${TYPE}\s+${STATUS} -> Record
    

CLI Output

Mod  Ports  Module-Type                      Model              Status
---  -----  -------------------------------- ------------------ ------------
1    48     1000 Mbps Optical Ethernet Modul N7K-M148GS-11      ok
3    0      Supervisor Module-2                                 powered-up
4    0      Supervisor Module-2              N7K-SUP1           powered-dn
5    0      Supervisor Module-2              N7K-SUP1           active *
6    0      Supervisor Module-2              N7K-SUP1           ha-standby


Mod  Power-Status  Reason 
---  ------------  ---------------------------
4    powered-dn     Configured Power down

Mod  Sw              Hw
---  --------------  ------
3    4.1(3)          0.202   
4    4.1(3)          0.805   

Mod  MAC-Address(es)                         Serial-Num
---  --------------------------------------  ----------
3    00-1b-54-c2-ed-d0 to 00-1b-54-c2-ee-04  JAF1219AGFE
4    00-1b-54-c0-ff-10 to 00-1b-54-c0-ff-18  JAB114000BV

Mod  Online Diag Status
---  ------------------
3    Pass
4    Pass

Xbar Ports  Module-Type                      Model              Status
---  -----  -------------------------------- ------------------ ------------
1    0      Fabric Module 1                  N7K-C7018-FAB-1    ok

Xbar Sw              Hw
---  --------------  ------
1    NA              0.101   

Xbar MAC-Address(es)                         Serial-Num
---  --------------------------------------  ----------
1    NA                                      JAF1225AGHJ

* this terminal session 

Structured output using old template

[
	{
		"MODEL": "N7K-M148GS-11",
		"MODULE": "1",
		"PORTS": "48",
		"STATUS": "ok",
		"TYPE": "1000 Mbps Optical Ethernet Modul"
	},
	{
		"MODEL": "N7K-SUP1",
		"MODULE": "4",
		"PORTS": "0",
		"STATUS": "powered-dn",
		"TYPE": "Supervisor Module-2"
	},
	{
		"MODEL": "N7K-SUP1",
		"MODULE": "5",
		"PORTS": "0",
		"STATUS": "active *",
		"TYPE": "Supervisor Module-2"
	},
	{
		"MODEL": "N7K-SUP1",
		"MODULE": "6",
		"PORTS": "0",
		"STATUS": "ha-standby",
		"TYPE": "Supervisor Module-2"
	}
]

Structured output using new template

[
	{
		"MODEL": "N7K-M148GS-11",
		"MODULE": "1",
		"PORTS": "48",
		"STATUS": "ok",
		"TYPE": "1000 Mbps Optical Ethernet Modul"
	},
	{
		"MODEL": "",
		"MODULE": "3",
		"PORTS": "0",
		"STATUS": "powered-up",
		"TYPE": "Supervisor Module-2"
	},
	{
		"MODEL": "N7K-SUP1",
		"MODULE": "4",
		"PORTS": "0",
		"STATUS": "powered-dn",
		"TYPE": "Supervisor Module-2"
	},
	{
		"MODEL": "N7K-SUP1",
		"MODULE": "5",
		"PORTS": "0",
		"STATUS": "active *",
		"TYPE": "Supervisor Module-2"
	},
	{
		"MODEL": "N7K-SUP1",
		"MODULE": "6",
		"PORTS": "0",
		"STATUS": "ha-standby",
		"TYPE": "Supervisor Module-2"
	}
]

@FragmentedPacket FragmentedPacket merged commit 8254775 into networktocode:master Jul 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants