mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 19:58:03 +00:00
lf_cisco_snp.py: updating cisco controller configuration - more will be added
This commit is contained in:
@@ -28,11 +28,11 @@ class cisco_():
|
||||
def __init__(self, args):
|
||||
self.args = args
|
||||
|
||||
#show summary (to get AP)
|
||||
#show summary (to get AP) (3400/9800)
|
||||
#./cisco_wifi_ctl.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 --action summary --series 9800 --log stdout
|
||||
def controller_show_summary(self):
|
||||
try:
|
||||
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"summary"))
|
||||
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
@@ -51,10 +51,11 @@ class cisco_():
|
||||
|
||||
#show ap dot11 5ghz summary (band defaults to 5ghz) --band a
|
||||
#show ap dot11 24ghz summary use --band b for 2.4 ghz
|
||||
#action advanced (3400/9800)
|
||||
#./cisco_wifi_ctl.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 --action advanced --series 9800 --log stdout
|
||||
def controller_show_ap_summary(self):
|
||||
try:
|
||||
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"advanced"))
|
||||
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
@@ -74,7 +75,7 @@ class cisco_():
|
||||
#./cisco_wifi_ctl.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 --action show_wlan_summary --series 9800 --log stdout
|
||||
def controller_show_wlan_summary(self):
|
||||
try:
|
||||
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"show wlan summary"))
|
||||
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
@@ -95,7 +96,7 @@ class cisco_():
|
||||
#./cisco_wifi_ctl.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action disable --series 9800
|
||||
def controller_disable_ap(self):
|
||||
try:
|
||||
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"disable"))
|
||||
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
@@ -117,7 +118,7 @@ class cisco_():
|
||||
#./cisco_wifi_ctl.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action disable_wlan --series 9800
|
||||
def controller_disable_wlan(self):
|
||||
try:
|
||||
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"disable_wlan"))
|
||||
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
@@ -138,97 +139,143 @@ class cisco_():
|
||||
#disable network 5ghz
|
||||
#./cisco_wifi_ctl.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action disable_network_5ghz --series 9800
|
||||
def controller_disable_network_5ghz(self):
|
||||
try:
|
||||
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"disable_network_5ghz"))
|
||||
if self.args.cisco_scheme == "9800":
|
||||
try:
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"disable_network_5ghz"))
|
||||
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
self.args.cisco_user, "-p", self.args.cisco_passwd,
|
||||
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band, "--action", "disable_network_5ghz"],
|
||||
capture_output=self.args.cap_ctl_out, check=True)
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
self.args.cisco_user, "-p", self.args.cisco_passwd,
|
||||
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band, "--action", "disable_network_5ghz"],
|
||||
capture_output=self.args.cap_ctl_out, check=True)
|
||||
|
||||
pss = ctl_output.stdout.decode('utf-8', 'ignore')
|
||||
print(pss)
|
||||
pss = ctl_output.stdout.decode('utf-8', 'ignore')
|
||||
print(pss)
|
||||
|
||||
except subprocess.CalledProcessError as process_error:
|
||||
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
|
||||
format(process_error.returncode, process_error.output))
|
||||
time.sleep(1)
|
||||
exit(1)
|
||||
except subprocess.CalledProcessError as process_error:
|
||||
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
|
||||
format(process_error.returncode, process_error.output))
|
||||
time.sleep(1)
|
||||
exit(1)
|
||||
else:
|
||||
try:
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value: {}".format(self.args.cisco_scheme,
|
||||
self.args.cisco_ctlr,self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
|
||||
self.args.cisco_band,"cmd","config 802.11a disable network"))
|
||||
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
self.args.cisco_user, "-p", self.args.cisco_passwd,
|
||||
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band, "--action", "cmd", "--value", "config 802.11a disable network"],
|
||||
capture_output=self.args.cap_ctl_out, check=True)
|
||||
|
||||
pss = ctl_output.stdout.decode('utf-8', 'ignore')
|
||||
print(pss)
|
||||
|
||||
except subprocess.CalledProcessError as process_error:
|
||||
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
|
||||
format(process_error.returncode, process_error.output))
|
||||
time.sleep(1)
|
||||
exit(1)
|
||||
|
||||
|
||||
#disable network 24ghz
|
||||
#./cisco_wifi_ctl.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action disable_network_24ghz --series 9800
|
||||
def controller_disable_network_24ghz(self):
|
||||
try:
|
||||
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"disable_network_24ghz"))
|
||||
if self.args.cisco_scheme == "9800":
|
||||
try:
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"disable_network_24ghz"))
|
||||
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
self.args.cisco_user, "-p", self.args.cisco_passwd,
|
||||
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band, "--action", "disable_network_24ghz"],
|
||||
capture_output=self.args.cap_ctl_out, check=True)
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
self.args.cisco_user, "-p", self.args.cisco_passwd,
|
||||
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band, "--action", "disable_network_24ghz"],
|
||||
capture_output=self.args.cap_ctl_out, check=True)
|
||||
|
||||
pss = ctl_output.stdout.decode('utf-8', 'ignore')
|
||||
print(pss)
|
||||
pss = ctl_output.stdout.decode('utf-8', 'ignore')
|
||||
print(pss)
|
||||
|
||||
except subprocess.CalledProcessError as process_error:
|
||||
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
|
||||
format(process_error.returncode, process_error.output))
|
||||
time.sleep(1)
|
||||
exit(1)
|
||||
else:
|
||||
try:
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value: {}".format(self.args.cisco_scheme,
|
||||
self.args.cisco_ctlr,self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
|
||||
self.args.cisco_band,"cmd","config 802.11b disable network"))
|
||||
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
self.args.cisco_user, "-p", self.args.cisco_passwd,
|
||||
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band, "--action", "cmd", "--value", "config 802.11b disable network"],
|
||||
capture_output=self.args.cap_ctl_out, check=True)
|
||||
|
||||
pss = ctl_output.stdout.decode('utf-8', 'ignore')
|
||||
print(pss)
|
||||
|
||||
except subprocess.CalledProcessError as process_error:
|
||||
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
|
||||
format(process_error.returncode, process_error.output))
|
||||
time.sleep(1)
|
||||
exit(1)
|
||||
|
||||
except subprocess.CalledProcessError as process_error:
|
||||
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
|
||||
format(process_error.returncode, process_error.output))
|
||||
time.sleep(1)
|
||||
exit(1)
|
||||
|
||||
|
||||
#set manual mode - Series 9800 must be set to manual mode
|
||||
#./cisco_wifi_ctl.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action manual --series 9800
|
||||
# ap name <AP NAME> dot11 5ghz radio role manual client-serving
|
||||
def controller_role_manual(self):
|
||||
try:
|
||||
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"manual"))
|
||||
if self.args.cisco_scheme == "9800":
|
||||
try:
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"manual"))
|
||||
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
self.args.cisco_user, "-p", self.args.cisco_passwd,
|
||||
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band, "--action", "manual"],
|
||||
capture_output=self.args.cap_ctl_out, check=True)
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
self.args.cisco_user, "-p", self.args.cisco_passwd,
|
||||
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band, "--action", "manual"],
|
||||
capture_output=self.args.cap_ctl_out, check=True)
|
||||
|
||||
pss = ctl_output.stdout.decode('utf-8', 'ignore')
|
||||
print(pss)
|
||||
pss = ctl_output.stdout.decode('utf-8', 'ignore')
|
||||
print(pss)
|
||||
|
||||
except subprocess.CalledProcessError as process_error:
|
||||
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
|
||||
format(process_error.returncode, process_error.output))
|
||||
time.sleep(1)
|
||||
exit(1)
|
||||
except subprocess.CalledProcessError as process_error:
|
||||
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
|
||||
format(process_error.returncode, process_error.output))
|
||||
time.sleep(1)
|
||||
exit(1)
|
||||
else:
|
||||
print("Check the cisco_scheme used attemping 9800 series on 3504 controller: {}".format(self.args.cisco_scheme))
|
||||
|
||||
#set manual mode - Series 9800 must be set to auto mode
|
||||
#./cisco_wifi_ctl.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action auto --series 9800
|
||||
# ap name <AP NAME> dot11 5ghz radio role manual client-serving
|
||||
def controller_role_auto(self):
|
||||
try:
|
||||
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"auto"))
|
||||
if self.args.cisco_scheme == "9800":
|
||||
try:
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"auto"))
|
||||
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
self.args.cisco_user, "-p", self.args.cisco_passwd,
|
||||
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band, "--action", "auto"],
|
||||
capture_output=self.args.cap_ctl_out, check=True)
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
self.args.cisco_user, "-p", self.args.cisco_passwd,
|
||||
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band, "--action", "auto"],
|
||||
capture_output=self.args.cap_ctl_out, check=True)
|
||||
|
||||
pss = ctl_output.stdout.decode('utf-8', 'ignore')
|
||||
print(pss)
|
||||
|
||||
except subprocess.CalledProcessError as process_error:
|
||||
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
|
||||
format(process_error.returncode, process_error.output))
|
||||
time.sleep(1)
|
||||
exit(1)
|
||||
pss = ctl_output.stdout.decode('utf-8', 'ignore')
|
||||
print(pss)
|
||||
|
||||
except subprocess.CalledProcessError as process_error:
|
||||
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
|
||||
format(process_error.returncode, process_error.output))
|
||||
time.sleep(1)
|
||||
exit(1)
|
||||
else:
|
||||
print("Check the cisco_scheme used attemping 9800 series on 3504 controller: {}".format(self.args.cisco_scheme))
|
||||
|
||||
#test parameters summary (txPower 1-8)
|
||||
#./cisco_wifi_ctl.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action txPower --value 5 --series 9800
|
||||
def controller_set_tx_power(self):
|
||||
try:
|
||||
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {} value {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
|
||||
self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
|
||||
self.args.cisco_band,"txPower", self.args.cisco_tx_power )) # TODO fix txPower to tx_power in cisco_wifi_ctl.py
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
@@ -252,7 +299,7 @@ class cisco_():
|
||||
# 3504 : (Cisco Controller) >config 802.11a channel ap APA453.0E7B.CF9C 52
|
||||
def controller_set_channel(self):
|
||||
try:
|
||||
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {} value {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
|
||||
self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
|
||||
self.args.cisco_band,"channel", self.args.cisco_channel ))
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
@@ -274,7 +321,7 @@ class cisco_():
|
||||
#./cisco_wifi_ctl.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action bandwidth --value 40 --series 9800
|
||||
def controller_set_bandwidth(self):
|
||||
try:
|
||||
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {} value {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} value {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
|
||||
self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
|
||||
self.args.cisco_band,"channel", self.args.cisco_chan_width ))
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
@@ -295,24 +342,26 @@ class cisco_():
|
||||
#create wlan
|
||||
#./cisco_wifi_ctl.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action create_wlan --wlan "open-wlan" --wlanID 1 --series 9800
|
||||
def controller_create_wlan(self):
|
||||
try:
|
||||
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {} wlan {} wlanID".format(self.args.cisco_scheme,self.args.cisco_ctlr,
|
||||
self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
|
||||
self.args.cisco_band,"create_wlan", self.args.cisco_wlan, self.args.cisco_wlanID ))
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
self.args.cisco_user, "-p", self.args.cisco_passwd,
|
||||
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band,
|
||||
"--action", "create_wlan","--wlan", self.args.cisco_wlan, "--wlanID", self.args.cisco_wlanID],
|
||||
capture_output=self.args.cap_ctl_out, check=True)
|
||||
|
||||
pss = ctl_output.stdout.decode('utf-8', 'ignore')
|
||||
print(pss)
|
||||
except subprocess.CalledProcessError as process_error:
|
||||
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
|
||||
format(process_error.returncode, process_error.output))
|
||||
time.sleep(1)
|
||||
exit(1)
|
||||
if self.args.cisco_scheme == "9800":
|
||||
try:
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {} wlan {} wlanID".format(self.args.cisco_scheme,self.args.cisco_ctlr,
|
||||
self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
|
||||
self.args.cisco_band,"create_wlan", self.args.cisco_wlan, self.args.cisco_wlanID ))
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
self.args.cisco_user, "-p", self.args.cisco_passwd,
|
||||
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band,
|
||||
"--action", "create_wlan","--wlan", self.args.cisco_wlan, "--wlanID", self.args.cisco_wlanID],
|
||||
capture_output=self.args.cap_ctl_out, check=True)
|
||||
|
||||
pss = ctl_output.stdout.decode('utf-8', 'ignore')
|
||||
print(pss)
|
||||
except subprocess.CalledProcessError as process_error:
|
||||
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
|
||||
format(process_error.returncode, process_error.output))
|
||||
time.sleep(1)
|
||||
exit(1)
|
||||
else:
|
||||
print("Check the cisco_scheme used attemping 9800 series on 3504 controller: {}".format(self.args.cisco_scheme))
|
||||
|
||||
#create wireless tag policy --9800 series needs to have wireless tag policy set
|
||||
#./cisco_wifi_ctl.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action wireless_tag_policy --series 9800
|
||||
@@ -340,7 +389,7 @@ class cisco_():
|
||||
#./cisco_wifi_ctl.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action enable_wlan --series 9800
|
||||
def controller_enable_wlan(self):
|
||||
try:
|
||||
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
|
||||
self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
|
||||
self.args.cisco_band,"enable_wlan"))
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
@@ -362,7 +411,7 @@ class cisco_():
|
||||
#./cisco_wifi_ctl.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action enable_network_5ghz --series 9800
|
||||
def controller_enable_network_5ghz(self):
|
||||
try:
|
||||
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
|
||||
self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
|
||||
self.args.cisco_band,"enable_network_5ghz"))
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
@@ -383,7 +432,7 @@ class cisco_():
|
||||
#./cisco_wifi_ctl.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action enable_network_24ghz --series 9800
|
||||
def controller_enable_network_24ghz(self):
|
||||
try:
|
||||
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
|
||||
self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
|
||||
self.args.cisco_band,"enable_network_24ghz"))
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
@@ -405,7 +454,7 @@ class cisco_():
|
||||
#./cisco_wifi_ctl.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action enable --series 9800
|
||||
def controller_enable_ap(self):
|
||||
try:
|
||||
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
|
||||
self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
|
||||
self.args.cisco_band,"enable"))
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
@@ -717,7 +766,7 @@ class L3VariableTime(LFCliBase):
|
||||
return
|
||||
|
||||
try:
|
||||
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
print("scheme: {} ctlr: {} user: {} passwd: {} AP: {} series: {} band: {} action: {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
|
||||
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"summary"))
|
||||
|
||||
ctl_output = subprocess.run(["../cisco_wifi_ctl.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
|
||||
@@ -1335,9 +1384,15 @@ TODO: Radio descriptions in realm , the 1. refers to the chassi hopefully corres
|
||||
print(cisco_args)
|
||||
|
||||
cisco = cisco_(cisco_args)
|
||||
|
||||
#Disable AP
|
||||
cisco.controller_disable_ap()
|
||||
if cisco_args.series == "9800":
|
||||
cisco.controller_disable_wlan()
|
||||
cisco.controller_network_5ghz()
|
||||
cisco.controller_network_24ghz()
|
||||
cisco.controller_role_manual()
|
||||
else:
|
||||
pass
|
||||
|
||||
|
||||
# TODO may need a static list of radios read for scaling and performance
|
||||
|
||||
Reference in New Issue
Block a user