cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
727
Views
10
Helpful
6
Replies

Update SSID name with a script

Utami1151
Level 1
Level 1

is if possible to write a script to change SSID to include date? The script will need to be run everyday to include date in SSID.

6 Replies 6

marce1000
VIP
VIP

 

 - Normally not because the SSID is connected/attached to the WLAN  , which would need to be disabled, deleted and or then create a new one with the intended SSID.

 M.



-- ' 'Good body every evening' ' this sentence was once spotted on a logo at the entrance of a Weight Watchers Club !

ammahend
VIP
VIP

I don’t have a script for you, but It’s just command execution, so I am sure you can do it, the tricky part will be changing the appending dates with ssid name (variable) everyday at a specific time, which will require some additional libraries and knowledge to work with them. 
just don’t plan to execute the script to WLC over wireless, as mentioned below, you will have to disable the WLAN. 

-hope this helps-

yeah I can see that there is a CLI command in WLC to change SSID name.

I'm thinking to write a cron job but not sure how yet. 

thanks anyway

JPavonM
VIP
VIP

@Utami1151 take notice that after you change the SSID to contain the date, none of the previously connected clients would be able to autoconnect to it, so a manual intervention would be required by the end-user.

If this is what you are trying to get, somekind of security for a hotel-like deployment, to avoid previous guests to use the "free Wi-Fi" service, that would be a tricky way to accomplish that, and maybe there would be another way to address that in your deployment.

With that been said, I think this piece of script would work for you if using a Catalyst 9800 (maybe missing other libraries that are need):

# // Netmiko module for remote connectivity
from netmiko import ConnectHandler, NetmikoTimeoutException, NetmikoAuthenticationException

# // Get date into the script
import datetime, timedelta

today = datetime.date.today()
ssidDate = str(today.strftime("%d%m%Y"))
# // Replace "Guest" with your own SSID substring that you want to keep
ssidString = Guest + ssidDate

# // Define Configuration to be entered on c9800
template="""wlan Guest 99 {ssidString}
shutdown
# // As you are only modifying thge broadcasted SSID and not the WLAN profile, there is no need to change anything unless you want to also change the PSK
no shutdown
end
write""".format(ssidString=ssidString)

#// Create c9800 template and replace credentials and IP address
yourIosWlc = ConnectHandler(
device_type="cisco_ios",
ip="10.11.12.13",
username="admin",
password="12345678"
)

#// Push the generated config on WLC
generatedconfig=template.split("\n")
yourIosWlc.send_config_set(generatedconfig)
yourIosWlc.disconnect()

HTH
-Jesus
*** Please rate helpful responses ***

JPavonM
VIP
VIP

In addition to the previous, for the script to be run everyday, you need to create a scheduled task on Windows or a kron task on Linux to do that.

Arshad Safrulla
VIP Alumni
VIP Alumni

You can run an EEM script to achieve this, you can schedule the EEM using KRON. This allows you to do everything in your WLC itself.

Sample EEM script in 9800- Automated Backup SSID with EEM on Catalyst 9800 Wireless Controllers - Cisco Community

Considering programming and automation is becoming a must have skill in network management, I would highly recommend to follow @JPavonM's recommendation. There are lot of options available if you want to give a try. As @JPavonM mentioned take note of the user friendliness as well.

 

Review Cisco Networking products for a $25 gift card