diff --git a/agent_based/inv_cisco_wlc_ap_cdp_cache.py b/agent_based/inv_cisco_wlc_ap_cdp_cache.py index deec16c45f6dcd0bf48022d925b330f503bcc917..db114bec5f5705754278669c2b232238cf29107f 100644 --- a/agent_based/inv_cisco_wlc_ap_cdp_cache.py +++ b/agent_based/inv_cisco_wlc_ap_cdp_cache.py @@ -37,11 +37,14 @@ from cmk.base.plugins.agent_based.agent_based_api.v1.type_defs import ( def _render_ip_address(bytestring): - bytestring_clean = bytestring.replace('"', '').replace('|4|', '').replace('.', ' ').strip().split(' ') - try: - return '.'.join(['%s' % int(m, 16) for m in bytestring_clean]) - except ValueError: - return bytestring + if len(bytestring) == 4: + return '.'.join(['%s' % ord(m) for m in bytestring]) + else: + bytestring_clean = bytestring.replace('"', '').replace('|4|', '').replace('.', ' ').strip().split(' ') + try: + return '.'.join(['%s' % int(m, 16) for m in bytestring_clean]) + except ValueError: + return bytestring _cdp_duplex = { @@ -94,6 +97,7 @@ def parse_cisco_wlc_ap_cdp_cache(string_table: StringTable): neighbours = [] for deviceindex, apname, apaddresstype, apaddress, neighname, neighaddresstype, neighaddress, neighinterface, \ platform, duplex, speed in string_table: + if int(apaddresstype) == 1: apaddress = _render_ip_address(apaddress) diff --git a/inv_cisco_wlc_ap_cdp_cache.mkp b/inv_cisco_wlc_ap_cdp_cache.mkp index 87dbb51fabc8e3e2c286888cd84e33ef44a41c71..66539c22be258b4b0231cfe7bed37e0a7cec3ade 100644 Binary files a/inv_cisco_wlc_ap_cdp_cache.mkp and b/inv_cisco_wlc_ap_cdp_cache.mkp differ