<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic RE: Is it possible to script a WLAN WPA2 password change? in ExtremeWireless (Identifi)</title>
    <link>https://community.extremenetworks.com/t5/extremewireless-identifi/is-it-possible-to-script-a-wlan-wpa2-password-change/m-p/43781#M3552</link>
    <description>I've played around a bit... &lt;BR /&gt;
&lt;BR /&gt;
I've used my Netsight and installed Expect on it - had some troubles but the community helped....&lt;BR /&gt;
&lt;A href="https://community.extremenetworks.com/extreme/topics/run-expect-in-netsight" target="_blank" rel="nofollow noreferrer noopener"&gt;https://community.extremenetworks.com/extreme/topics/run-expect-in-netsight&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Put my script in /usr/local/Enterasys_Networks/NetSight/scripts and changed the file settings with "chmod 755 psk_change".&lt;BR /&gt;
&lt;BR /&gt;
Here the script that changes the PSK key and also generates a trap in Netsight "PSK  was changed for WLAN Service $WLAN"&lt;BR /&gt;
(I've just modified the script from this post...  &lt;A href="https://gtacknowledge.extremenetworks.com/articles/How_To/How-to-disable-enable-wireless-services-during-specific-times" target="_blank" rel="nofollow noreferrer noopener"&gt;https://gtacknowledge.extremenetworks.com/articles/How_To/How-to-disable-enable-wireless-services-du...&lt;/A&gt; )&lt;BR /&gt;
#####################################################################&lt;BR /&gt;
&lt;BR /&gt;
#!/usr/bin/expect#&lt;BR /&gt;
set timeout 20&lt;BR /&gt;
if { $argc!=4 } {send_user " \n&lt;BR /&gt;
usage psk_change.exp &lt;I&gt; &lt;ADMIN password=""&gt; &lt;WLAN name=""&gt;  \n&lt;BR /&gt;
\n" &lt;BR /&gt;
exit 1&lt;BR /&gt;
}&lt;BR /&gt;
#&lt;BR /&gt;
#&lt;BR /&gt;
set AC [lindex $argv 0]&lt;BR /&gt;
set PASS [lindex $argv 1]&lt;BR /&gt;
set WLAN [lindex $argv 2]&lt;BR /&gt;
set PSK [lindex $argv 3]&lt;BR /&gt;
set ac_prompt "#"&lt;BR /&gt;
#&lt;BR /&gt;
#&lt;BR /&gt;
system echo&lt;BR /&gt;
eval spawn ssh admin@$AC&lt;BR /&gt;
&lt;BR /&gt;
set timeout 1&lt;BR /&gt;
expect "(yes/no)" {send "yes\r"}&lt;BR /&gt;
&lt;BR /&gt;
set timeout 20&lt;BR /&gt;
expect "assword:" {send "$PASS\r"}&lt;BR /&gt;
&lt;BR /&gt;
expect $ac_prompt {send "wlans\r"}&lt;BR /&gt;
expect $ac_prompt {send "$WLAN\r"}&lt;BR /&gt;
expect $ac_prompt {send "priv\r"}&lt;BR /&gt;
expect $ac_prompt {send "psk $PSK\r"}&lt;BR /&gt;
expect $ac_prompt {send "apply\r"}&lt;BR /&gt;
expect $ac_prompt {send "exit\r"}&lt;BR /&gt;
expect $ac_prompt {send "exit\r"}&lt;BR /&gt;
expect $ac_prompt {send "exit\r"}&lt;BR /&gt;
expect $ac_prompt {send "exit\r"}&lt;BR /&gt;
#&lt;BR /&gt;
exec /usr/bin/snmptrap -v 1 -c public localhost  "1.2.3.4.5.6" $AC 6 0 0 1.11.12.13.14.15  s "PSK was changed for WLAN Service $WLAN"&lt;BR /&gt;
&lt;BR /&gt;
#####################################################################&lt;BR /&gt;
You'd manualy start it with....&lt;BR /&gt;
./psk_change.exp &lt;I&gt; &lt;ADMIN password=""&gt; &lt;WLAN name=""&gt; &lt;BR /&gt;
&lt;P class="fancybox-image"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1d34cd059d37418f84434268013cdfd2_RackMultipart20151028-28733-1cu7d1c-script01_inline.png"&gt;&lt;img src="https://community.extremenetworks.com/t5/image/serverpage/image-id/4685iF39052ED5C3E5CA1/image-size/large?v=v2&amp;amp;px=999" role="button" title="1d34cd059d37418f84434268013cdfd2_RackMultipart20151028-28733-1cu7d1c-script01_inline.png" alt="1d34cd059d37418f84434268013cdfd2_RackMultipart20151028-28733-1cu7d1c-script01_inline.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
#####################################################################&lt;BR /&gt;
To start it with a cron job....&lt;BR /&gt;
In /var/spool/cron/crontabs create a file i.e. job01.txt - the script is started every day&lt;B&gt;@20&lt;/B&gt;:30&lt;BR /&gt;
&lt;BR /&gt;
vi job01.txt&lt;BR /&gt;
# start expect wpa change&lt;BR /&gt;
30 20 * * * /usr/local/Enterasys_Networks/NetSight/scripts/psk_change.exp 10.12.0.1 EWC_pw123 PS4 abc123abc123&lt;BR /&gt;
#&lt;BR /&gt;
&lt;BR /&gt;
Now activate it...&lt;BR /&gt;
#crontab job01.txt&lt;BR /&gt;
This generated a file "root" with the job - you'd check it with "cat root"&lt;BR /&gt;
&lt;BR /&gt;
root@netsightvienna.mywlan.at:/var/spool/cron/crontabs$ cat root&lt;BR /&gt;
# DO NOT EDIT THIS FILE - edit the master and reinstall.&lt;BR /&gt;
# (job01.txt installed on Wed Oct 28 16:25:10 2015)&lt;BR /&gt;
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)&lt;BR /&gt;
# start expect wpa change&lt;BR /&gt;
20 * * * * /usr/local/Enterasys_Networks/NetSight/scripts/psk_change.exp 10.12.0.1 EWC_pw123 PS4 abc123abc123&lt;BR /&gt;
#&lt;BR /&gt;
root@netsightvienna.mywlan.at:/var/spool/cron/crontabs$&lt;BR /&gt;
&lt;BR /&gt;
#############################################&lt;BR /&gt;
&lt;BR /&gt;
Wasn't that hard even with no prior experience with Expect and "scripting"... with some help from you guys&amp;amp;my colleague and Google.&lt;BR /&gt;
&lt;BR /&gt;
Next step... write my own controller code - without any bugs &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
-Ron&lt;BR /&gt;
&lt;/WLAN&gt;&lt;/ADMIN&gt;&lt;/I&gt;&lt;/WLAN&gt;&lt;/ADMIN&gt;&lt;/I&gt;</description>
    <pubDate>Wed, 28 Oct 2015 22:04:00 GMT</pubDate>
    <dc:creator>Ronald_Dvorak</dc:creator>
    <dc:date>2015-10-28T22:04:00Z</dc:date>
    <item>
      <title>Is it possible to script a WLAN WPA2 password change?</title>
      <link>https://community.extremenetworks.com/t5/extremewireless-identifi/is-it-possible-to-script-a-wlan-wpa2-password-change/m-p/43775#M3546</link>
      <description>Is is possible to run a script on a W4110 controller to change the WPA2 password for a WLAN?</description>
      <pubDate>Wed, 28 Oct 2015 02:32:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremewireless-identifi/is-it-possible-to-script-a-wlan-wpa2-password-change/m-p/43775#M3546</guid>
      <dc:creator>Scott_Van_Artsd</dc:creator>
      <dc:date>2015-10-28T02:32:00Z</dc:date>
    </item>
    <item>
      <title>RE: Is it possible to script a WLAN WPA2 password change?</title>
      <link>https://community.extremenetworks.com/t5/extremewireless-identifi/is-it-possible-to-script-a-wlan-wpa2-password-change/m-p/43776#M3547</link>
      <description>Just ssh to the controller and use the following commands to change it - here a example for WLAN Service ABCDEF.....&lt;BR /&gt;
&lt;BR /&gt;
- ssh to the controller&lt;BR /&gt;
# wlans&lt;BR /&gt;
# ABCDEF&lt;BR /&gt;
# priv&lt;BR /&gt;
# psk abcdefghijklmnop&lt;BR /&gt;
# apply&lt;BR /&gt;
&lt;BR /&gt;
If you've the skills to write a script to do that... why not.&lt;BR /&gt;
&lt;BR /&gt;
-Ron&lt;BR /&gt;
&lt;BR /&gt;
&lt;P class="fancybox-image"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="aec7074ea3284a698f035bb7ccf1b6ae_RackMultipart20151027-10752-1oix09y-EWC_CLI_PSK_inline.png"&gt;&lt;img src="https://community.extremenetworks.com/t5/image/serverpage/image-id/3756iE4272B1031B67916/image-size/large?v=v2&amp;amp;px=999" role="button" title="aec7074ea3284a698f035bb7ccf1b6ae_RackMultipart20151027-10752-1oix09y-EWC_CLI_PSK_inline.png" alt="aec7074ea3284a698f035bb7ccf1b6ae_RackMultipart20151027-10752-1oix09y-EWC_CLI_PSK_inline.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Oct 2015 02:41:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremewireless-identifi/is-it-possible-to-script-a-wlan-wpa2-password-change/m-p/43776#M3547</guid>
      <dc:creator>Ronald_Dvorak</dc:creator>
      <dc:date>2015-10-28T02:41:00Z</dc:date>
    </item>
    <item>
      <title>RE: Is it possible to script a WLAN WPA2 password change?</title>
      <link>https://community.extremenetworks.com/t5/extremewireless-identifi/is-it-possible-to-script-a-wlan-wpa2-password-change/m-p/43777#M3548</link>
      <description>This is great!  Thanks!  What if I don't have the skills but can follow directions very well? </description>
      <pubDate>Wed, 28 Oct 2015 02:55:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremewireless-identifi/is-it-possible-to-script-a-wlan-wpa2-password-change/m-p/43777#M3548</guid>
      <dc:creator>Scott_Van_Artsd</dc:creator>
      <dc:date>2015-10-28T02:55:00Z</dc:date>
    </item>
    <item>
      <title>RE: Is it possible to script a WLAN WPA2 password change?</title>
      <link>https://community.extremenetworks.com/t5/extremewireless-identifi/is-it-possible-to-script-a-wlan-wpa2-password-change/m-p/43778#M3549</link>
      <description>Something like this could happen if you follow directions &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://fox59.com/2015/06/25/driver-on-way-to-hospital-nearly-follows-gps-into-downtown-canal/" target="_blank" rel="nofollow noreferrer noopener"&gt;http://fox59.com/2015/06/25/driver-on-way-to-hospital-nearly-follows-gps-into-downtown-canal/&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Oct 2015 02:55:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremewireless-identifi/is-it-possible-to-script-a-wlan-wpa2-password-change/m-p/43778#M3549</guid>
      <dc:creator>Ronald_Dvorak</dc:creator>
      <dc:date>2015-10-28T02:55:00Z</dc:date>
    </item>
    <item>
      <title>RE: Is it possible to script a WLAN WPA2 password change?</title>
      <link>https://community.extremenetworks.com/t5/extremewireless-identifi/is-it-possible-to-script-a-wlan-wpa2-password-change/m-p/43779#M3550</link>
      <description>Entertaining but not helpful.   I just trying to prevent myself and my teammates from having to get up at 4am to change a stupid password.</description>
      <pubDate>Wed, 28 Oct 2015 02:55:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremewireless-identifi/is-it-possible-to-script-a-wlan-wpa2-password-change/m-p/43779#M3550</guid>
      <dc:creator>Scott_Van_Artsd</dc:creator>
      <dc:date>2015-10-28T02:55:00Z</dc:date>
    </item>
    <item>
      <title>RE: Is it possible to script a WLAN WPA2 password change?</title>
      <link>https://community.extremenetworks.com/t5/extremewireless-identifi/is-it-possible-to-script-a-wlan-wpa2-password-change/m-p/43780#M3551</link>
      <description>Here a link to a article about scripting for the controller.&lt;BR /&gt;
&lt;BR /&gt;
If you take that as an example and change it a bit you should be able to do what you are looking for.&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="https://gtacknowledge.extremenetworks.com/articles/How_To/How-to-disable-enable-wireless-services-during-specific-times" target="_blank" rel="nofollow noreferrer noopener"&gt;https://gtacknowledge.extremenetworks.com/articles/How_To/How-to-disable-enable-wireless-services-du...&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Oct 2015 02:55:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremewireless-identifi/is-it-possible-to-script-a-wlan-wpa2-password-change/m-p/43780#M3551</guid>
      <dc:creator>Ronald_Dvorak</dc:creator>
      <dc:date>2015-10-28T02:55:00Z</dc:date>
    </item>
    <item>
      <title>RE: Is it possible to script a WLAN WPA2 password change?</title>
      <link>https://community.extremenetworks.com/t5/extremewireless-identifi/is-it-possible-to-script-a-wlan-wpa2-password-change/m-p/43781#M3552</link>
      <description>I've played around a bit... &lt;BR /&gt;
&lt;BR /&gt;
I've used my Netsight and installed Expect on it - had some troubles but the community helped....&lt;BR /&gt;
&lt;A href="https://community.extremenetworks.com/extreme/topics/run-expect-in-netsight" target="_blank" rel="nofollow noreferrer noopener"&gt;https://community.extremenetworks.com/extreme/topics/run-expect-in-netsight&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Put my script in /usr/local/Enterasys_Networks/NetSight/scripts and changed the file settings with "chmod 755 psk_change".&lt;BR /&gt;
&lt;BR /&gt;
Here the script that changes the PSK key and also generates a trap in Netsight "PSK  was changed for WLAN Service $WLAN"&lt;BR /&gt;
(I've just modified the script from this post...  &lt;A href="https://gtacknowledge.extremenetworks.com/articles/How_To/How-to-disable-enable-wireless-services-during-specific-times" target="_blank" rel="nofollow noreferrer noopener"&gt;https://gtacknowledge.extremenetworks.com/articles/How_To/How-to-disable-enable-wireless-services-du...&lt;/A&gt; )&lt;BR /&gt;
#####################################################################&lt;BR /&gt;
&lt;BR /&gt;
#!/usr/bin/expect#&lt;BR /&gt;
set timeout 20&lt;BR /&gt;
if { $argc!=4 } {send_user " \n&lt;BR /&gt;
usage psk_change.exp &lt;I&gt; &lt;ADMIN password=""&gt; &lt;WLAN name=""&gt;  \n&lt;BR /&gt;
\n" &lt;BR /&gt;
exit 1&lt;BR /&gt;
}&lt;BR /&gt;
#&lt;BR /&gt;
#&lt;BR /&gt;
set AC [lindex $argv 0]&lt;BR /&gt;
set PASS [lindex $argv 1]&lt;BR /&gt;
set WLAN [lindex $argv 2]&lt;BR /&gt;
set PSK [lindex $argv 3]&lt;BR /&gt;
set ac_prompt "#"&lt;BR /&gt;
#&lt;BR /&gt;
#&lt;BR /&gt;
system echo&lt;BR /&gt;
eval spawn ssh admin@$AC&lt;BR /&gt;
&lt;BR /&gt;
set timeout 1&lt;BR /&gt;
expect "(yes/no)" {send "yes\r"}&lt;BR /&gt;
&lt;BR /&gt;
set timeout 20&lt;BR /&gt;
expect "assword:" {send "$PASS\r"}&lt;BR /&gt;
&lt;BR /&gt;
expect $ac_prompt {send "wlans\r"}&lt;BR /&gt;
expect $ac_prompt {send "$WLAN\r"}&lt;BR /&gt;
expect $ac_prompt {send "priv\r"}&lt;BR /&gt;
expect $ac_prompt {send "psk $PSK\r"}&lt;BR /&gt;
expect $ac_prompt {send "apply\r"}&lt;BR /&gt;
expect $ac_prompt {send "exit\r"}&lt;BR /&gt;
expect $ac_prompt {send "exit\r"}&lt;BR /&gt;
expect $ac_prompt {send "exit\r"}&lt;BR /&gt;
expect $ac_prompt {send "exit\r"}&lt;BR /&gt;
#&lt;BR /&gt;
exec /usr/bin/snmptrap -v 1 -c public localhost  "1.2.3.4.5.6" $AC 6 0 0 1.11.12.13.14.15  s "PSK was changed for WLAN Service $WLAN"&lt;BR /&gt;
&lt;BR /&gt;
#####################################################################&lt;BR /&gt;
You'd manualy start it with....&lt;BR /&gt;
./psk_change.exp &lt;I&gt; &lt;ADMIN password=""&gt; &lt;WLAN name=""&gt; &lt;BR /&gt;
&lt;P class="fancybox-image"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1d34cd059d37418f84434268013cdfd2_RackMultipart20151028-28733-1cu7d1c-script01_inline.png"&gt;&lt;img src="https://community.extremenetworks.com/t5/image/serverpage/image-id/4685iF39052ED5C3E5CA1/image-size/large?v=v2&amp;amp;px=999" role="button" title="1d34cd059d37418f84434268013cdfd2_RackMultipart20151028-28733-1cu7d1c-script01_inline.png" alt="1d34cd059d37418f84434268013cdfd2_RackMultipart20151028-28733-1cu7d1c-script01_inline.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;BR /&gt;
#####################################################################&lt;BR /&gt;
To start it with a cron job....&lt;BR /&gt;
In /var/spool/cron/crontabs create a file i.e. job01.txt - the script is started every day&lt;B&gt;@20&lt;/B&gt;:30&lt;BR /&gt;
&lt;BR /&gt;
vi job01.txt&lt;BR /&gt;
# start expect wpa change&lt;BR /&gt;
30 20 * * * /usr/local/Enterasys_Networks/NetSight/scripts/psk_change.exp 10.12.0.1 EWC_pw123 PS4 abc123abc123&lt;BR /&gt;
#&lt;BR /&gt;
&lt;BR /&gt;
Now activate it...&lt;BR /&gt;
#crontab job01.txt&lt;BR /&gt;
This generated a file "root" with the job - you'd check it with "cat root"&lt;BR /&gt;
&lt;BR /&gt;
root@netsightvienna.mywlan.at:/var/spool/cron/crontabs$ cat root&lt;BR /&gt;
# DO NOT EDIT THIS FILE - edit the master and reinstall.&lt;BR /&gt;
# (job01.txt installed on Wed Oct 28 16:25:10 2015)&lt;BR /&gt;
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)&lt;BR /&gt;
# start expect wpa change&lt;BR /&gt;
20 * * * * /usr/local/Enterasys_Networks/NetSight/scripts/psk_change.exp 10.12.0.1 EWC_pw123 PS4 abc123abc123&lt;BR /&gt;
#&lt;BR /&gt;
root@netsightvienna.mywlan.at:/var/spool/cron/crontabs$&lt;BR /&gt;
&lt;BR /&gt;
#############################################&lt;BR /&gt;
&lt;BR /&gt;
Wasn't that hard even with no prior experience with Expect and "scripting"... with some help from you guys&amp;amp;my colleague and Google.&lt;BR /&gt;
&lt;BR /&gt;
Next step... write my own controller code - without any bugs &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
-Ron&lt;BR /&gt;
&lt;/WLAN&gt;&lt;/ADMIN&gt;&lt;/I&gt;&lt;/WLAN&gt;&lt;/ADMIN&gt;&lt;/I&gt;</description>
      <pubDate>Wed, 28 Oct 2015 22:04:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremewireless-identifi/is-it-possible-to-script-a-wlan-wpa2-password-change/m-p/43781#M3552</guid>
      <dc:creator>Ronald_Dvorak</dc:creator>
      <dc:date>2015-10-28T22:04:00Z</dc:date>
    </item>
    <item>
      <title>RE: Is it possible to script a WLAN WPA2 password change?</title>
      <link>https://community.extremenetworks.com/t5/extremewireless-identifi/is-it-possible-to-script-a-wlan-wpa2-password-change/m-p/43782#M3553</link>
      <description>Ron, you, sir, are the man!  Thank you very much!</description>
      <pubDate>Wed, 28 Oct 2015 22:04:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremewireless-identifi/is-it-possible-to-script-a-wlan-wpa2-password-change/m-p/43782#M3553</guid>
      <dc:creator>Scott_Van_Artsd</dc:creator>
      <dc:date>2015-10-28T22:04:00Z</dc:date>
    </item>
  </channel>
</rss>

