cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2300
Views
5
Helpful
4
Replies

TCL script

Poulp
Level 1
Level 1

I have never used TCL before, so I need some help making a script. The script should run on a ie3000 switch.

1: it needs to find the MAC address of a device (AP1562) connected to an interface.

2: the MAC address should be put into a variable.

3: the script should then make an ssh to a WLC, and move the AP1562 from default-flexconnect group, to the one I want.

4: the script should then rename the AP (hostname) to the one I want.

I imagine that the script is in a file, that could be executed by the event manager, but if there are any better ideas, please don`t hesitate to suggest them :)

 

Hope that anyone can help me out here.

Best regards Poul Pedersen

1 Accepted Solution

Accepted Solutions

Without the actual output involved in these commands, I wouldn't call these exact steps.  But this applet should get you started.

event manager applet rename-ap

 event none

 action 001 cli command "enable"

 action 002 cli command "show mac address-table interface fa1/8"

 action 003 regex "([0-9a-f.]+[[:space:]]+DYNAMIC[[:space:]]+Fa1/8" "$_cli_result" match mac

 action 004 cli command "ssh wlc" pattern "ser:"

 action 005 cli command "WLC-USERNAME" pattern "assword:"

 action 006 cli command "WLC-PASSWORD" pattern ">"

 action 007 cli command "config flexconnect group GROUP-NAME ap add $mac" pattern ">"

 action 008 cli command "config ap name NEW-NAME OLD-NAME" pattern ">"

 action 009 cli command "logout"

 

This applet would get triggered by running "event manager run rename-ap",

View solution in original post

4 Replies 4

Joe Clarke
Cisco Employee
Cisco Employee

What are the exact steps to do all of this manually?  What version of code does the switch run?

HI Joe.

 

here are the steps to do this manually from the Ie3000 (IOS 15.x.x.x)

1: show mac address-table interface fa1/8 

2: ssh {ip address WLC} username password

3: config flexconnect group {flex-connect group name}  ap add {AP MAC address} 

4: Config ap name {new ap name} {old ap name}  (still with the SSH to the WLC)

 

 

Hope this makes sense

best regards Poul Pedersen

Without the actual output involved in these commands, I wouldn't call these exact steps.  But this applet should get you started.

event manager applet rename-ap

 event none

 action 001 cli command "enable"

 action 002 cli command "show mac address-table interface fa1/8"

 action 003 regex "([0-9a-f.]+[[:space:]]+DYNAMIC[[:space:]]+Fa1/8" "$_cli_result" match mac

 action 004 cli command "ssh wlc" pattern "ser:"

 action 005 cli command "WLC-USERNAME" pattern "assword:"

 action 006 cli command "WLC-PASSWORD" pattern ">"

 action 007 cli command "config flexconnect group GROUP-NAME ap add $mac" pattern ">"

 action 008 cli command "config ap name NEW-NAME OLD-NAME" pattern ">"

 action 009 cli command "logout"

 

This applet would get triggered by running "event manager run rename-ap",

I will try this script tomorrow.......Thank you very much for your help :)

 

best regards Poul Pedersen

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: