How to get 'show flogi database' output of Fabric Interconnect from Python ucsmsdk

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2020 05:42 AM
I have been using Python sdk of UCS, ucsmsdk for managing fi operations.
But i could not find the appropriate one for the 'show flogi database' output.
Looked at all mometa classes. But could not find it.
Please let me know if the same is available under any name.
Thanks
- Labels:
-
Unified Computing Systems
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2020 06:42 AM
Hi @Guru Prasad
ucsmsdk only access the managed objects, the ones configurable through UCS Manager GUI, so you cannot get "show flogi database" or "show mac address-table". However you can alternatively you can use use netmiko:
from netmiko import ConnectHandler
fi = {
'device_type': 'cisco_nxos',
'ip': 'ip',
'username': 'u',
'password': 'p'
}
connect = ConnectHandler(**fi)
connect.send_command('connect nxos a', expect_string=r"#")
output = connect.send_command('show mac address')
print(output)
output = connect.send_command('show npv flogi')
print(output)
You will need to parse the output, but is a beginning. :-) because the output is having a static structure, you can try using TextFSM for parsing. https://codingnetworker.com/2015/08/parse-cli-outputs-textfsm/
Hope it helps,
Sergiu
