cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1041
Views
5
Helpful
1
Replies

Auto port description update using eem in cisco switches and routers

Hi Guys,

I have some doubts with the script , Actually I am trying to develop a script for auto port description update using EEM.

I found there is a old script in the forum already but i need to make some changes in them.

https://supportforums.cisco.com/t5/network-infrastructure-documents/automatically-set-port-descriptions/ta-p/3119769

The below script seems to be the old one:

event manager applet update-port-description

event neighbor-discovery interface regexp GigabitEthernet.* cdp add

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "interface $_nd_local_intf_name"

action 4.0 cli command "description $_nd_cdp_entry_name:$_nd_port_id"

My requirements:

> I want to add Circuit ID information in the port description

> I want to add the clock time in the port description as well.

Please help me in completing the script.

Detailed View :::::::::::

This script provides neighbor device name and local port connected in the interface description:

event manager applet update-port-description

event neighbor-discovery interface regexp GigabitEthernet.* cdp add

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "interface $_nd_local_intf_name"

action 4.0 cli command "description $_nd_cdp_entry_name:$_nd_port_id"


Output :

description SDCC_IDF_1.11:TenGigabitEthernet0/1

For example we have 24 Interfaces in a switch

1> Along with the above obtained output I need to add Circuit ID only in certain Interfaces.

Example :

switch 11 # sh int gi1/0/6 description

Desxcription : switch 12 : gi1/0/12 : Circuit ID  12345XXX

2> Along with this I need to add time of the latest description updated to this interface.

Example :

switch 11 # sh int gi1/0/6 description

Desxcription : switch 12 : gi1/0/12 : Circuit ID  12345XXX : 8:31:40 11 Feb 2018

           

I will be writing the circuit ID in the interface for one time.

Example: Initially

switch 11 # sh int gi1/0/6 description

Desxcription : Circuit ID 12345XXX

Then the CDP discover process starts , Now the neighbor details adds up.

Example :
switch 11 # sh int gi1/0/6 description

Desxcription : switch 12 : gi1/0/12 : Circuit ID 12345XXX

Can you help me modifying the script !

1 Reply 1

yawming
Cisco Employee
Cisco Employee