diff --git a/agent_based/inv_cisco_wlc_ap_cdp_cache.py b/agent_based/inv_cisco_wlc_ap_cdp_cache.py index c0f1c9873f0ac39358302e4e56689a341b170475..b983c818a08f366a1380b48b51a36edd7aff4c53 100644 --- a/agent_based/inv_cisco_wlc_ap_cdp_cache.py +++ b/agent_based/inv_cisco_wlc_ap_cdp_cache.py @@ -15,7 +15,8 @@ # 2020-03-15: added support for CMK1.6x # 2021-07-10: rewritten vor CMK 2.0 # 2021-07-15 : added support for Catalyst 9800 Controllers - +# 2023-06-07: moved gui files to ~/local/lib/chek_mk/gui/plugins/... +# from cmk.base.plugins.agent_based.agent_based_api.v1 import ( register, @@ -154,8 +155,7 @@ def inventory_cisco_wlc_ap_cdp_cache(params, section) -> InventoryResult: register.snmp_section( name='inv_cisco_wlc_ap_cdp_cache', parse_function=parse_cisco_wlc_ap_cdp_cache, - fetch= - SNMPTree( + fetch=SNMPTree( base='.1.3.6.1.4.1.9.9.623.1.3.1.1', # CISCO-LWAPP-CDP-MIB::clcCdpApCacheEntry oids=[ '1', # clcCdpApCacheDeviceIndex diff --git a/gui/views/inv_cisco_wlc_ap_cdp_cache.py b/gui/views/inv_cisco_wlc_ap_cdp_cache.py new file mode 100644 index 0000000000000000000000000000000000000000..582eb4d3f1c0e465b09c65a1cd7432c22e4fec01 --- /dev/null +++ b/gui/views/inv_cisco_wlc_ap_cdp_cache.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +from cmk.gui.plugins.views.utils import ( + inventory_displayhints, +) +from cmk.gui.i18n import _ +from cmk.gui.plugins.views.inventory import declare_invtable_view + +inventory_displayhints.update({ + '.networking.wlan.controller.ap_cdp_cache:': {'title': _('Access Points CDP Cache'), + 'keyorder': ['ap_name', 'ap_address', 'neighbour_name', + 'neighbour_address', 'neighbour_interface', + 'neighbour_platform', ], + 'view': 'invwlcapcdpcache_of_host', + }, + '.networking.wlan.controller.ap_cdp_cache:*.ap_name': {'title': _('AP name'), }, + '.networking.wlan.controller.ap_cdp_cache:*.ap_address': {'title': _('AP address'), }, + '.networking.wlan.controller.ap_cdp_cache:*.neighbour_name': {'title': _('Neighbour name'), }, + '.networking.wlan.controller.ap_cdp_cache:*.neighbour_address': {'title': _('Neighbour address'), }, + '.networking.wlan.controller.ap_cdp_cache:*.neighbour_interface': {'title': _('Neighbour interface'), }, + '.networking.wlan.controller.ap_cdp_cache:*.neighbour_platform': {'title': _('Neighbour platform'), }, + '.networking.wlan.controller.ap_cdp_cache:*.duplex': {'title': _('Duplex'), }, + '.networking.wlan.controller.ap_cdp_cache:*.speed': {'title': _('Speed'), }, +}) + +declare_invtable_view('invwlcapcdpcache', '.networking.wlan.controller.ap_cdp_cache:', _('WLC AP CDP cache'), + _('WLC AP CDP Cache')) diff --git a/gui/wato/inv_cisco_wlc_ap_cdp_cache.py b/gui/wato/inv_cisco_wlc_ap_cdp_cache.py new file mode 100644 index 0000000000000000000000000000000000000000..e5b7567807e01292519086c4800feff751bdb9f1 --- /dev/null +++ b/gui/wato/inv_cisco_wlc_ap_cdp_cache.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# + +from cmk.gui.i18n import _ +from cmk.gui.plugins.wato.utils import ( + HostRulespec, + rulespec_registry, +) +from cmk.gui.valuespec import ( + Dictionary, + FixedValue, + TextAscii, + ListChoice, +) + +from cmk.gui.plugins.wato.inventory import ( + RulespecGroupInventory, +) + +_removecolumns_cisco_wlc_ap_cdp_cache = [ + ('duplex', 'Duplex'), + ('speed', 'Speed'), +] + + +def _valuespec_inv_cisco_wlc_ap_cdp_cache(): + return Dictionary( + title=_('Cisco WLC AP CDP cache'), + elements=[ + ('remove_domain', + FixedValue( + True, + title=_('Remove domain name from neighbour device name'), + totext=_('Remove the domain name enabled'), + default_value=False, + )), + ('domain_name', + TextAscii( + title=_('Specific domain name to remove from neighbour device name'), + allow_empty=False, + default_value='', + )), + ('removecolumns', + ListChoice( + title=_('List of columns to remove'), + help=_('information to remove from inventory'), + choices=_removecolumns_cisco_wlc_ap_cdp_cache, + default_value=[], + )), + ('use_short_if_name', + FixedValue( + True, + title=_('use short interface names (i.e. Gi0/0 for GigabitEthernet0/0)'), + totext=_('use short interface names enabled'), + default_value=False, + )), + ], + ) + + +rulespec_registry.register( + HostRulespec( + group=RulespecGroupInventory, + match_type='dict', + name='inv_parameters:inv_cisco_wlc_ap_cdp_cache', + valuespec=_valuespec_inv_cisco_wlc_ap_cdp_cache, + )) diff --git a/inv_cisco_wlc_ap_cdp_cache-0.3.1-20230607.mkp b/inv_cisco_wlc_ap_cdp_cache-0.3.1-20230607.mkp new file mode 100644 index 0000000000000000000000000000000000000000..2fa163e4db7d53b226414045f8881064cdd21696 Binary files /dev/null and b/inv_cisco_wlc_ap_cdp_cache-0.3.1-20230607.mkp differ diff --git a/inv_cisco_wlc_ap_cdp_cache.mkp b/inv_cisco_wlc_ap_cdp_cache.mkp index e707092120a8473611e715b62916813ffb3c43a4..2fa163e4db7d53b226414045f8881064cdd21696 100644 Binary files a/inv_cisco_wlc_ap_cdp_cache.mkp and b/inv_cisco_wlc_ap_cdp_cache.mkp differ diff --git a/packages/inv_cisco_wlc_ap_cdp_cache b/packages/inv_cisco_wlc_ap_cdp_cache index d44756c63d787dc4f65a3703900a52d61ecb960a..b9696de8b8a2716b5fdde80862486812ea3ca7b8 100644 --- a/packages/inv_cisco_wlc_ap_cdp_cache +++ b/packages/inv_cisco_wlc_ap_cdp_cache @@ -11,12 +11,11 @@ '2021-07-10: rewritten for CMK 2.0\n', 'download_url': 'https://thl-cmk.hopto.org', 'files': {'agent_based': ['inv_cisco_wlc_ap_cdp_cache.py'], - 'web': ['plugins/views/inv_cisco_wlc_ap_cdp_cache.py', - 'plugins/wato/inv_cisco_wlc_ap_cdp_cache.py']}, + 'gui': ['views/inv_cisco_wlc_ap_cdp_cache.py', + 'wato/inv_cisco_wlc_ap_cdp_cache.py']}, 'name': 'inv_cisco_wlc_ap_cdp_cache', - 'num_files': 3, 'title': 'inventory for Cisco WLC AP CDP cache (CISCO-LWAPP-CDP-MIB)', - 'version': '20210715.v0.3a', - 'version.min_required': '2.0.0', - 'version.packaged': '2021.07.14', + 'version': '0.3.1-20230607', + 'version.min_required': '2.1.0b1', + 'version.packaged': '2.1.0p21', 'version.usable_until': None} \ No newline at end of file