Module sysbot.modules.network.cisco.catalyst

Cisco Catalyst Switch Module

This module provides methods for managing and querying Cisco Catalyst switches using CLI commands over SSH, including version information, interface status, VLAN configuration, and switch configuration.

Classes

class Catalyst

Cisco Catalyst switch management module.

This class provides methods for managing and querying Cisco Catalyst switches using CLI commands executed over SSH connections.

Ancestors

Methods

def arp_table(self, alias: str, **kwargs) ‑> str

Get ARP table.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

String containing the ARP table.

def cdp_neighbors(self, alias: str, **kwargs) ‑> str

Get CDP (Cisco Discovery Protocol) neighbors.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

String containing CDP neighbor information.

def environment(self, alias: str, **kwargs) ‑> str

Get environment information (temperature, fans, power supplies).

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

String containing environmental sensor readings.

def hostname(self, alias: str, **kwargs) ‑> str

Get the hostname of the switch.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

String containing the switch hostname.

def interface_counters(self, alias: str, interface: str, **kwargs) ‑> str

Get interface counters (errors, packets, etc.).

Args

alias
Session alias for the connection.
interface
Interface name (e.g., "GigabitEthernet1/0/1").
**kwargs
Additional command execution options.

Returns

String containing interface packet and error counters.

def interface_is_up(self, alias: str, interface: str, **kwargs) ‑> bool

Check if an interface is up (both line protocol and interface status).

Args

alias
Session alias for the connection.
interface
Interface name (e.g., "GigabitEthernet1/0/1").
**kwargs
Additional command execution options.

Returns

True if both interface and line protocol are up, False otherwise.

def interface_status(self, alias: str, interface: str, **kwargs) ‑> str

Get detailed status of a specific interface.

Args

alias
Session alias for the connection.
interface
Interface name (e.g., "GigabitEthernet1/0/1").
**kwargs
Additional command execution options.

Returns

String containing detailed interface status and statistics.

def interfaces(self, alias: str, **kwargs) ‑> str

Get interface status summary.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

String containing the brief status of all interfaces.

def inventory(self, alias: str, **kwargs) ‑> str

Get hardware inventory.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

String containing hardware inventory information.

def lldp_neighbors(self, alias: str, **kwargs) ‑> str

Get LLDP (Link Layer Discovery Protocol) neighbors.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

String containing LLDP neighbor information.

def log(self, alias: str, **kwargs) ‑> str

Get system log.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

String containing system log messages.

def mac_address_table(self, alias: str, **kwargs) ‑> str

Get MAC address table.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

String containing the MAC address table.

def power_inline(self, alias: str, **kwargs) ‑> str

Get PoE (Power over Ethernet) status.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

String containing PoE status for all ports.

def routing_table(self, alias: str, **kwargs) ‑> str

Get IP routing table.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

String containing the IP routing table.

def running_config(self, alias: str, **kwargs) ‑> str

Get the running configuration.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

String containing the complete running configuration.

def save_config(self, alias: str, **kwargs) ‑> str

Save running configuration to startup configuration.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

String containing the command output confirming the save operation.

def spanning_tree(self, alias: str, **kwargs) ‑> str

Get spanning tree status.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

String containing spanning tree summary information.

def startup_config(self, alias: str, **kwargs) ‑> str

Get the startup configuration.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

String containing the complete startup configuration.

def uptime(self, alias: str, **kwargs) ‑> str

Get the uptime of the switch.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

String containing the switch uptime information.

def version(self, alias: str, **kwargs) ‑> str

Get the IOS version of the switch.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

String containing the IOS version information.

def vlan_exists(self, alias: str, vlan_id: int, **kwargs) ‑> bool

Check if a VLAN exists.

Args

alias
Session alias for the connection.
vlan_id
VLAN identifier to check.
**kwargs
Additional command execution options.

Returns

True if the VLAN exists, False otherwise.

def vlans(self, alias: str, **kwargs) ‑> str

Get VLAN configuration.

Args

alias
Session alias for the connection.
**kwargs
Additional command execution options.

Returns

String containing VLAN configuration in brief format.