diff --git a/gui/views/inv_cisco_wlc_aps_lwap.py b/gui/views/inv_cisco_wlc_aps_lwap.py index e0225aff5c57fd6974e9c5791eb48e8f6f5eea8e..9b2784c5ec9b5f36be304462817065c953dc2349 100644 --- a/gui/views/inv_cisco_wlc_aps_lwap.py +++ b/gui/views/inv_cisco_wlc_aps_lwap.py @@ -1,11 +1,18 @@ -#!/usr/bin/env python3 +# !/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.accesspoints_lwap:': { @@ -73,6 +80,3 @@ inventory_displayhints.update({ '.networking.wlan.controller.accesspoints_lwap:*.is_master': {'title': _('AP is master')}, '.networking.wlan.controller.accesspoints_lwap:*.ble_fw_download_status': {'title': _('Ble FW downaload status')}, }) - -declare_invtable_view('invwlcapslwap', '.networking.wlan.controller.accesspoints_lwap:', _('Cisco WLC APs LWAP info'), - _('Cisco WLC APs LWAP info)')) diff --git a/gui/wato/check_parameters/inv_cisco_wlc_aps_lwap.py b/gui/wato/check_parameters/inv_cisco_wlc_aps_lwap.py new file mode 100644 index 0000000000000000000000000000000000000000..633d1c4366106ea05647116ac2418d22c96a5292 --- /dev/null +++ b/gui/wato/check_parameters/inv_cisco_wlc_aps_lwap.py @@ -0,0 +1,117 @@ +# !/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, + ListChoice, +) + +from cmk.gui.plugins.wato.inventory import ( + RulespecGroupInventory, +) + +_removecolumns_cisco_wlc_aps_lwap = [ + # ('name', 'Name'), + # (if_mac_address', 'MAC Address'), + # ('admin', 'Admin state'), + # ('power_status', 'Power status'), + # ('led_state', 'LED state'), + # ('last_reboot_reason', 'Last reboot reason'), + # ('telnet', 'Telnet enabled'), + # ('ssh', 'SSH enabled'), + # ('encryption_supported', 'Encryption supported'), + # ('data_encryption', 'Data encryption'), + # ('encryption', 'Encryption enabled'), + # ('wips', 'wireless IPS,'), + + ('adj_channel_rogue_enabled', 'Adj. channel rogue'), + ('amsdu', 'Aggregate MAC Service Data Unit'), + ('antenna_band_mode', 'Antenna band mode'), + ('is_master', 'AP is master'), + ('is_universal', 'AP is universal'), + ('submode', 'AP submode'), + ('universal_prime_status', 'AP universal prime status'), + ('ble_fw_download_status', 'Ble FW downaload status'), + ('failover_priority', 'failover priority'), + ('floor_label', 'Floor label'), + ('location', 'Location'), + ('max_#_of_dot11_slots', 'max # of dot11 slots'), + ('max_#_of_ethernet_slots', 'max # of ethernet slots'), + ('max_client_limit_cause', 'Max client cause'), + ('max_client_limit_number_trap', 'Max client limit'), + ('max_client_limit_set', 'Max client set'), + ('trunk_vlan', 'Mgmt VLAN ID'), + ('trunk_vlan_status', 'Mgmt VLAN tagged state'), + ('enable_module', 'Module enabled'), + ('module_inserted', 'Module inserted'), + ('monitor_mode_optimization', 'monitor mode optimization'), + ('port_number', 'Port number'), + ('pwr_injector_selection', 'Pow. inj. selection'), + ('pwr_injector_state', 'Pow. inj. state'), + ('pwr_injector_sw_mac_addr', 'Pow. inj. MAC address'), + ('pwr_pre_std_state', 'PoE pre standard'), + ('real_time_stats_mode_enabled', 'Real time stats'), + ('rogue_detection', 'Rogue detection enabled'), + ('sys_net_id', 'Sys net ID'), + ('tcp_mss', 'TCP MSS'), + ('upgrade_failure_cause', 'Upgrade failure cause'), + ('upgrade_from_version', 'Upgrade from version'), + ('upgrade_to_version', 'Upgrade to version'), + ('venue_config_language', 'Venue language'), + ('venue_config_venue_group', 'Venue group'), + ('venue_config_venue_name', 'Venue name'), + ('venue_config_venue_type', 'Venue type'), + ('wlc_primary_address', 'primary WLC'), + ('wlc_secondary_address', 'secondary WLC'), + ('wlc_tertiary_address', 'tertiary WLC'), +] + +_removecolumns_defaul_cisco_wlc_aps_lwap = [ + 'adj_channel_rogue_enabled', 'amsdu', 'is_master', 'is_universal', 'submode', + 'universal_prime_status', 'max_client_limit_cause', 'ble_fw_download_status', 'antenna_band_mode', + 'module_inserted', 'floor_label', 'max_client_limit_set', 'enable_module', + 'pwr_injector_sw_mac_addr', 'pwr_injector_selection', 'pwr_injector_state', 'pwr_pre_std_state', + 'trunk_vlan', 'trunk_vlan_status', 'tcp_mss', 'monitor_mode_optimization', 'sys_net_id', + 'upgrade_failure_cause', 'upgrade_from_version', 'upgrade_to_version', 'venue_config_language', + 'venue_config_venue_group', 'venue_config_venue_name', 'port_number', 'venue_config_venue_type', + 'max_#_of_dot11_slots', 'max_#_of_ethernet_slots', 'failover_priority', 'wlc_primary_address', + 'wlc_secondary_address', 'wlc_tertiary_address' +] + + +def _valuespec_inv_cisco_wlc_aps_lwap(): + return Dictionary( + title=_('Cisco WLC AP LWAP info'), + elements=[ + ('removecolumns', + ListChoice( + title=_('list of columns to remove'), + help=_('information to remove from inventory'), + choices=_removecolumns_cisco_wlc_aps_lwap, + default_value=_removecolumns_defaul_cisco_wlc_aps_lwap, + )), + ], + ) + + +rulespec_registry.register( + HostRulespec( + group=RulespecGroupInventory, + match_type='dict', + name='inv_parameters:inv_cisco_wlc_aps_lwap', + valuespec=_valuespec_inv_cisco_wlc_aps_lwap, + )) diff --git a/inv_cisco_wlc_aps_lwap-0.5.0-20230614.mkp b/inv_cisco_wlc_aps_lwap-0.5.0-20230614.mkp new file mode 100644 index 0000000000000000000000000000000000000000..41da71bc2cafc9c99bf642b304e773e2f298b151 Binary files /dev/null and b/inv_cisco_wlc_aps_lwap-0.5.0-20230614.mkp differ diff --git a/inv_cisco_wlc_aps_lwap.mkp b/inv_cisco_wlc_aps_lwap.mkp index e23d1cdfa55176a30e86b2252fe850c94c7dc4e9..41da71bc2cafc9c99bf642b304e773e2f298b151 100644 Binary files a/inv_cisco_wlc_aps_lwap.mkp and b/inv_cisco_wlc_aps_lwap.mkp differ diff --git a/packages/inv_cisco_wlc_aps_lwap b/packages/inv_cisco_wlc_aps_lwap index df7fbe144e813f36b0a9d8d24368d92859024cd3..722110da142c849c206cf895a86ee4236aab801c 100644 --- a/packages/inv_cisco_wlc_aps_lwap +++ b/packages/inv_cisco_wlc_aps_lwap @@ -8,10 +8,10 @@ 'download_url': 'http://thl-cmk.hopto.org', 'files': {'agent_based': ['inv_cisco_wlc_aps_lwap.py'], 'gui': ['views/inv_cisco_wlc_aps_lwap.py', - 'wato/inv_cisco_wlc_aps_lwap.py']}, + 'wato/check_parameters/inv_cisco_wlc_aps_lwap.py']}, 'name': 'inv_cisco_wlc_aps_lwap', 'title': 'inventory for CISCO-LWAPP-AP-MIB', - 'version': '0.4.0-20230614', - 'version.min_required': '2.1.0b1', + 'version': '0.5.0-20230614', + 'version.min_required': '2.2.0b1', 'version.packaged': '2.2.0p2', - 'version.usable_until': '2.2.0b1'} + 'version.usable_until': None}