Documentation
¶
Overview ¶
Package explorer provides facilities to explorer a network by connecting to a root node via a user/password and issuing CDP commands and then logging into its neighbors in parallel. This mostly just tries to Go version the Python script, with enhancements (like this will be way faster in a large network due to concurrency).
Note1: There really should be multiple explorers here. I'd probably start with SNMP. If that failed I might try device login with a user/pass/ssh key list. Enterprise network engineers have a bad tendancy to leave SNMP set to "public" or something easily guessable so they can run solarwinds or nagios easily. Yes, SNMP is terrible, but it can provide structured data for these old routers you can't export JSON from or do streaming telemetry.
Note2: CDP or LLDP could be used.
Note3: Routing protocols can give you enough information to detect neighbors. While not giving you the discovery that CDP/LLDP can, you can then just use that info to query the neighborts (OSPF/ISIS/...)
Note4: Not that I've dealt with pure switches in a while, but if your ARP table shows something, then you have a device there. If there is a link light, something has a mac address at least in a table. Using the OID you can get an idea of what is hanging off there even if you don't know what it is.
Note5: I'm sure this doesn't deal with a bunch of various interface options. And I no longer do network automation, so I don't have a bunch of devices to try this on. Basically, this is a REALLY junior effort. Just as a mental exercise while I didn't want to work on other things I should.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type List ¶
type List struct {
// contains filtered or unexported fields
}
List provides a method for walking the network.Node tree and returning a list of all Nodes without falling into a recursive loop.
type LoginDeny ¶
type LoginDeny struct {
// IP is the IP of the node.
IP net.IP
// Err is the error we got.
Err error
}
LoginDeny is used to log nodes we could not connect to.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
cli/cdp
Package CDP provides a method for doing neighbor discovery via a command line SSH CDP command.
|
Package CDP provides a method for doing neighbor discovery via a command line SSH CDP command. |
|
cli/cdp/statemachine
Package statemachine provides a statemachine for processing CDP information into our network.Node.
|
Package statemachine provides a statemachine for processing CDP information into our network.Node. |