diff --git a/agent_based/inv_cisco_wlc_clients.py b/agent_based/inv_cisco_wlc_clients.py index c208d2c39927b8b814d3911d9ffa84f458ce81b4..9151962b07e5e8a2d88f8d105d1426b92638760e 100644 --- a/agent_based/inv_cisco_wlc_clients.py +++ b/agent_based/inv_cisco_wlc_clients.py @@ -9,12 +9,13 @@ # # writen by: Th.L thl-cmk[at]outlook[dot]com # -# 2016-08-22 : removed index column -# 2017-04-09 : added wato enable/disable, remove columns -# 2018-09-04 : changes for CMK 1.5.x (inv_tree --> inv_tree_list) -# 2020-03-15 : added support for CMK1.6x -# 2021-07-12 : rewritten for CMK 2.0 -# +# 2016-08-22: removed index column +# 2017-04-09: added wato enable/disable, remove columns +# 2018-09-04: changes for CMK 1.5.x (inv_tree --> inv_tree_list) +# 2020-03-15: added support for CMK1.6x +# 2021-07-12: rewritten for CMK 2.0 +# 2021-07-15: added support for Catalyst 9800 Controllers + import re import time @@ -30,6 +31,7 @@ from cmk.base.plugins.agent_based.agent_based_api.v1 import ( SNMPTree, TableRow, contains, + any_of, ) from cmk.base.plugins.agent_based.agent_based_api.v1.type_defs import ( StringTable, @@ -358,7 +360,10 @@ register.snmp_section( '45', # cldcUserAuthType ] ), - detect=contains('.1.3.6.1.2.1.1.1.0', 'Cisco Controller'), # sysDescr + detect=any_of( + contains('.1.3.6.1.2.1.1.1.0', 'Cisco Controller'), # sysDescr + contains('.1.3.6.1.2.1.1.1.0', 'C9800 Software'), # sysDescr + ) ) register.inventory_plugin( diff --git a/inv_cisco_wlc_clients.mkp b/inv_cisco_wlc_clients.mkp index bfdecb39e90cf9a12c7b9e01d0b8257a4c9b99c2..4a6431743b5c0f22f7bba15646768d318a3848aa 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 654f42d021e894600208a5419945df1c22bb6ca3..a8519f062390a5270449571d413e0ae3491fb382 100644 --- a/packages/inv_cisco_wlc_clients +++ b/packages/inv_cisco_wlc_clients @@ -4,7 +4,6 @@ 'Via WATO you can:\n' ' - can add/remove some fields\n' '\n' - 'Tested with Cisco WLC 5520/5505/2504.\n' '\n' '2020-03.15: added support for CMK1.6x\n' '2021-07-12: rewritten for CMK 2.0\n', @@ -15,7 +14,7 @@ 'name': 'inv_cisco_wlc_clients', 'num_files': 3, 'title': 'inventory of cisco WLC clients', - 'version': '20210712.v0.3', + 'version': '20210715.v0.3a', 'version.min_required': '2.0.0', - 'version.packaged': '2021.04.10', + 'version.packaged': '2021.07.14', 'version.usable_until': None} \ No newline at end of file diff --git a/web/plugins/views/inv_cisco_wlc_clients.py b/web/plugins/views/inv_cisco_wlc_clients.py index 5123d51341688dff201663d6564d23b102241b0e..9386e64ce083c69a7533d71dc7136afe4dd34025 100644 --- a/web/plugins/views/inv_cisco_wlc_clients.py +++ b/web/plugins/views/inv_cisco_wlc_clients.py @@ -1,36 +1,41 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -import cmk.gui.utils from cmk.gui.plugins.views import ( inventory_displayhints, ) from cmk.gui.i18n import _ from cmk.gui.plugins.views.inventory import declare_invtable_view inventory_displayhints.update({ - '.networking.wlan.controller.clients:': {'title': _('WLC clients'), - 'keyorder': [ - 'index', 'username', 'uptime', 'ipaddress', 'apmacaddress', 'ssid', - 'channel', 'accessvlan', 'devicetype', 'protocol', 'status', - ], - 'view': 'invwlcclients_of_host'}, + '.networking.wlan.controller.clients:': { + 'title': _('WLC clients'), + 'keyorder': [ + 'index', 'username', 'uptime', 'ipaddress', 'apmacaddress', 'ssid', + 'channel', 'accessvlan', 'devicetype', 'protocol', 'status', + ], + 'view': 'invwlcclients_of_host'}, '.networking.wlan.controller.clients:*.index': {'title': _('Index'), }, - '.networking.wlan.controller.clients:*.macaddress': {'title': _('MAC Addresse'), }, + '.networking.wlan.controller.clients:*.username': {'title': _('Username'), }, + '.networking.wlan.controller.clients:*.uptime': {'title': _('Uptime'), }, + '.networking.wlan.controller.clients:*.ipaddress': {'title': _('IP address'), }, + '.networking.wlan.controller.clients:*.apmacaddress': {'title': _('AP MAC address'), }, + '.networking.wlan.controller.clients:*.ssid': {'title': _('SSID'), }, + '.networking.wlan.controller.clients:*.channel': {'title': _('Channel'), }, + '.networking.wlan.controller.clients:*.accessvlan': {'title': _('Access VLAN'), }, + '.networking.wlan.controller.clients:*.devicetype': {'title': _('Device type'), }, + '.networking.wlan.controller.clients:*.protocol': {'title': _('Protocol'), }, '.networking.wlan.controller.clients:*.status': {'title': _('Status'), }, + + '.networking.wlan.controller.clients:*.macaddress': {'title': _('MAC Addresse'), }, '.networking.wlan.controller.clients:*.wlanprofilename': {'title': _('WLAN profile name'), }, '.networking.wlan.controller.clients:*.wgbstatus': {'title': _('WGB status'), }, '.networking.wlan.controller.clients:*.wgbmacaddress': {'title': _('WGB MAC address'), }, - '.networking.wlan.controller.clients:*.protocol': {'title': _('Protocol'), }, '.networking.wlan.controller.clients:*.associationmode': {'title': _('Association mode'), }, - '.networking.wlan.controller.clients:*.apmacaddress': {'title': _('AP MAC address'), }, '.networking.wlan.controller.clients:*.iftype': {'title': _('Interface type'), }, - '.networking.wlan.controller.clients:*.ipaddress': {'title': _('IP address'), }, '.networking.wlan.controller.clients:*.nacstate': {'title': _('NAC state'), }, '.networking.wlan.controller.clients:*.quarantinevlan': {'title': _('Quarantine VLAN'), }, - '.networking.wlan.controller.clients:*.accessvlan': {'title': _('Access VLAN'), }, '.networking.wlan.controller.clients:*.logintime': {'title': _('Login time'), }, - '.networking.wlan.controller.clients:*.uptime': {'title': _('Uptime'), }, '.networking.wlan.controller.clients:*.powersavemode': {'title': _('Power save mode'), }, '.networking.wlan.controller.clients:*.currenttxrateset': {'title': _('Current TX rate (MBit/s)'), }, '.networking.wlan.controller.clients:*.datarateset': {'title': _('Data rate set'), }, @@ -42,15 +47,12 @@ inventory_displayhints.update({ '.networking.wlan.controller.clients:*.redirecturl': {'title': _('Redirect URL'), }, '.networking.wlan.controller.clients:*.aaaoverrideaclname': {'title': _('AAA overide ACL name'), }, '.networking.wlan.controller.clients:*.aaaoverrideaclapplied': {'title': _('AAA overide ACL applied'), }, - '.networking.wlan.controller.clients:*.username': {'title': _('Username'), }, - '.networking.wlan.controller.clients:*.ssid': {'title': _('SSID'), }, '.networking.wlan.controller.clients:*.securitytagid': {'title': _('Security tag ID'), }, '.networking.wlan.controller.clients:*.typekts': {'title': _('NEC KTS SIP client'), }, '.networking.wlan.controller.clients:*.ipv6aclname': {'title': _('IPv6 ACL name'), }, '.networking.wlan.controller.clients:*.ipv6aclapplied': {'title': _('IPv6 ACL applied'), }, '.networking.wlan.controller.clients:*.dataswitching': {'title': _('Data switching'), }, '.networking.wlan.controller.clients:*.authentication': {'title': _('Authentication'), }, - '.networking.wlan.controller.clients:*.channel': {'title': _('Channel'), }, '.networking.wlan.controller.clients:*.authmode': {'title': _('Auth mode'), }, '.networking.wlan.controller.clients:*.reasoncode': {'title': _('Reason code'), }, '.networking.wlan.controller.clients:*.sessionid': {'title': _('Session ID'), }, @@ -59,7 +61,6 @@ inventory_displayhints.update({ '.networking.wlan.controller.clients:*.mdnsadvcount': {'title': _('mDNS adv count'), }, '.networking.wlan.controller.clients:*.policyname': {'title': _('Policy name'), }, '.networking.wlan.controller.clients:*.aaarole': {'title': _('AAA role'), }, - '.networking.wlan.controller.clients:*.devicetype': {'title': _('Device type'), }, '.networking.wlan.controller.clients:*.userauthtype': {'title': _('User auth type'), }, }) diff --git a/web/plugins/wato/inv_cisco_wlc_clients.py b/web/plugins/wato/inv_cisco_wlc_clients.py index 7d25b08280cf18d0a8809d86f080ac806fecf92f..40a49f1bdd4c807d580c764a2bb0f9bfda68dffa 100644 --- a/web/plugins/wato/inv_cisco_wlc_clients.py +++ b/web/plugins/wato/inv_cisco_wlc_clients.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- # # + from cmk.gui.i18n import _ from cmk.gui.plugins.wato import ( HostRulespec, @@ -16,12 +17,23 @@ from cmk.gui.plugins.wato.inventory import ( RulespecGroupInventory, ) -_removecolumns = [ +_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'), - ('accessvlan', 'Access VLAN'), ('aclapplied', 'ACL applied'), ('aclname', 'ACL name'), ('aproammacaddress', 'AP roam MAC address'), @@ -67,9 +79,8 @@ def _valuespec_inv_cisco_wlc_clients(): ListChoice( title=_('list of columns to remove'), help=_('information to remove from inventory'), - choices=_removecolumns, - default_value=[ - ], + choices=_removecolumns_cisco_wlc_clients, + default_value=[], )), ], ) @@ -79,6 +90,6 @@ rulespec_registry.register( HostRulespec( group=RulespecGroupInventory, match_type='dict', - name='inv_cisco_wlc_clients', + name='inv_parameters:inv_cisco_wlc_clients', valuespec=_valuespec_inv_cisco_wlc_clients, ))