From 276ac894d23e300b36b3ec9df574985d78a1fbc7 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Tue, 22 Sep 2020 14:35:34 -0600 Subject: [PATCH] bug fix, be more specific with slot --- cisco_wifi_ctl.py | 7 +++++++ lf_cisco_power.py | 41 +++++++++++++++++++---------------------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/cisco_wifi_ctl.py b/cisco_wifi_ctl.py index 9ea11234..376af0f2 100755 --- a/cisco_wifi_ctl.py +++ b/cisco_wifi_ctl.py @@ -18,6 +18,13 @@ $ pip3 install pexpect-serial ./cisco_wifi_ctl.py --scheme ssh -d 192.168.100.112 -u admin -p Cisco123 --action cmd --value "show ap config general APA453.0E7B.CF9C" telnet 172.19.36.168(Pwd:Wnbulab@123), go to the privileged mode and execute the command “clear line 43”. + +Cisco uses 9130 AP +show controllers dot11Radio 1 wlan + +AP +Command on AP to erase the config:"capwap ap erase all" + ''' diff --git a/lf_cisco_power.py b/lf_cisco_power.py index 6e214a96..bdc20d0b 100755 --- a/lf_cisco_power.py +++ b/lf_cisco_power.py @@ -648,32 +648,29 @@ def main(): continue if (searchap): - pat = "%s\s+(\S+)\s+(\S+)\s+\S+\s+\S+\s+(\S+)\s+(\S+)\s+\(\s*(\S+)\s+dBm\)+\s+(\S+)\*+\s"%(args.ap) + pat = "%s\s+(\S+)\s+%s\s+\S+\s+\S+\s+(\S+)\s+(\S+)\s+\(\s*(\S+)\s+dBm\)+\s+(\S+)\*+\s"%(args.ap,args.slot) m = re.search(pat, line) if (m != None): - cc_slot= m.group(2) - print("cc_slot: {}".format(cc_slot)) - if (args.slot == cc_slot): - cc_mac = m.group(1) - cc_slot = m.group(2) - cc_ch = m.group(6); # (132,136,140,144) - cc_power = m.group(4) - cc_power = cc_power.replace("*/", " of ", 1) # spread-sheets turn 1/8 into a date - cc_dbm = m.group(5) + cc_mac = m.group(1) + cc_slot = args.slot + cc_ch = m.group(5); # (132,136,140,144) + cc_power = m.group(3) + cc_power = cc_power.replace("*/", " of ", 1) # spread-sheets turn 1/8 into a date + cc_dbm = m.group(4) - cc_ch_count = cc_ch.count(",") - cc_bw = m.group(3) - print("group 1: {} 2: {} 3: {} 4: {} 5: {} 6: {}".format(m.group(1),m.group(2),m.group(3),m.group(4),m.group(5),m.group(6))) - print("9800 test_parameters_summary: read: tx: {} ch: {} bw: {}".format(tx,ch,bw)) + cc_ch_count = cc_ch.count(",") + cc_bw = m.group(2) + print("group 1: {} 2: {} 3: {} 4: {} 5: {} 6: {}".format(m.group(1),m.group(2),m.group(3),m.group(4),m.group(5),m.group(6))) + print("9800 test_parameters_summary: read: tx: {} ch: {} bw: {}".format(tx,ch,bw)) - print("9800 test_parameters cc_mac: read : {}".format(cc_mac)) - print("9800 test_parameters cc_slot: read : {}".format(cc_slot)) - print("9800 test_parameters cc_count: read : {}".format(cc_ch_count)) - print("9800 test_parameters cc_bw: read : {}".format(cc_bw)) - print("9800 test_parameters cc_power: read : {}".format(cc_power)) - print("9800 test_parameters cc_dbm: read : {}".format(cc_dbm)) - print("9800 test_parameters cc_ch: read : {}".format(cc_ch)) - break + print("9800 test_parameters cc_mac: read : {}".format(cc_mac)) + print("9800 test_parameters cc_slot: read : {}".format(cc_slot)) + print("9800 test_parameters cc_count: read : {}".format(cc_ch_count)) + print("9800 test_parameters cc_bw: read : {}".format(cc_bw)) + print("9800 test_parameters cc_power: read : {}".format(cc_power)) + print("9800 test_parameters cc_dbm: read : {}".format(cc_dbm)) + print("9800 test_parameters cc_ch: read : {}".format(cc_ch)) + break if (cc_dbm == ""): # Could not talk to controller?