netcrawl.devices package¶
Submodules¶
netcrawl.devices.base module¶
-
class
netcrawl.devices.base.
Interface
(**kwargs)[source]¶ Bases:
object
Generic network device interface
-
class
netcrawl.devices.base.
NetworkDevice
(**kwargs)[source]¶ Bases:
object
Generic network device
-
add_ip
(ip)[source]¶ Adds an IP address to the list of other IPs
Parameters: ip (string) – An IP address
-
alert
(msg, proc, failed=False, v=2, ip=None)[source]¶ Populates the failed messages variable for the device
-
credentials
(username=None, password=None, cred_type=None)[source]¶ Gets or sets the last successful credential used to log in to the device
-
merge_interfaces
(new_interfaces)[source]¶ Merges a list of interfaces with the ones currently in the device. If the interface name matches, then the new interface will overwrite any old data it has new entries for.
Parameters: new_interfaces (List of interface objects) – One or more interface objects
-
neighbor_table
(sh_src=True, sh_name=True, sh_ip=True, sh_platform=True)[source]¶ Create a formatted table of neighbors.
Keyword Arguments: - sh_src (bool) – When true, show the source interface for each entry
- sh_name (bool) – When true, show the hostname for each entry
- sh_ip (bool) – When true, show the IP address for each entry
- sh_platform (bool) – When true, show the system platform for each entry
Returns: A string representation of the PrettyTable containing this device’s neighbors.
Return type: str
-
unique_name
¶ Returns a unique identifier for this device
-
netcrawl.devices.cisco_device module¶
Created on Feb 19, 2017
@author: Wyko
-
class
netcrawl.devices.cisco_device.
CiscoDevice
(*args, **kwargs)[source]¶ Bases:
netcrawl.devices.base.NetworkDevice
-
match_partial_to_full_interface
(partial)[source]¶ Given a partial MAC address, iterate through all of this device’s interfaces and match the address to an interface. Return the interface.
- Split the partial interface by name and number
- For each interface, check if the interface name starts with the partial name
- If so, check if the interface number matches the partial interface number
- Return the full interface name
-
netcrawl.devices.ios_device module¶
Created on Feb 19, 2017
@author: Wyko