cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5544
Views
0
Helpful
5
Replies

How to get 'show mac address-table' output of Fabric Interconnect from Python ucsmsdk

Guru Prasad
Level 1
Level 1

Hi All,

I have been using Python sdk of UCS, ucsmsdk for managing fi operations.

But i could not find the appropriate one for the 'show mac address-table' output which is shown below.

fi-B(nx-os)# show mac address-table

VLAN MAC Address Type age Secure NTFY Ports
---------+-----------------+--------+-------
* 1 0092.f52f.9b2b static - F F Veth694
* 1 0092.f52f.9b2e static - F F Veth702
* 2 0092.f52f.9b2c static - F F Veth698
* 2 0092.f52f.9b2f static - F F Veth706
* 2 0092.f52f.9b32 static - F F Veth714

 

Looked at all mometa classes. But could not find it. 

Please let me know if the same is available under any name.

Tried with EtherPIo, etc. But couldnt see anything related to mac address-table.

 

Thanks

5 Replies 5

balaji.bandi
Hall of Fame
Hall of Fame

have you looked at below document :

 

https://pynet.twb-tech.com/blog/automation/netmiko.html

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Thank you Balaji.
But is there any option available in python ucsmsdk itself to handle this.?

many can be find git hub...Google is your best friend.

 

https://github.com/CiscoUcs/ucsmsdk

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

omz
VIP Alumni
VIP Alumni

Hi 

Cant find .. you can have a look yourself in the code repo

 

https://github.com/CiscoUcs/ucsmsdk/search?q=mac+table&unscoped_q=mac+table

 

HTH

jomcdono
Cisco Employee
Cisco Employee

Hi Guru,

 

UCS does not maintain objects for these components, the output is only available via the Fabric Interconnect CLI.

 

However, I wrote some python that can access these items using SSH libraries to connect to the FIs and issue CLI commands

 

https://github.com/movinalot/ucs-code/tree/master/ucs-python

 

Using get_show_cmd.py to connect to the FIs and issue the commands in the json or yml files

 

The nxos-show-mac-address-table.json runs the command “show mac address-table” on FI A and then on FI B

The nxos-show-mac-address-table.yml runs the command “show mac address-table | xml” on FI A and then on FI B

 

update the json/yml file with your connection information and run as follows

 

python get_show_cmd.py nxos-show-mac-address-table.yml

 

Hope this helps

 

Regards,

John