Header Only - DO NOT REMOVE - Extreme Networks

Script to reboot wireless controller WM3400


Userlevel 1
WM3400 v5.5.5.0-018R
Using Windows 7 machine

I'm looking to create a basic script that will allow me to reboot a wireless controller through SSH. I use PuTTY/Plink and have been able to remote in (via script) with no issue. I am however a bit lost at how to get the device into privileged mode and use the reload command through a script. I'm hoping you have had this issue come up before and could guide me towards the light.

4 replies

Userlevel 1
What script are you currently using to remote in Sean?
Userlevel 1
Currently it's a batch file that looks like this:
start C:\Users\Seant\plink.exe -ssh username@x.x.x.x -pw genericpassword.

This gets me access to the Controller. I'm having difficulty getting the commands scripted after this. (Mostly because I've never gone very heavily into scripting)
This is all I need it to enter:

en
restart
y
Userlevel 1
I haven't used a batch before to do this. Since it appears you are using plink however, something like this could work. Create a text file with the necessary commands and save it as commands.txt or something.

-m c:\path\commands.txt > output.txt <--------------then add that to the end of your current batch I believe.

Additionally http://the.earth.li/~sgtatham/putty/0.67/htmldoc/Chapter7.html this is a helpful link for using plink.

Let me know how it goes, or if you need anything else.
Userlevel 1
Christopher Davis wrote:

I haven't used a batch before to do this. Since it appears you are using plink however, something like this could work. Create a text file with the necessary commands and save it as commands.txt or something.

-m c:\path\commands.txt > output.txt <--------------then add that to the end of your current batch I believe.

Additionally http://the.earth.li/~sgtatham/putty/0.67/htmldoc/Chapter7.html this is a helpful link for using plink.

Let me know how it goes, or if you need anything else.

I ended up downloading AutoITv3 to get this done because I don't think a normal batch file could do what I wanted. I created a folder and called it Reboot_Wireless. In that file I have a batch program and AU3 script file.

The batch file gets called on by the script and looks like this

rem Open Tunnel
start C:\Users\Seant\plink.exe -ssh enterusername@x.x.x.x -pw yourpassword

I named the batch example.bat

The script I wrote looks like this.

#RequireAdmin
Run (@ScriptDir & '\example.bat')
Sleep (20000)
Send("en{ENTER}")
sleep(3000)
Send("reload{ENTER}")
Sleep(3000)
Send("y{ENTER}")
Sleep(3000)
Send("y{ENTER}")
Sleep(300)

I named this rebootexample.au3

From here I set task scheduler to reboot my controllers once a week by launching rebootexample.au3

I hope this helps anyone that wishes to use a script to reboot their controllers or maybe do something else.

Reply