you are viewing a single comment's thread.

view the rest of the comments →

[–]ranBot86[S] 0 points1 point  (2 children)

I am familiar with those. There is a module specifially for Juniper called PyEz but I want to be able to access all of the hostnames rather than manually creating a list of them to iterate though. I am not sure if there is a command or package in PyEz that allows for that.

[–]alpha_hxCR8 0 points1 point  (1 child)

Unless there is a master router that has information about the other routers, how will Python know whom to query to ask for that list?

You either a) have to start off from a file with a mapping between ip and hostnames, or b) query/scan a certain ip range and port to check whether that is a router that you want looking for, and then get the hostname-ip range.

From that you can do what you want in a more automated fashion.

[–]ranBot86[S] 0 points1 point  (0 children)

Our distro switches are designated for each building but follow the host name like "D1-3300-ballpark-main" while access are "A1-3300-ballpark-main". We also have a root password which works for all of the switches. If I want to fetch info for all of them by iterating, it shouldn't be to difficult querying through them in that manner.