mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 11:48:03 +00:00
Support scheme in power-ctl
This commit is contained in:
@@ -125,6 +125,8 @@ def main():
|
|||||||
global upstream_port
|
global upstream_port
|
||||||
global pf_dbm
|
global pf_dbm
|
||||||
global pf_a4_dropoff
|
global pf_a4_dropoff
|
||||||
|
|
||||||
|
scheme = "ssh"
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description="Cisco TX Power report Script")
|
parser = argparse.ArgumentParser(description="Cisco TX Power report Script")
|
||||||
parser.add_argument("-d", "--dest", type=str, help="address of the cisco controller")
|
parser.add_argument("-d", "--dest", type=str, help="address of the cisco controller")
|
||||||
@@ -159,7 +161,8 @@ def main():
|
|||||||
try:
|
try:
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
host = args.dest
|
host = args.dest
|
||||||
scheme = args.scheme
|
if (args.scheme != None):
|
||||||
|
scheme = args.scheme
|
||||||
user = args.user
|
user = args.user
|
||||||
passwd = args.passwd
|
passwd = args.passwd
|
||||||
logfile = args.log
|
logfile = args.log
|
||||||
@@ -374,7 +377,7 @@ def main():
|
|||||||
"--cmd", "set_cx_state all c-udp-power RUNNING"], capture_output=True);
|
"--cmd", "set_cx_state all c-udp-power RUNNING"], capture_output=True);
|
||||||
|
|
||||||
myrd = ""
|
myrd = ""
|
||||||
advanced = subprocess.run(["./cisco_wifi_ctl.py", "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
advanced = subprocess.run(["./cisco_wifi_ctl.py", "-s", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
||||||
"--action", "summary"], capture_output=True)
|
"--action", "summary"], capture_output=True)
|
||||||
pss = advanced.stdout.decode('utf-8', 'ignore');
|
pss = advanced.stdout.decode('utf-8', 'ignore');
|
||||||
print(pss)
|
print(pss)
|
||||||
@@ -431,36 +434,36 @@ def main():
|
|||||||
"--set_ifstate", "down"]);
|
"--set_ifstate", "down"]);
|
||||||
|
|
||||||
# Disable AP, apply settings, enable AP
|
# Disable AP, apply settings, enable AP
|
||||||
subprocess.run(["./cisco_wifi_ctl.py", "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
subprocess.run(["./cisco_wifi_ctl.py", "-s", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
||||||
"--action", "disable"])
|
"--action", "disable"])
|
||||||
subprocess.run(["./cisco_wifi_ctl.py", "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
subprocess.run(["./cisco_wifi_ctl.py", "-s", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
||||||
"--action", "cmd", "--value", "config 802.11a disable network"])
|
"--action", "cmd", "--value", "config 802.11a disable network"])
|
||||||
subprocess.run(["./cisco_wifi_ctl.py", "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
subprocess.run(["./cisco_wifi_ctl.py", "-s", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
||||||
"--action", "cmd", "--value", "config 802.11b disable network"])
|
"--action", "cmd", "--value", "config 802.11b disable network"])
|
||||||
|
|
||||||
if (tx != "NA"):
|
if (tx != "NA"):
|
||||||
subprocess.run(["./cisco_wifi_ctl.py", "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
subprocess.run(["./cisco_wifi_ctl.py", "-s", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
||||||
"--action", "txPower", "--value", tx])
|
"--action", "txPower", "--value", tx])
|
||||||
if (bw != "NA"):
|
if (bw != "NA"):
|
||||||
subprocess.run(["./cisco_wifi_ctl.py", "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
subprocess.run(["./cisco_wifi_ctl.py", "-s", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
||||||
"--action", "bandwidth", "--value", bw])
|
"--action", "bandwidth", "--value", bw])
|
||||||
|
|
||||||
# NSS is set on the station earlier...
|
# NSS is set on the station earlier...
|
||||||
|
|
||||||
if (ch != "NA"):
|
if (ch != "NA"):
|
||||||
subprocess.run(["./cisco_wifi_ctl.py", "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
subprocess.run(["./cisco_wifi_ctl.py", "-s", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
||||||
"--action", "channel", "--value", ch])
|
"--action", "channel", "--value", ch])
|
||||||
|
|
||||||
subprocess.run(["./cisco_wifi_ctl.py", "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
subprocess.run(["./cisco_wifi_ctl.py", "-s", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
||||||
"--action", "cmd", "--value", "config 802.11a enable network"])
|
"--action", "cmd", "--value", "config 802.11a enable network"])
|
||||||
subprocess.run(["./cisco_wifi_ctl.py", "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
subprocess.run(["./cisco_wifi_ctl.py", "-s", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
||||||
"--action", "cmd", "--value", "config 802.11b enable network"])
|
"--action", "cmd", "--value", "config 802.11b enable network"])
|
||||||
subprocess.run(["./cisco_wifi_ctl.py", "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
subprocess.run(["./cisco_wifi_ctl.py", "-s", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
||||||
"--action", "enable"])
|
"--action", "enable"])
|
||||||
|
|
||||||
# Wait a bit for AP to come back up
|
# Wait a bit for AP to come back up
|
||||||
time.sleep(1);
|
time.sleep(1);
|
||||||
advanced = subprocess.run(["./cisco_wifi_ctl.py", "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
advanced = subprocess.run(["./cisco_wifi_ctl.py", "-s", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, "-s", "ssh",
|
||||||
"--action", "advanced"], capture_output=True)
|
"--action", "advanced"], capture_output=True)
|
||||||
pss = advanced.stdout.decode('utf-8', 'ignore');
|
pss = advanced.stdout.decode('utf-8', 'ignore');
|
||||||
print(pss)
|
print(pss)
|
||||||
|
|||||||
Reference in New Issue
Block a user