All Projects → CiscoDevNet → Python_code_samples_network

CiscoDevNet / Python_code_samples_network

Licence: mit
A collection of Python Code Samples for Network Management. Includes samples to run on-box and off-box.

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Python code samples network

noc
Official read only mirror for
Stars: ✭ 84 (-78.12%)
Mutual labels:  ssh, snmp
Networkmanager
A powerful tool for managing networks and troubleshoot network problems!
Stars: ✭ 1,296 (+237.5%)
Mutual labels:  snmp, ssh
Sshoogr
A Groovy-based DSL for working with remote SSH servers.
Stars: ✭ 327 (-14.84%)
Mutual labels:  ssh
Ssh Agent
GitHub Action to setup `ssh-agent` with a private key
Stars: ✭ 365 (-4.95%)
Mutual labels:  ssh
Honeypot
Low interaction honeypot that displays real time attacks
Stars: ✭ 348 (-9.37%)
Mutual labels:  ssh
Geofront
Simple SSH key management service
Stars: ✭ 337 (-12.24%)
Mutual labels:  ssh
Ipt Netflow
Netflow iptables module for Linux kernel (official)
Stars: ✭ 357 (-7.03%)
Mutual labels:  snmp
Freepass
[DEPRECATED] password manager thing
Stars: ✭ 308 (-19.79%)
Mutual labels:  ssh
Bolt
Bolt is an open source orchestration tool that automates the manual work it takes to maintain your infrastructure on an as-needed basis or as part of a greater orchestration workflow. It can be installed on your local workstation and connects directly to remote nodes with SSH or WinRM, so you are not required to install any agent software.
Stars: ✭ 380 (-1.04%)
Mutual labels:  ssh
Windterm
A quicker and better cross-platform SSH/Sftp/Shell/Telnet/Serial client.
Stars: ✭ 345 (-10.16%)
Mutual labels:  ssh
Asuswrt Merlin Transparent Proxy
transparent proxy base on ss, v2ray, ipset, iptables, chinadns on asuswrt merlin.
Stars: ✭ 367 (-4.43%)
Mutual labels:  ssh
Javaweb Project
初学JAVA-WEB开发的小项目💖
Stars: ✭ 347 (-9.64%)
Mutual labels:  ssh
Exscript
A Python module making Telnet and SSH easy
Stars: ✭ 337 (-12.24%)
Mutual labels:  ssh
Sharkey
Sharkey is a service for managing certificates for use by OpenSSH
Stars: ✭ 360 (-6.25%)
Mutual labels:  ssh
Sshy
HTML5 SSH Web Client
Stars: ✭ 334 (-13.02%)
Mutual labels:  ssh
Openiothub
💖A free IoT (Internet of Things) platform and private cloud. [一个免费的物联网和私有云平台,支持内网穿透]
Stars: ✭ 371 (-3.39%)
Mutual labels:  ssh
Pandorafms
Pandora FMS is a flexible and highly scalable monitoring system ready for big environments. It uses agents (Linux, Windows, AIX, HP-UX, Solaris and BSD systems) and can do both local and remote network monitoring (SNMP v3, TCP checks, WMI, etc).
Stars: ✭ 311 (-19.01%)
Mutual labels:  snmp
Kubectl Plugins
A Collection of Plugins for kubectl Integration (exec as any user, context switching, etc).
Stars: ✭ 340 (-11.46%)
Mutual labels:  ssh
Cowrie
Cowrie SSH/Telnet Honeypot https://cowrie.readthedocs.io
Stars: ✭ 3,810 (+892.19%)
Mutual labels:  ssh
Wsl Ssh Pageant
A Pageant -> TCP bridge for use with WSL, allowing for Pageant to be used as an ssh-ageant within the WSL environment.
Stars: ✭ 381 (-0.78%)
Mutual labels:  ssh

Network Automation with Python Code Samples

A collection of Python Code Samples for Network Management. Includes samples that leverage on-box libraries, as well as samples that use exposed external APIs (NETCONF/RESTCONF, SNMP, SSH, REST, etc). Some examples make use of available SDKs.

On-Box Examples

Many Cisco switches and routers provide an on-box Python Interpreter that can be leveraged to execute scripts and programs directly on end devices. In addition to the interpreter, Python libraries are included that provide direct access to the underlying devices operations to execute CLI commands, or monitor for events.

Sample Code

Code Sample Description
Execute CLI via Python This example is about as simple as it gets. By leveraging the CLI library, we execute the “show version” command on the box.
TDR Test Every Interface This example once again leverages the CLI library, but to do something a bit more interesting. A TDR test is run on every interface in “up” status.
EEM Config Changes to Spark In this example, the EEM library is used to monitor for configuration changes. When one occurs a message is sent to a Cisco Spark Room.
Python with Eventing Example Use the EEM and Python together to script based on local events.
EEM + Python + Spark ChatOps Use the EEM to monitor for config changes and send a Spark Message
EEM + Python + Email alert This example leverages the CLI library and using the EEM feature to monitor for interface flapping and send an email alert

Off-Box Examples

Here are few Python scripts that can interact with network elements using one of the many exposed interfaces (NETCONF, RESTCONF, SNMP, SSH, etc). Many of these scripts could also be run on-box, however they don’t leverage any of the unique libraries available on device.

Code Sample Description
Netmiko and CLI Example for Interface Management These are a series of python scripts for retrieving, creating, deleting a Loopback Interface with Python.
MIB Walk with Python In this example, we perform a MIB walk against a device leveraging the “netsnmp” library for Python.
NETCONF Connection with Python This example shows the basics of connecting to a device with NETCONF using the “ncclient” library for Python.
Configure Interface IP Address with RESTCONF In this example the newly ratified RESTCONF standard is used to configure the IP Address on an interface.
Get Inventory from APIC-EM APIC-EM maintains an inventory database of the entire network. In this example Python is used to retrieve that information using the REST API.
Get Host List from APIC-EM APIC-EM maintains a list of all clients connected to the network devices discovered by APIC-EM. This example queries the APIC-EM for the list, and display’s it in a simple table.
Retrieve Tenants from ACI APIC This example leverages the ACI Toolkit to connect to an APIC controller and retrieve the list of Tenants configured.
Basic NETCONF Get A basic ncclient example to <get> NETCONF Data
Basic NETCONF Edit A basic ncclient example to <edit-config> NETCONF Data
NETCONF XPATH Example Use the XPATH feature when making a NETCONF Requests
Model Based AAA These example scripts are for Model Based AAA to get, edit and delete the rule-lists for privilege level users and Groups by using ietf-netconf-acm.yang data model
RESTCONF These example scripts are for RESTCONF to retrieve and configure the switch using different operations such as Get, Delete, Put, Post and Patch.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].