diff --git a/agent_based/cisco_wlc.py b/agent_based/cisco_wlc.py index 20e42a1de63b3782fddcaeddc89637da559d55bc..0a09dceff290ceaaf5896c3bf90ef02118c88a63 100644 --- a/agent_based/cisco_wlc.py +++ b/agent_based/cisco_wlc.py @@ -22,8 +22,8 @@ # fixed _render_mac_address/_render_ip_address, code cleanup, removed WIPS check # added lwap_uptime/time taken to join. changed perfdata to 1/s # 2021-07-29: fix missing data from discovery (inv_ap_info) -# 2022-03-07: fixed handling of missing AP (THX to andreas[dot]doehler[at]gmail[dot]com -# +# 2022-03-07: fixed handling of missing AP (THX to andreas[dot]doehler[at]gmail[dot]com) +# 2022-04-01: added RADIO MAC address from time import time from dataclasses import dataclass @@ -94,6 +94,7 @@ class ApInfo: ap_serialnumber: str ap_ipaddress: str ap_ethernetmacaddress: str + ap_radio_mac: str ap_operationstatus: Optional[int] = None @@ -270,8 +271,9 @@ def parse_cisco_wlc(string_table: List[StringTable]) -> Optional[Dict[str, Ap]]: parsed = {} for ap in bsnap: - ap_oid_end, bsnap_name, ap_location, ap_operationstatus, ap_model, ap_serialnumber, \ + ap_oid_end, ap_dot3_mac_address, bsnap_name, ap_location, ap_operationstatus, ap_model, ap_serialnumber, \ ap_ipaddress, ap_ethernetmacaddress = ap + ap_info = ApInfo( ap_location=ap_location, ap_operationstatus=int(ap_operationstatus) if ap_operationstatus.isdigit else None, @@ -279,6 +281,7 @@ def parse_cisco_wlc(string_table: List[StringTable]) -> Optional[Dict[str, Ap]]: ap_serialnumber=ap_serialnumber, ap_ipaddress=ap_ipaddress, ap_ethernetmacaddress=_render_mac_address(ap_ethernetmacaddress), + ap_radio_mac=_render_mac_address(ap_dot3_mac_address), ) parsed.update({ @@ -294,7 +297,7 @@ def parse_cisco_wlc(string_table: List[StringTable]) -> Optional[Dict[str, Ap]]: ########################################################################### # -# INVENTORY function +# DISCOVERY function # ########################################################################### @@ -417,7 +420,8 @@ def check_cisco_wlc(item, params, section: Dict[str, Ap]) -> CheckResult: yield Result(state=State.OK, notice=f'\nBase data:') yield Result(state=State.OK, notice=f' - IP address: {ap_info.ap_ipaddress}') - yield Result(state=State.OK, notice=f' - MAC address: {ap_info.ap_ethernetmacaddress}') + yield Result(state=State.OK, notice=f' - Ethernet MAC address: {ap_info.ap_ethernetmacaddress}') + yield Result(state=State.OK, notice=f' - Radio MAC address: {ap_info.ap_radio_mac}') yield Result(state=State.OK, notice=f' - Model: {ap_info.ap_model}') yield Result(state=State.OK, notice=f' - S/N: {ap_info.ap_serialnumber}') yield Result(state=State.OK, notice=f' - Location: {ap_info.ap_location}') @@ -574,6 +578,7 @@ register.snmp_section( base='.1.3.6.1.4.1.14179.2.2.1.1', # AIRESPACE-WIRELESS-MIB::bsnAPEntry oids=[ OIDEnd(), + '1', # bsnAPDot3MacAddress '3', # 1 bsnAPName '4', # 2 bsnAPLocation '6', # 3 bsnAPOperationStatus diff --git a/cisco_wlc.mkp b/cisco_wlc.mkp index 32d7e0a1bde94c80fdfe7269318072c458ff517a..927e4113c35a2efa07f33194f8f9f575306d51d0 100644 Binary files a/cisco_wlc.mkp and b/cisco_wlc.mkp differ diff --git a/packages/cisco_wlc b/packages/cisco_wlc index b6b30c5233fc0238e485c69a5b4b143204634f12..869821b042d71219f930c97b222a088084c7ded5 100644 --- a/packages/cisco_wlc +++ b/packages/cisco_wlc @@ -14,7 +14,7 @@ 'name': 'cisco_wlc', 'num_files': 3, 'title': 'monitor Cisco WLC APs', - 'version': '20220307.v0.5c', + 'version': '20220401.v0.6', 'version.min_required': '2.0.0', 'version.packaged': '2021.09.20', 'version.usable_until': None} \ No newline at end of file