diff --git a/agent_based/inv_cisco_wlc_clients.py b/agent_based/inv_cisco_wlc_clients.py index 3794c86a9ee45fdca4b6fe52e9e64a0f3894d685..8d415060588ba3fc944ba03f779148eff9e1c8a9 100644 --- a/agent_based/inv_cisco_wlc_clients.py +++ b/agent_based/inv_cisco_wlc_clients.py @@ -211,51 +211,51 @@ def parse_inv_cisco_wlc_clients(string_table: StringTable): client = {} client['status_columns'] = {} client['index'] = index - client['status_columns']['username'] = username - client['status_columns']['wlanprofilename'] = wlanprofilename - client['status_columns']['ipaddress'] = ipaddress - client['status_columns']['quarantinevlan'] = quarantinevlan - client['status_columns']['accessvlan'] = accessvlan - client['status_columns']['logintime'] = logintime - client['status_columns']['uptime'] = uptime - client['status_columns']['currenttxrateset'] = currenttxrateset - client['status_columns']['datarateset'] = datarateset - client['status_columns']['aclname'] = aclname - client['status_columns']['redirecturl'] = redirecturl - client['status_columns']['aaaoverrideaclname'] = aaaoverrideaclname - client['status_columns']['ssid'] = ssid - client['status_columns']['securitytagid'] = securitytagid - client['status_columns']['ipv6aclname'] = ipv6aclname - client['status_columns']['channel'] = channel - client['status_columns']['sessionid'] = sessionid - client['status_columns']['mdnsprofile'] = mdnsprofile - client['status_columns']['mdnsadvcount'] = mdnsadvcount - client['status_columns']['policyname'] = policyname - client['status_columns']['aaarole'] = aaarole - client['status_columns']['devicetype'] = devicetype - client['status_columns']['macaddress'] = _render_mac_address(macaddress) - client['status_columns']['apmacaddress'] = _render_mac_address(apmacaddress) - client['status_columns']['aproammacaddress'] = _render_mac_address(aproammacaddress) - client['status_columns']['wgbmacaddress'] = _render_mac_address(wgbmacaddress) - client['status_columns']['ieee80211ucapable'] = _enable_disable.get(ieee80211ucapable) - client['status_columns']['posturestate'] = _enable_disable.get(posturestate) - client['status_columns']['typekts'] = _enable_disable.get(typekts) - client['status_columns']['aclapplied'] = _isaclapplied.get(aclapplied) - client['status_columns']['aaaoverrideaclapplied'] = _isaclapplied.get(aaaoverrideaclapplied) - client['status_columns']['ipv6aclapplied'] = _isaclapplied.get(ipv6aclapplied) - client['status_columns']['status'] = _clientstatus.get(status) - client['status_columns']['wgbstatus'] = _wgbstatus.get(wgbstatus) - client['status_columns']['protocol'] = _protocol.get(protocol) - client['status_columns']['associationmode'] = _associationmode.get(associationmode) - client['status_columns']['iftype'] = _interfacetype.get(iftype) - client['status_columns']['nacstate'] = _nacstate.get(nacstate) - client['status_columns']['powersavemode'] = _powersavemode.get(powersavemode) - client['status_columns']['hreapapauth'] = _hreapapauth.get(hreapapauth) - client['status_columns']['dataswitching'] = _dataswitching.get(dataswitching) - client['status_columns']['authentication'] = _authentication.get(authentication) - client['status_columns']['authmode'] = _authmode.get(authmode) - client['status_columns']['reasoncode'] = _reasoncode.get(reasoncode) - client['status_columns']['userauthtype'] = _userauthtype.get(userauthtype) + client['username'] = username + client['wlanprofilename'] = wlanprofilename + client['ipaddress'] = ipaddress + client['quarantinevlan'] = quarantinevlan + client['accessvlan'] = accessvlan + client['logintime'] = logintime + client['uptime'] = uptime + client['currenttxrateset'] = currenttxrateset + client['datarateset'] = datarateset + client['aclname'] = aclname + client['redirecturl'] = redirecturl + client['aaaoverrideaclname'] = aaaoverrideaclname + client['ssid'] = ssid + client['securitytagid'] = securitytagid + client['ipv6aclname'] = ipv6aclname + client['channel'] = channel + client['sessionid'] = sessionid + client['mdnsprofile'] = mdnsprofile + client['mdnsadvcount'] = mdnsadvcount + client['policyname'] = policyname + client['aaarole'] = aaarole + client['devicetype'] = devicetype + client['macaddress'] = _render_mac_address(macaddress) + client['apmacaddress'] = _render_mac_address(apmacaddress) + client['aproammacaddress'] = _render_mac_address(aproammacaddress) + client['wgbmacaddress'] = _render_mac_address(wgbmacaddress) + client['ieee80211ucapable'] = _enable_disable.get(ieee80211ucapable) + client['posturestate'] = _enable_disable.get(posturestate) + client['typekts'] = _enable_disable.get(typekts) + client['aclapplied'] = _isaclapplied.get(aclapplied) + client['aaaoverrideaclapplied'] = _isaclapplied.get(aaaoverrideaclapplied) + client['ipv6aclapplied'] = _isaclapplied.get(ipv6aclapplied) + client['status'] = _clientstatus.get(status) + client['wgbstatus'] = _wgbstatus.get(wgbstatus) + client['protocol'] = _protocol.get(protocol) + client['associationmode'] = _associationmode.get(associationmode) + client['iftype'] = _interfacetype.get(iftype) + client['nacstate'] = _nacstate.get(nacstate) + client['powersavemode'] = _powersavemode.get(powersavemode) + client['hreapapauth'] = _hreapapauth.get(hreapapauth) + client['dataswitching'] = _dataswitching.get(dataswitching) + client['authentication'] = _authentication.get(authentication) + client['authmode'] = _authmode.get(authmode) + client['reasoncode'] = _reasoncode.get(reasoncode) + client['userauthtype'] = _userauthtype.get(userauthtype) clients.append(client) return clients diff --git a/gui/views/inv_cisco_wlc_clients.py b/gui/views/inv_cisco_wlc_clients.py index 4ef9c43f482dbb148b6a32aef73256e1b85c3a29..b3610e4dfe302ffd83f5f81394310c86c8227497 100644 --- a/gui/views/inv_cisco_wlc_clients.py +++ b/gui/views/inv_cisco_wlc_clients.py @@ -1,11 +1,17 @@ -#!/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.clients:': { @@ -64,5 +70,3 @@ inventory_displayhints.update({ '.networking.wlan.controller.clients:*.aaarole': {'title': _('AAA role'), }, '.networking.wlan.controller.clients:*.userauthtype': {'title': _('User auth type'), }, }) - -declare_invtable_view('invwlcclients', '.networking.wlan.controller.clients:', _('WLC clients'), _('WLC clients')) diff --git a/gui/wato/check_parameters/inv_cisco_wlc_clients.py b/gui/wato/check_parameters/inv_cisco_wlc_clients.py new file mode 100644 index 0000000000000000000000000000000000000000..5d3dc431212c7bd1b346fa04063ea7dc14d8d73a --- /dev/null +++ b/gui/wato/check_parameters/inv_cisco_wlc_clients.py @@ -0,0 +1,102 @@ +# !/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_clients = [ + # 'index': {'title', 'Index'), + # 'username': {'title', 'Username'), + # 'uptime': {'title', 'Uptime'), + # 'ipaddress': {'title', 'IP address'), + # 'apmacaddress': {'title', 'AP MAC address'), + # 'ssid': {'title', 'SSID'), + # 'channel': {'title', 'Channel'), + # 'accessvlan': {'title', 'Access VLAN'), + # 'devicetype': {'title', 'Device type'), + # 'protocol': {'title', 'Protocol'), + # 'status': {'title', 'Status'), + + ('ieee80211ucapable', '802.11u capable'), + ('aaaoverrideaclapplied', 'AAA overide ACL applied'), + ('aaaoverrideaclname', 'AAA overide ACL name'), + ('aaarole', 'AAA role'), + ('aclapplied', 'ACL applied'), + ('aclname', 'ACL name'), + ('aproammacaddress', 'AP roam MAC address'), + ('associationmode', 'Association mode'), + ('authentication', 'Authentication'), + ('authmode', 'Auth mode'), + ('currenttxrateset', 'Current TX rate (MBit/s)'), + ('datarateset', 'Data rate set'), + ('dataswitching', 'Data switching'), + ('hreapapauth', 'HREAP AP auth'), + ('iftype', 'Interface type'), + ('ipv6aclapplied', 'IPv6 ACL applied'), + ('ipv6aclname', 'IPv6 ACL name'), + ('logintime', 'Login time'), + ('macaddress', 'MAC Addresse'), + ('mdnsadvcount', 'mDNS adv count'), + ('mdnsprofile', 'mDNS profile'), + ('nacstate', 'NAC state'), + ('policyname', 'Policy name'), + ('posturestate', 'Posture state'), + ('powersavemode', 'Power save mode'), + ('quarantinevlan', 'Quarantine VLAN'), + ('reasoncode', 'Reason code'), + ('redirecturl', 'Redirect URL'), + ('securitytagid', 'Security tag ID'), + ('sessionid', 'Session ID'), + ('typekts', 'NEC KTS SIP client'), + ('userauthtype', 'User auth type'), + ('wgbmacaddress', 'WGB MAC address'), + ('wgbstatus', 'WGB status'), + ('wlanprofilename', 'WLAN profile name'), +] + + +def _valuespec_inv_cisco_wlc_clients(): + return Dictionary( + title=_('Cisco WLC Clients'), + help=_('This inventory plugin collects all the client information from a Cisco Wireless LAN Controller. ' + 'To use this plugin you must also enable "Status data inventory" in a "Do hardware/software inventory" ' + 'rule.'), + elements=[ + ('removecolumns', + ListChoice( + title=_('list of columns to remove'), + help=_('information to remove from inventory'), + choices=_removecolumns_cisco_wlc_clients, + default_value=[], + )), + ], + ) + + +rulespec_registry.register( + HostRulespec( + group=RulespecGroupInventory, + match_type='dict', + name='inv_parameters:inv_cisco_wlc_clients', + valuespec=_valuespec_inv_cisco_wlc_clients, + )) diff --git a/inv_cisco_wlc_clients-0.5.0-20230616.mkp b/inv_cisco_wlc_clients-0.5.0-20230616.mkp new file mode 100644 index 0000000000000000000000000000000000000000..a0a60af2eafe3486d6bbc36b52caa1c448a78579 Binary files /dev/null and b/inv_cisco_wlc_clients-0.5.0-20230616.mkp differ diff --git a/inv_cisco_wlc_clients.mkp b/inv_cisco_wlc_clients.mkp index 6a0216ce8df188c1a23697fca4829adbacfebc82..a0a60af2eafe3486d6bbc36b52caa1c448a78579 100644 Binary files a/inv_cisco_wlc_clients.mkp and b/inv_cisco_wlc_clients.mkp differ diff --git a/packages/inv_cisco_wlc_clients b/packages/inv_cisco_wlc_clients index f57832393a3ba64d10fbb344c5788e593840fdcb..829517753a476fe9d1478b7519f4c8d23baffc05 100644 --- a/packages/inv_cisco_wlc_clients +++ b/packages/inv_cisco_wlc_clients @@ -10,10 +10,10 @@ 'download_url': 'http://thl-cmk.hopto.org', 'files': {'agent_based': ['inv_cisco_wlc_clients.py'], 'gui': ['views/inv_cisco_wlc_clients.py', - 'wato/inv_cisco_wlc_clients.py']}, + 'wato/check_parameters/inv_cisco_wlc_clients.py']}, 'name': 'inv_cisco_wlc_clients', 'title': 'inventory of cisco WLC clients', - 'version': '0.3.1-20230614', - 'version.min_required': '2.1.0b1', + 'version': '0.5.0-20230616', + 'version.min_required': '2.2.0b1', 'version.packaged': '2.2.0p2', - 'version.usable_until': '2.2.0b1'} + 'version.usable_until': None}