Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Huawei WLC AP Parsing crash on offline APs #762

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cmk/base/legacy_checks/huawei_wlc_aps.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ class StateTemplate(NamedTuple):
def parse_huawei_wlc_aps(string_table):
parsed = {}

# Filter Access Point Information from Offline Access Points
down_states = [key for key, value in ap_state_map.items() if value.value == 2]
string_table[0] = [line for line in string_table[0] if line[0] not in down_states]

aps_info1, aps_info2 = string_table

# Access-Points
Expand All @@ -56,6 +60,7 @@ def parse_huawei_wlc_aps(string_table):
# aps_info1 aps_info2
# [line] --> [2,4GHZ Info]
# --> [5GHz Info]

status, mem, cpu, temp, con_users = ap_info1
ap_id, radio_state_2GHz, ch_usage_2GHz, users_online_2GHz = aps_info2[2 * idx]
_ap_id, radio_state_5GHz, ch_usage_5GHz, users_online_5GHz = aps_info2[2 * idx + 1]
Expand Down