thanks, Buran, sorry for such boring question... I am not full time coder and weak at list and dict.
Hi Buran,
is this ok? please suggest
Hi Buran,
is this ok? please suggest
import ciscolib ip = "172.21.160.3" switch = ciscolib.Device(ip, "test123", "anna") switch.connect() ne= switch.get_neighbors() for item in ne: print ip+"\t"+item['ip']+"\t"+item['hostname']+"\t"+item['remote_port']+"\t"+item['local_port']
Output:172.21.160.3 172.21.162.164 PUN-DIG-DIG-01-ONN-BR-BS-GL-01 FastEthernet0/24 FastEthernet0/18
172.21.160.3 172.21.162.157 PUN-DIG-DIG-02-ONN-BR-BS-01 FastEthernet0/24 FastEthernet0/15
172.21.160.3 172.21.162.71 PUN-DIG-DIG-01-ONN-BR-BS-70 FastEthernet0/24 FastEthernet0/19
172.21.160.3 172.21.160.2 pu-dig-dig-r1-as01 GigabitEthernet1/0/9 GigabitEthernet0/1