diff --git a/gui/views/inv_cisco_wlc_ap_cdp_cache.py b/gui/views/inv_cisco_wlc_ap_cdp_cache.py index 582eb4d3f1c0e465b09c65a1cd7432c22e4fec01..08a3932ff7db406732b9f5fbfb2d414e21d1509b 100644 --- a/gui/views/inv_cisco_wlc_ap_cdp_cache.py +++ b/gui/views/inv_cisco_wlc_ap_cdp_cache.py @@ -1,11 +1,19 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +# +# License: GNU General Public License v2 +# +# Author: thl-cmk[at]outlook[dot]com +# URL : https://thl-cmk.hopto.org +# Date : 2016-04-08 +# +# +# 2023-06-14: removed declare_invtable_view from view definition on cmk 2.2 (see werk 15493) +# changed inventory_displayhints import (see werk 15493) + -from cmk.gui.plugins.views.utils import ( - inventory_displayhints, -) from cmk.gui.i18n import _ -from cmk.gui.plugins.views.inventory import declare_invtable_view +from cmk.gui.views.inventory.registry import inventory_displayhints inventory_displayhints.update({ '.networking.wlan.controller.ap_cdp_cache:': {'title': _('Access Points CDP Cache'), @@ -23,6 +31,3 @@ inventory_displayhints.update({ '.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/check_parameters/inv_cisco_wlc_ap_cdp_cache.py b/gui/wato/check_parameters/inv_cisco_wlc_ap_cdp_cache.py new file mode 100644 index 0000000000000000000000000000000000000000..d24febe6fe6a8a3518589439eeb41a9b48736f93 --- /dev/null +++ b/gui/wato/check_parameters/inv_cisco_wlc_ap_cdp_cache.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# License: GNU General Public License v2 +# +# Author: thl-cmk[at]outlook[dot]com +# URL : https://thl-cmk.hopto.org +# Date : 2016-04-08 +# +# +# 2023-06-14: moved wato file to check_parameters sub directory + +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.4.0-20230614.mkp b/inv_cisco_wlc_ap_cdp_cache-0.4.0-20230614.mkp new file mode 100644 index 0000000000000000000000000000000000000000..78faa37174518542d3688a0041f72667fd480c58 Binary files /dev/null and b/inv_cisco_wlc_ap_cdp_cache-0.4.0-20230614.mkp differ diff --git a/inv_cisco_wlc_ap_cdp_cache.mkp b/inv_cisco_wlc_ap_cdp_cache.mkp index d98c39e644d5f48a3c655687b5a4fb90b190ba8c..78faa37174518542d3688a0041f72667fd480c58 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 2814d6ef4987a086e2efb7b19675c02eebd568e7..835b039dd882e124eb4e98ac97fae5b844114fc0 100644 --- a/packages/inv_cisco_wlc_ap_cdp_cache +++ b/packages/inv_cisco_wlc_ap_cdp_cache @@ -12,10 +12,10 @@ 'download_url': 'https://thl-cmk.hopto.org', 'files': {'agent_based': ['inv_cisco_wlc_ap_cdp_cache.py'], 'gui': ['views/inv_cisco_wlc_ap_cdp_cache.py', - 'wato/inv_cisco_wlc_ap_cdp_cache.py']}, + 'wato/check_parameters/inv_cisco_wlc_ap_cdp_cache.py']}, 'name': 'inv_cisco_wlc_ap_cdp_cache', 'title': 'inventory for Cisco WLC AP CDP cache (CISCO-LWAPP-CDP-MIB)', - 'version': '0.3.1-20230614', - 'version.min_required': '2.1.0b1', + 'version': '0.4.0-20230614', + 'version.min_required': '2.2.0b1', 'version.packaged': '2.2.0p2', - 'version.usable_until': '2.2.0b1'} + 'version.usable_until': None}