01-08-2018 12:41 AM - edited 03-01-2019 06:20 PM
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
Solved! Go to Solution.
01-09-2018 11:04 AM
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",
01-08-2018 06:58 AM
What are the exact steps to do all of this manually? What version of code does the switch run?
01-08-2018 07:08 AM
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
01-09-2018 11:04 AM
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",
01-09-2018 11:27 AM
I will try this script tomorrow.......Thank you very much for your help :)
best regards Poul Pedersen
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide