mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 10:48:02 +00:00 
			
		
		
		
	cisco_wifi_ctl.py, lf_cisco_power.py : need to get to working state.
This commit is contained in:
		| @@ -139,18 +139,19 @@ def main(): | ||||
|    logg = logging.getLogger(__name__) | ||||
|    logg.setLevel(logging.DEBUG) | ||||
|    file_handler = None | ||||
|    if (logfile != "stdout"): | ||||
|       file_handler = logging.FileHandler(logfile, "w") | ||||
|       file_handler.setLevel(logging.DEBUG) | ||||
|       file_handler.setFormatter(formatter) | ||||
|       logg.addHandler(file_handler) | ||||
|       logging.basicConfig(format=FORMAT, handlers=[console_handler]) | ||||
|    else: | ||||
|       # stdout logging | ||||
|       logging.basicConfig(format=FORMAT, handlers=[console_handler]) | ||||
|    if (logfile is not None): | ||||
|        if (logfile != "stdout"): | ||||
|            file_handler = logging.FileHandler(logfile, "w") | ||||
|            file_handler.setLevel(logging.DEBUG) | ||||
|            file_handler.setFormatter(formatter) | ||||
|            logg.addHandler(file_handler) | ||||
|            logging.basicConfig(format=FORMAT, handlers=[file_handler]) | ||||
|        else: | ||||
|            # stdout logging | ||||
|            logging.basicConfig(format=FORMAT, handlers=[console_handler]) | ||||
|  | ||||
|    logg.info("cisco series {}".format(args.series)) | ||||
|    logg.info("scheme {}".format(args.scheme)) | ||||
|    print("cisco series {}".format(args.series)) | ||||
|    print("scheme {}".format(args.scheme)) | ||||
|  | ||||
|    try: | ||||
|       if (scheme == "serial"): | ||||
| @@ -160,7 +161,7 @@ def main(): | ||||
|          with serial.Serial('/dev/ttyUSB0', 115200, timeout=5) as ser: | ||||
|             egg = SerialSpawn(ser); | ||||
|             egg.logfile = FileAdapter(logg) | ||||
|             logg.info("logg {}".format(logg)) | ||||
|             print("logg {}".format(logg)) | ||||
|             egg.sendline(NL) | ||||
|             time.sleep(0.1) | ||||
|             egg.expect('login:', timeout=3) | ||||
| @@ -177,7 +178,7 @@ def main(): | ||||
|          egg = pexpect.spawn(cmd) | ||||
|          #egg.logfile_read = sys.stdout.buffer | ||||
|          egg.logfile = FileAdapter(logg) | ||||
|          logg.info("logg {}".format(logg)) | ||||
|          print("logg {}".format(logg)) | ||||
|          time.sleep(0.1) | ||||
|          logged_in_9800 = False | ||||
|          loop_count = 0 | ||||
| @@ -893,7 +894,7 @@ def main(): | ||||
|       egg.expect(">", timeout=3) | ||||
|  | ||||
|    logg.info("Ap[%s] Action[%s] Value[%s] "%(args.ap, args.action, args.value)) | ||||
|    #print("Ap[%s] Action[%s] Value[%s]"%(args.ap, args.action, args.value)) | ||||
|    print("Ap[%s] Action[%s] Value[%s]"%(args.ap, args.action, args.value)) | ||||
|  | ||||
|    if ((args.action == "show") and (args.value is None)): | ||||
|       raise Exception("show requires value, like 'country' or 'ap summary'") | ||||
| @@ -1083,14 +1084,12 @@ def main(): | ||||
|          command = "show ap channel %s"%(args.ap) | ||||
|  | ||||
|    if (args.action == "no_wlan_wireless_tag_policy"): | ||||
|        | ||||
|       logg.info("send wireless tag policy no wlan") | ||||
|       egg.sendline("config t") | ||||
|       sleep(0.1) | ||||
|       i = egg.expect_exact(["(config)#",pexpect.TIMEOUT],timeout=2) | ||||
|       policy = "no wlan {} policy default-policy-profile".format(args.wlan) | ||||
|       if i == 0: | ||||
|          for command in ["wireless tag policy default-policy-tag", policy]: #"no wlan open-wlan policy default-policy-profile" | ||||
|          for command in ["wireless tag policy default-policy-tag","no wlan open-wlan policy default-policy-profile"]: | ||||
|             egg.sendline(command) | ||||
|             sleep(1) | ||||
|             j = egg.expect_exact(["(config-policy-tag)#",pexpect.TIMEOUT],timeout=2) | ||||
| @@ -1107,9 +1106,9 @@ def main(): | ||||
|       egg.sendline("config t") | ||||
|       sleep(0.1) | ||||
|       i = egg.expect_exact(["(config)#",pexpect.TIMEOUT],timeout=2) | ||||
|       policy = "wlan {} policy default-policy-profile".format(args.wlan) | ||||
|       if i == 0: | ||||
|          for command in ["wireless tag policy default-policy-tag", policy]: #"wlan open-wlan policy default-policy-profile" | ||||
|          for command in ["wireless tag policy default-policy-tag","wlan open-wlan policy default-policy-profile"]: | ||||
|             egg.sendline(command) | ||||
|             sleep(1) | ||||
|             j = egg.expect_exact(["(config-policy-tag)#",pexpect.TIMEOUT],timeout=2) | ||||
|             if j == 0: | ||||
| @@ -1275,7 +1274,7 @@ def main(): | ||||
|       while logged_out_9800 == False and loop_count <= 6: | ||||
|          loop_count += 1 | ||||
|          i = egg.expect_exact(["WLC>","WLC#", "WLC(config)#","(config-wlan)#","(config-policy-tag)#","(config-line)#",pexpect.TIMEOUT],timeout=5) | ||||
|          logg.info(egg.before.decode('utf-8', 'ignore')) | ||||
|          print (egg.before.decode('utf-8', 'ignore')) | ||||
|          if i == 0: | ||||
|             logg.info("WLC> prompt received can send logout") | ||||
|             egg.sendline("logout") | ||||
| @@ -1355,7 +1354,7 @@ def main(): | ||||
|          try: | ||||
|             i = egg.expect_exact([CCPROMPT,LEGACY_PROMPT,AREYOUSURE,'--More-- or','config paging disable',pexpect.TIMEOUT],timeout=2) | ||||
|             logg.info("before {} after {}".format(egg.before.decode('utf-8', 'ignore'),egg.after.decode('utf-8', 'ignore'))) | ||||
|             logg.info(egg.before.decode('utf-8', 'ignore')) | ||||
|             print(egg.before.decode('utf-8', 'ignore')) | ||||
|             if i == 0:  | ||||
|                logg.info("{} prompt received after command sent".format(CCPROMPT)) | ||||
|                # granted the break will exit the loop | ||||
|   | ||||
| @@ -308,10 +308,10 @@ def main(): | ||||
|       if (args.pf_a4_dropoff != None): | ||||
|           pf_a4_dropoff = args.pf_p4_dropoff | ||||
|       if (args.verbose): | ||||
|           cap_ctl_out     = True | ||||
|           # capture the controller output , thus won't got to stdout some output always present | ||||
|           cap_ctl_out = False | ||||
|       else: | ||||
|           cap_ctl_out     = False  | ||||
|  | ||||
|           cap_ctl_out = True         | ||||
|       print("cap_ctl_out {}".format(cap_ctl_out))     | ||||
|       # note: there would always be an args.outfile due to the default | ||||
|       current_time = time.strftime("%m_%d_%Y_%H_%M_%S", time.localtime()) | ||||
| @@ -324,10 +324,6 @@ def main(): | ||||
|       if args.log: | ||||
|         outfile_log = "{}_{}_output_log.log".format(args.outfile,current_time) | ||||
|         print("output file log: {}".format(outfile_log)) | ||||
|       else: | ||||
|         outfile_log = "stdout" | ||||
|         print("output file log: {}".format(outfile_log))     | ||||
|  | ||||
|       email_dicts = [] | ||||
|       if args.email: | ||||
|         emails = args.email | ||||
| @@ -360,8 +356,8 @@ def main(): | ||||
|        file_handler.setLevel(logging.DEBUG) | ||||
|        file_handler.setFormatter(formatter) | ||||
|        logg.addHandler(file_handler) | ||||
|        #logg.addHandler(logging.StreamHandler(sys.stdout)) # allows to logging to file and stderr | ||||
|        logging.basicConfig(format=FORMAT, handlers=[console_handler]) | ||||
|        logg.addHandler(logging.StreamHandler(sys.stdout)) # allows to logging to file and stderr | ||||
|        #logging.basicConfig(format=FORMAT, handlers=[console_handler]) | ||||
|  | ||||
|    else: | ||||
|        #pass | ||||
| @@ -593,7 +589,7 @@ def main(): | ||||
|       try: | ||||
|          logg.info("9800 cisco_wifi_ctl.py: no_logging_console") | ||||
|          advanced = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                     "--action", "no_logging_console","--series",args.series,"--port", args.port], capture_output=True, check=True) | ||||
|                                     "--action", "no_logging_console","--series",args.series,"--port",args.port], capture_output=True, check=True) | ||||
|          pss = advanced.stdout.decode('utf-8', 'ignore'); | ||||
|          logg.info(pss) | ||||
|       except subprocess.CalledProcessError as process_error: | ||||
| @@ -603,7 +599,7 @@ def main(): | ||||
|       try: | ||||
|          logg.info("9800 cisco_wifi_ctl.py: line_console_0") | ||||
|          advanced = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                     "--action", "line_console_0","--series",args.series,"--port", args.port], capture_output=True, check=True) | ||||
|                                     "--action", "line_console_0","--series",args.series,"--port",args.port], capture_output=True, check=True) | ||||
|          pss = advanced.stdout.decode('utf-8', 'ignore'); | ||||
|          logg.info(pss) | ||||
|       except subprocess.CalledProcessError as process_error: | ||||
| @@ -614,13 +610,13 @@ def main(): | ||||
|    try: | ||||
|       logg.info("9800/3504 cisco_wifi_ctl.py: summary") | ||||
|       advanced = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                  "--action", "summary","--series",args.series,"--port", args.port ], capture_output=True, check=True) | ||||
|                                  "--action", "summary","--series",args.series,"--port",args.port], capture_output=True, check=True) | ||||
|       pss = advanced.stdout.decode('utf-8', 'ignore'); | ||||
|       logg.info(pss) | ||||
|    except subprocess.CalledProcessError as process_error: | ||||
|       logg.info("Controller unable to commicate to AP or unable to communicate to controller error code {}  output {}".format(process_error.returncode, process_error.output)) | ||||
|       exit_test(workbook) | ||||
|     | ||||
|           | ||||
|    # Find our current regulatory domain so we can report it properly | ||||
|    searchap = False | ||||
|    for line in pss.splitlines(): | ||||
| @@ -699,7 +695,7 @@ def main(): | ||||
|                    try: | ||||
|                        logg.info("3504/9800 cisco_wifi_ctl.py: disable AP {}".format(args.ap)) | ||||
|                        ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                        "--action", "disable","--series",args.series,"--port", args.port  ], capture_output=cap_ctl_out, check=True) | ||||
|                                        "--action", "disable","--series",args.series,"--port", args.port], capture_output=cap_ctl_out, check=True) | ||||
|                        if cap_ctl_out:    | ||||
|                           pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|                           logg.info(pss)  | ||||
| @@ -714,7 +710,7 @@ def main(): | ||||
|                        try: | ||||
|                           logg.info("9800 cisco_wifi_ctl.py: disable_wlan") | ||||
|                           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                    "--action", "disable_wlan","--series",args.series,"--port", args.port  ], capture_output=cap_ctl_out, check=True) | ||||
|                                    "--action", "disable_wlan","--series",args.series,"--port", args.port], capture_output=cap_ctl_out, check=True) | ||||
|                           if cap_ctl_out:    | ||||
|                              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|                              logg.info(pss)  | ||||
| @@ -725,7 +721,7 @@ def main(): | ||||
|                        try: | ||||
|                           logg.info("9800 cisco_wifi_ctl.py: disable_network_5ghz") | ||||
|                           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                    "--action", "disable_network_5ghz","--series",args.series,"--port", args.port  ], capture_output=cap_ctl_out, check=True) | ||||
|                                    "--action", "disable_network_5ghz","--series",args.series,"--port", args.port], capture_output=cap_ctl_out, check=True) | ||||
|                           if cap_ctl_out:    | ||||
|                              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|                              logg.info(pss)  | ||||
| @@ -737,7 +733,7 @@ def main(): | ||||
|                        try: | ||||
|                           logg.info("9800 cisco_wifi_ctl.py: disable_network_24ghz") | ||||
|                           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                    "--action", "disable_network_24ghz","--series",args.series,"--port", args.port  ], capture_output=cap_ctl_out, check=True) | ||||
|                                    "--action", "disable_network_24ghz","--series",args.series,"--port", args.port], capture_output=cap_ctl_out, check=True) | ||||
|                           if cap_ctl_out:    | ||||
|                              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|                              logg.info(pss)  | ||||
| @@ -749,7 +745,7 @@ def main(): | ||||
|                        try: | ||||
|                           logg.info("9800 cisco_wifi_ctl.py: manual") | ||||
|                           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                    "--action", "manual","--series",args.series,"--port", args.port  ], capture_output=cap_ctl_out, check=True) | ||||
|                                    "--action", "manual","--series",args.series,"--port", args.port], capture_output=cap_ctl_out, check=True) | ||||
|                           if cap_ctl_out:    | ||||
|                              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|                              logg.info(pss)  | ||||
| @@ -761,7 +757,7 @@ def main(): | ||||
|                        try: | ||||
|                           logg.info("3504 cisco_wifi_ctl.py: config 802.11a disable network") | ||||
|                           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                    "--action", "cmd", "--value", "config 802.11a disable network","--series",args.series,"--port", args.port  ], capture_output=cap_ctl_out, check=True) | ||||
|                                    "--action", "cmd", "--value", "config 802.11a disable network","--series",args.series,"--port", args.port], capture_output=cap_ctl_out, check=True) | ||||
|                           if cap_ctl_out:    | ||||
|                              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|                              logg.info(pss)  | ||||
| @@ -773,7 +769,7 @@ def main(): | ||||
|                        try: | ||||
|                           logg.info("3504 cisco_wifi_ctl.py: config 802.11b disable network") | ||||
|                           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                    "--action", "cmd", "--value", "config 802.11b disable network","--port", args.port  ], capture_output=cap_ctl_out, check=True) | ||||
|                                    "--action", "cmd", "--value", "config 802.11b disable network","--port", args.port], capture_output=cap_ctl_out, check=True) | ||||
|                           | ||||
|                           if cap_ctl_out:    | ||||
|                              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
| @@ -789,7 +785,7 @@ def main(): | ||||
|                        try: | ||||
|                           logg.info("9800/3504 cisco_wifi_ctl.py: txPower {}".format(tx)) | ||||
|                           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                        "--action", "txPower", "--value", tx, "--series" , args.series,"--port", args.port  ], capture_output=cap_ctl_out, check=True) | ||||
|                                        "--action", "txPower", "--value", tx, "--series" , args.series,"--port", args.port], capture_output=cap_ctl_out, check=True) | ||||
|                           if cap_ctl_out:    | ||||
|                              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|                              logg.info(pss)  | ||||
| @@ -805,7 +801,7 @@ def main(): | ||||
|                        try: | ||||
|                           logg.info("9800/3504 cisco_wifi_ctl.py: channel {}".format(ch)) | ||||
|                           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                        "--action", "channel", "--value", ch, "--series" , args.series,"--port", args.port  ], capture_output=cap_ctl_out, check=True) | ||||
|                                        "--action", "channel", "--value", ch, "--series" , args.series,"--port", args.port], capture_output=cap_ctl_out, check=True) | ||||
|                           if cap_ctl_out:    | ||||
|                              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|                              logg.info(pss)  | ||||
| @@ -819,7 +815,7 @@ def main(): | ||||
|                        try: | ||||
|                           logg.info("9800/3504 cisco_wifi_ctl.py: bandwidth {}".format(bw)) | ||||
|                           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                        "--action", "bandwidth", "--value", bw, "--series" , args.series,"--port", args.port  ], capture_output=cap_ctl_out, check=True) | ||||
|                                        "--action", "bandwidth", "--value", bw, "--series" , args.series,"--port", args.port], capture_output=cap_ctl_out, check=True) | ||||
|                           if cap_ctl_out:    | ||||
|                              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|                              logg.info(pss)  | ||||
| @@ -838,7 +834,7 @@ def main(): | ||||
|                           try: | ||||
|                               logg.info("9800 cisco_wifi_ctl.py: create_wlan wlan {} wlanID {} port {}".format(args.wlan, args.wlanID, args.port)) | ||||
|                               ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                       "--action", "create_wlan","--series",args.series, "--wlan", args.wlan, "--wlanID", args.wlanID,"--port", args.port  ], capture_output=cap_ctl_out, check=True)     | ||||
|                                       "--action", "create_wlan","--series",args.series, "--wlan", args.wlan, "--wlanID", args.wlanID,"--port", args.port], capture_output=cap_ctl_out, check=True)     | ||||
|                               if cap_ctl_out:    | ||||
|                                  pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|                                  logg.info(pss)  | ||||
| @@ -850,7 +846,7 @@ def main(): | ||||
|                           try: | ||||
|                               logg.info("9800 cisco_wifi_ctl.py: wireless_tag_policy") | ||||
|                               ctl_output =subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                       "--action", "wireless_tag_policy", "--wlan", args.wlan, "--series", args.series, "--wlanID", args.wlanID, "--series",args.series,"--port", args.port  ], capture_output=cap_ctl_out, check=True)  | ||||
|                                       "--action", "wireless_tag_policy","--series",args.series,"--port", args.port], capture_output=cap_ctl_out, check=True)  | ||||
|                               if cap_ctl_out:    | ||||
|                                  pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|                                  logg.info(pss)  | ||||
| @@ -861,7 +857,7 @@ def main(): | ||||
|                        try: | ||||
|                           logg.info("9800 cisco_wifi_ctl.py: enable_wlan") | ||||
|                           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                    "--action", "enable_wlan", "--wlan", args.wlan, "--wlanID", args.wlanID, "--series",args.series,"--port", args.port  ], capture_output=cap_ctl_out, check=True)                  | ||||
|                                    "--action", "enable_wlan","--series",args.series,"--port", args.port], capture_output=cap_ctl_out, check=True)                  | ||||
|                           if cap_ctl_out:    | ||||
|                               pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|                               logg.info(pss)  | ||||
| @@ -875,7 +871,7 @@ def main(): | ||||
|                        try:   | ||||
|                           logg.info("9800 cisco_wifi_ctl.py: enable_network_5ghz") | ||||
|                           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                    "--action", "enable_network_5ghz","--series",args.series,"--port", args.port  ], capture_output=cap_ctl_out, check=True)    | ||||
|                                    "--action", "enable_network_5ghz","--series",args.series,"--port", args.port], capture_output=cap_ctl_out, check=True)    | ||||
|                           if cap_ctl_out:    | ||||
|                             pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|                             logg.info(pss)  | ||||
| @@ -887,7 +883,7 @@ def main(): | ||||
|                        try: | ||||
|                           logg.info("9800 cisco_wifi_ctl.py: enable_network_24ghz") | ||||
|                           ctl_output =subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                    "--action", "enable_network_24ghz","--series",args.series,"--port", args.port  ], capture_output=cap_ctl_out, check=True)                  | ||||
|                                    "--action", "enable_network_24ghz","--series",args.series,"--port", args.port], capture_output=cap_ctl_out, check=True)                  | ||||
|                           if cap_ctl_out:    | ||||
|                               pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|                               logg.info(pss)  | ||||
| @@ -899,7 +895,7 @@ def main(): | ||||
|                        try: | ||||
|                           logg.info("3504 cisco_wifi_ctl.py: config 802.11a enable network") | ||||
|                           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                    "--action", "cmd", "--value", "config 802.11a enable network","--port", args.port  ], capture_output=cap_ctl_out, check=True) | ||||
|                                    "--action", "cmd", "--value", "config 802.11a enable network","--port", args.port], capture_output=cap_ctl_out, check=True) | ||||
|                           if cap_ctl_out:    | ||||
|                               pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|                               logg.info(pss)  | ||||
| @@ -911,7 +907,7 @@ def main(): | ||||
|                        try: | ||||
|                           logg.info("3504 cisco_wifi_ctl.py: config 802.11a enable network") | ||||
|                           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                    "--action", "cmd", "--value", "config 802.11b enable network","--port", args.port  ], capture_output=cap_ctl_out, check=True) | ||||
|                                    "--action", "cmd", "--value", "config 802.11b enable network","--port", args.port], capture_output=cap_ctl_out, check=True) | ||||
|                           if cap_ctl_out:    | ||||
|                               pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|                               logg.info(pss)  | ||||
| @@ -923,7 +919,7 @@ def main(): | ||||
|                    try:  | ||||
|                       logg.info("9800/3504 cisco_wifi_ctl.py: enable") | ||||
|                       ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                    "--action", "enable", "--series" , args.series,"--port", args.port  ], capture_output=cap_ctl_out, check=True) | ||||
|                                    "--action", "enable", "--series" , args.series,"--port", args.port], capture_output=cap_ctl_out, check=True) | ||||
|                       if cap_ctl_out:    | ||||
|                          pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|                          logg.info(pss)  | ||||
| @@ -944,7 +940,7 @@ def main(): | ||||
|                           try: | ||||
|                              logg.info("9800 cisco_wifi_ctl.py: advanced") | ||||
|                              advanced = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                                  "--action", "advanced","--series" , args.series,"--port", args.port ], capture_output=True, check=True) | ||||
|                                                  "--action", "advanced","--series" , args.series,"--port", args.port], capture_output=True, check=True) | ||||
|                              pss = advanced.stdout.decode('utf-8', 'ignore') | ||||
|                              logg.info(pss) | ||||
|                           except subprocess.CalledProcessError as process_error: | ||||
| @@ -1004,7 +1000,7 @@ def main(): | ||||
|                        try: | ||||
|                           logg.info("9800 cisco_wifi_ctl.py: show_wlan_summary") | ||||
|                           wlan_summary = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                               "--action", "show_wlan_summary","--series" , args.series,"--port", args.port  ], capture_output=True, check=True) | ||||
|                                               "--action", "show_wlan_summary","--series" , args.series,"--port", args.port], capture_output=True, check=True) | ||||
|                           pss = wlan_summary.stdout.decode('utf-8', 'ignore') | ||||
|                           logg.info(pss) | ||||
|                        except subprocess.CalledProcessError as process_error: | ||||
| @@ -1013,7 +1009,7 @@ def main(): | ||||
|                        try: | ||||
|                            logg.info("3504 cisco_wifi_ctl.py: advanced") | ||||
|                            advanced = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                               "--action", "advanced","--port", args.port ], capture_output=True, check=True) | ||||
|                                               "--action", "advanced","--port", args.port], capture_output=True, check=True) | ||||
|                            pss = advanced.stdout.decode('utf-8', 'ignore') | ||||
|                            logg.info(pss) | ||||
|                        except subprocess.CalledProcessError as process_error: | ||||
| @@ -1112,7 +1108,7 @@ def main(): | ||||
|                                try: | ||||
|                                   logg.info("9800 cisco_wifi_ctl.py: advanced") | ||||
|                                   advanced = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                               "--action", "advanced","--series" , args.series,"--port", args.port ], capture_output=True, check=True) | ||||
|                                               "--action", "advanced","--series" , args.series,"--port", args.port], capture_output=True, check=True) | ||||
|                                   pss = advanced.stdout.decode('utf-8', 'ignore') | ||||
|                                   logg.info(pss) | ||||
|                                except subprocess.CalledProcessError as process_error: | ||||
| @@ -1548,7 +1544,7 @@ def main(): | ||||
|        try: | ||||
|           logg.info("9800/3504 cisco_wifi_ctl.py: advanced") | ||||
|           advanced = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|              "--action", "advanced","--series" , args.series,"--port", args.port ], capture_output=True, check=True) | ||||
|              "--action", "advanced","--series" , args.series,"--port", args.port], capture_output=True, check=True) | ||||
|           pss = advanced.stdout.decode('utf-8', 'ignore') | ||||
|           logg.info(pss) | ||||
|        except subprocess.CalledProcessError as process_error: | ||||
| @@ -1557,7 +1553,7 @@ def main(): | ||||
|        try: | ||||
|           logg.info("9800/3504 cisco_wifi_ctl.py: summary") | ||||
|           advanced = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|              "--action", "summary","--series" , args.series,"--port", args.port ], capture_output=True, check=True) | ||||
|              "--action", "summary","--series" , args.series,"--port", args.port], capture_output=True, check=True) | ||||
|           pss = advanced.stdout.decode('utf-8', 'ignore') | ||||
|           logg.info(pss) | ||||
|        except subprocess.CalledProcessError as process_error: | ||||
| @@ -1576,7 +1572,7 @@ def main(): | ||||
|    try: | ||||
|       logg.info("9800/3504 cisco_wifi_ctl.py: disable AP {}".format(args.ap)) | ||||
|       ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                    "--action", "disable", "--series" , args.series,"--port", args.port  ],capture_output=cap_ctl_out, check=True) | ||||
|                    "--action", "disable", "--series" , args.series,"--port", args.port],capture_output=cap_ctl_out, check=True) | ||||
|       if cap_ctl_out: | ||||
|           pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|           logg.info(pss) | ||||
| @@ -1590,7 +1586,7 @@ def main(): | ||||
|        try: | ||||
|           logg.info("9800 cisco_wifi_ctl.py: no_wlan_wireless_tag_policy") | ||||
|           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                           "--action", "no_wlan_wireless_tag_policy", "--wlan", args.wlan, "--series", "--wlanID", args.wlanID, args.series,"--port", args.port  ], capture_output=cap_ctl_out, check=True)  | ||||
|                           "--action", "no_wlan_wireless_tag_policy","--series",args.series,"--port", args.port], capture_output=cap_ctl_out, check=True)  | ||||
|           if cap_ctl_out: | ||||
|              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|              logg.info(pss) | ||||
| @@ -1602,7 +1598,7 @@ def main(): | ||||
|        try: | ||||
|           logg.info("9800 cisco_wifi_ctl.py: delete_wlan") | ||||
|           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                       "--action", "delete_wlan","--series",args.series, "--wlan", args.wlan, "--wlanID", args.wlanID,"--port", args.port  ], capture_output=cap_ctl_out, check=True)     | ||||
|                       "--action", "delete_wlan","--series",args.series, "--wlan", args.wlan, "--wlanID", args.wlanID,"--port",args.port], capture_output=cap_ctl_out, check=True)     | ||||
|           if cap_ctl_out: | ||||
|              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|              logg.info(pss) | ||||
| @@ -1614,7 +1610,7 @@ def main(): | ||||
|        try: | ||||
|           logg.info("9800 cisco_wifi_ctl.py: disable_network_5ghz") | ||||
|           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                    "--action", "disable_network_5ghz","--series",args.series,"--port", args.port  ],capture_output=cap_ctl_out, check=True)       | ||||
|                                    "--action", "disable_network_5ghz","--series",args.series,"--port", args.port],capture_output=cap_ctl_out, check=True)       | ||||
|           if cap_ctl_out: | ||||
|              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|              logg.info(pss) | ||||
| @@ -1626,7 +1622,7 @@ def main(): | ||||
|        try: | ||||
|           logg.info("9800 cisco_wifi_ctl.py: disable_network_24ghz") | ||||
|           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                    "--action", "disable_network_24ghz","--series",args.series,"--port", args.port  ],capture_output=cap_ctl_out, check=True)                  | ||||
|                                    "--action", "disable_network_24ghz","--series",args.series,"--port", args.port],capture_output=cap_ctl_out, check=True)                  | ||||
|           if cap_ctl_out: | ||||
|              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|              logg.info(pss) | ||||
| @@ -1639,7 +1635,7 @@ def main(): | ||||
|        try: | ||||
|           logg.info("3504 cisco_wifi_ctl.py: config 802.11a disable network") | ||||
|           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                    "--action", "cmd", "--value", "config 802.11a disable network","--port", args.port  ],capture_output=cap_ctl_out, check=True) | ||||
|                    "--action", "cmd", "--value", "config 802.11a disable network","--port", args.port],capture_output=cap_ctl_out, check=True) | ||||
|           if cap_ctl_out: | ||||
|              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|              logg.info(pss) | ||||
| @@ -1651,7 +1647,7 @@ def main(): | ||||
|        try: | ||||
|           logg.info("3504 cisco_wifi_ctl.py: config 802.11b disable network") | ||||
|           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                    "--action", "cmd", "--value", "config 802.11b disable network","--port", args.port  ],capture_output=cap_ctl_out, check=True) | ||||
|                    "--action", "cmd", "--value", "config 802.11b disable network","--port", args.port],capture_output=cap_ctl_out, check=True) | ||||
|           if cap_ctl_out: | ||||
|              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|              logg.info(pss) | ||||
| @@ -1664,7 +1660,7 @@ def main(): | ||||
|        try:  | ||||
|           logg.info("9800/3504 cisco_wifi_ctl.py: txPower tx 1") | ||||
|           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                        "--action", "txPower", "--value", "1", "--series" , args.series,"--port", args.port  ],capture_output=cap_ctl_out, check=True) | ||||
|                        "--action", "txPower", "--value", "1", "--series" , args.series,"--port", args.port],capture_output=cap_ctl_out, check=True) | ||||
|           if cap_ctl_out: | ||||
|              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|              logg.info(pss) | ||||
| @@ -1677,8 +1673,8 @@ def main(): | ||||
|    if (ch != "NA"): | ||||
|        try: | ||||
|           logg.info("9800/3504 cisco_wifi_ctl.py: channel 36") | ||||
|           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                        "--action", "channel", "--value", "36", "--series" , args.series,"--port", args.port  ],capture_output=cap_ctl_out, check=True) | ||||
|           ctl_out = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                        "--action", "channel", "--value", "36", "--series" , args.series,"--port", args.port],capture_output=cap_ctl_out, check=True) | ||||
|           if cap_ctl_out: | ||||
|              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|              logg.info(pss) | ||||
| @@ -1691,7 +1687,7 @@ def main(): | ||||
|        try: | ||||
|           logg.info("9800/3504 cisco_wifi_ctl.py: bandwidth 20") | ||||
|           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                        "--action", "bandwidth", "--value", "20", "--series" , args.series,"--port", args.port  ],capture_output=cap_ctl_out, check=True) | ||||
|                        "--action", "bandwidth", "--value", "20", "--series" , args.series,"--port", args.port],capture_output=cap_ctl_out, check=True) | ||||
|           if cap_ctl_out: | ||||
|              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|              logg.info(pss) | ||||
| @@ -1704,7 +1700,7 @@ def main(): | ||||
|        try: | ||||
|           logg.info("9800 cisco_wifi_ctl.py: enable_network_5ghz") | ||||
|           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                    "--action", "enable_network_5ghz","--series",args.series,"--port", args.port  ],capture_output=cap_ctl_out, check=True)          | ||||
|                                    "--action", "enable_network_5ghz","--series",args.series,"--port", args.port],capture_output=cap_ctl_out, check=True)          | ||||
|           if cap_ctl_out: | ||||
|              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|              logg.info(pss) | ||||
| @@ -1716,7 +1712,7 @@ def main(): | ||||
|        try: | ||||
|           logg.info("9800 cisco_wifi_ctl.py: enable_network_24ghz") | ||||
|           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                    "--action", "enable_network_24ghz","--series",args.series,"--port", args.port  ],capture_output=cap_ctl_out, check=True)  | ||||
|                                    "--action", "enable_network_24ghz","--series",args.series,"--port", args.port],capture_output=cap_ctl_out, check=True)  | ||||
|           if cap_ctl_out: | ||||
|              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|              logg.info(pss) | ||||
| @@ -1728,7 +1724,7 @@ def main(): | ||||
|        try: | ||||
|           logg.info("9800 cisco_wifi_ctl.py: auto") | ||||
|           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                                    "--action", "auto","--series",args.series,"--port", args.port  ],capture_output=cap_ctl_out, check=True) | ||||
|                                    "--action", "auto","--series",args.series,"--port", args.port],capture_output=cap_ctl_out, check=True) | ||||
|           if cap_ctl_out: | ||||
|              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|              logg.info(pss) | ||||
| @@ -1741,7 +1737,7 @@ def main(): | ||||
|        try: | ||||
|           logg.info("3504 cisco_wifi_ctl.py: config 802.11a enable network") | ||||
|           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                    "--action", "cmd", "--value", "config 802.11a enable network","--port", args.port  ],capture_output=cap_ctl_out, check=True) | ||||
|                    "--action", "cmd", "--value", "config 802.11a enable network","--port", args.port],capture_output=cap_ctl_out, check=True) | ||||
|           if cap_ctl_out: | ||||
|              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|              logg.info(pss) | ||||
| @@ -1753,7 +1749,7 @@ def main(): | ||||
|        try: | ||||
|           logg.info("3504 cisco_wifi_ctl.py: config 802.11b enable network") | ||||
|           ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                    "--action", "cmd", "--value", "config 802.11b enable network","--port", args.port  ],capture_output=cap_ctl_out, check=True) | ||||
|                    "--action", "cmd", "--value", "config 802.11b enable network","--port", args.port],capture_output=cap_ctl_out, check=True) | ||||
|           if cap_ctl_out: | ||||
|              pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|              logg.info(pss) | ||||
| @@ -1765,7 +1761,7 @@ def main(): | ||||
|    try: | ||||
|       logg.info("9800/3504 cisco_wifi_ctl.py: enable") | ||||
|       ctl_output = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                    "--action", "enable", "--series" , args.series,"--port", args.port  ],capture_output=cap_ctl_out, check=True) | ||||
|                    "--action", "enable", "--series" , args.series,"--port", args.port],capture_output=cap_ctl_out, check=True) | ||||
|       if cap_ctl_out: | ||||
|          pss = ctl_output.stdout.decode('utf-8', 'ignore') | ||||
|          logg.info(pss) | ||||
| @@ -1786,7 +1782,7 @@ def main(): | ||||
|    try: | ||||
|       logg.info("9800/3504 cisco_wifi_ctl.py: advanced") | ||||
|       advanced = subprocess.run(["./cisco_wifi_ctl.py", "--scheme", scheme, "-d", args.dest, "-u", args.user, "-p", args.passwd, "-a", args.ap, "--band", band, | ||||
|                               "--action", "advanced", "--series" , args.series,"--port", args.port ], capture_output=True, check=True) | ||||
|                               "--action", "advanced", "--series" , args.series,"--port", args.port], capture_output=True, check=True) | ||||
|       pss = advanced.stdout.decode('utf-8', 'ignore'); | ||||
|       logg.info(pss) | ||||
|    except subprocess.CalledProcessError as process_error: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Chuck SmileyRekiere
					Chuck SmileyRekiere