Community discussions

MikroTik App
 
User avatar
tomasi
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 99
Joined: Fri Oct 03, 2014 6:40 pm
Location: Brazil
Contact:

Export device list from SSH

Mon Mar 25, 2024 5:31 pm

Hi,

Is it possible to export a device list from SSH including the hostname and its IP address?

I'm planning to use netmiko to extract a list of device from certain type + status and use the filtered list to apply commands via python on that specific list.

example:
/dude device export-list where device-type=Cisco status=up 
intended result:
Name	Addresses
SW2-EDD-NNN-AAA	10.1.1.55
SW2-EDD-NNN-BBB	10.1.1.252
SW2-EDD-NNN-CCC	10.1.1.249
SW2-EDD-NNN-DDD	10.1.1.72
SW2-EDD-NNN-EEE	10.1.1.163
SW2-EDD-NNN-FFF	10.1.1.170
SW2-EDD-NNN-GGG	10.1.1.248
SW2-COR-NNN-HHH	10.1.1.46
This way I could use the list (with two columns separated by tabulation) in a 'for' statement in python

:)

Who is online

Users browsing this forum: No registered users and 2 guests