rikosintie / InterfaceDescription

Create code for switch interface descriptions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create Interface Descriptions from CDP Neighbor Output

Most customers want interface descriptions on core switch ports that are connected to edge switches and edge switch ports that are connected to access points or other critical devices. When you are doing a green field design this is usually pretty easy and you can include the descriptions in your spreadsheet data and they are automatically inserted when you run the template.

But there are times when you are in the field and need to create a lot of descriptions. Doing this manually is tedious, time consuming and error prone. To work around this I wrote a simple Python script to create the interface descriptions. Here are the instructions to use it.

Quick Start

  1. Download the script by clicking the green "Clone or download" button.

  2. Log onto the switch and run

sh run cdp ne det | i Dev|Interface
  1. Copy the output and save it in a text file called interface.txt in the same folder as the script

  2. Run the script. This will output the code needed on the screen

python3 interface.py

Interface GigabitEthernet 3/0/9
des < MHMS-IDFN-N107-N211 >
exit

Interface GigabitEthernet 3/0/8
des < MHMS-IDFN-N107-N210 >
exit

Interface GigabitEthernet 3/0/1
des < MHMS-IDFN-N107-N107 >
exit

Interface GigabitEthernet 3/0/5
des < MHMS-IDFN-N107-N207 >
exit

Interface GigabitEthernet 3/0/7
des < MHMS-IDFN-N107-N209 >
exit

Interface GigabitEthernet 3/0/3
des < MHMS-IDFN-N107-N109 >
exit

Interface GigabitEthernet 3/0/2
des < MHMS-IDFN-N107-N108 >
exit

Interface TenGigabitEthernet 3/0/1
des < MHMS-CORE >
exit

Interface TenGigabitEtherne t1/0/1
des < MHMS-CORE >
exit
  1. Copy the code and paste it into the switch

For more detailed instructions see my blog post

Automate or Perish!

About

Create code for switch interface descriptions

License:The Unlicense


Languages

Language:Python 100.0%