From 0f065bd920fcb215b097e30e3c3cdb9a0c8db2d5 Mon Sep 17 00:00:00 2001 From: thl-cmk <thl-cmk@outlook.com> Date: Sun, 11 Jul 2021 18:21:00 +0000 Subject: [PATCH] Delete snmp_cisco_wlc_clients --- inventory/snmp_cisco_wlc_clients | 295 ------------------------------- 1 file changed, 295 deletions(-) delete mode 100644 inventory/snmp_cisco_wlc_clients diff --git a/inventory/snmp_cisco_wlc_clients b/inventory/snmp_cisco_wlc_clients deleted file mode 100644 index 30259ab..0000000 --- a/inventory/snmp_cisco_wlc_clients +++ /dev/null @@ -1,295 +0,0 @@ -#!/usr/bin/python -# -*- encoding: utf-8; py-indent-offset: 4 -*- -# -# invetory of cisco wlc wireless clients -# writen by: Th.L thl-cmk[at]outlook[dot]com -# -# 22.08.2016 : removed index column -# 09.04.2017 : added wato enable/disable, remove columns -# 04.09.2018 : changes for CMK 1.5.x (inv_tree --> inv_tree_list) -# # - - -def inv_cisco_wlc_clients(info, params): - enable_disable = { - 0: 'N/A', - 1: 'enabled', - 2: 'disabled', - } - - isaclapplied = { - 0: 'n/a', - 1: 'true', - 2: 'false', - 3: 'notavailable', - } - - _associationmode = { - 0: 'n/a', - 1: 'unknown', - 2: 'wep', - 3: 'wpa', - 4: 'wpa2', - } - - _authmode = { - 0: 'none', - 1: 'psk', - 2: 'radius', - 3: 'cckm', - 4: 'wapipsk', - 5: 'wapicert', - 6: 'ftdot1x', - 7: 'ftpsk', - 8: 'pmfdot1x', - 9: 'pmfpsk', - } - - _reasoncode = { - 0: 'n/a', - 1: 'unspecified', - 2: 'previousauthnotvalid', - 3: 'deauthenticationleaving', - 4: 'disassociationduetoinactivity', - 5: 'disassociationapbusy', - 6: 'class2framefromnonauthstation', - 7: 'class2framefromnonassstation', - 8: 'disassociationstahasleft', - 9: 'stareqassociationwithoutauth', - 10: 'invalidinformationelement', - 11: 'groupcipherinvalid', - 12: 'unicastcipherinvalid', - 13: 'akmpinvalid', - 14: 'unsupportedrsnversion', - 15: 'invalidrsniecapabilities', - 16: 'ciphersuiterejected', - 17: 'missingreasoncode', - 18: 'maxassociatedclientsreached', - 19: 'maxassociatedclientsreachedonradio', - 20: 'maxassociatedclientsreachedonwlan', - 21: 'unspecifiedqosfailure', - 22: 'qospolicymismatch', - 23: 'insufficientbandwidth', - 24: 'invalidqosparams', - } - - _authentication = { - 0: 'n/a', - 1: 'unknown', - 2: 'central', - 3: 'local', - } - - _dataswitching = { - 0: 'n/a', - 1: 'unknown', - 2: 'central', - 3: 'local', - } - - _hreapapauth = { - 0: 'n/a', - 1: 'true', - 2: 'false', - 3: 'notapplicable', - } - - _nacstate = { - 0: 'n/a', - 1: 'quarantine', - 2: 'access', - } - - _protocol = { - 0: 'n/a', - 1: '802.11a', - 2: '802.11b', - 3: '802.11g', - 4: 'unknown', - 5: 'mobile', - 6: '802.11n 2,4Ghz', - 7: '802.11n 5GHz', - 8: 'ethernet', - 9: 'dot3', - 10: '802.11ac 5GHz' - } - - _userauthtype = { - 0: 'n/a', - 1: 'open', - 2: 'wepPsk', - 3: 'portal', - 4: 'simPeap', - 5: 'other', - } - - _wgbstatus = { - 0: 'n/a', - 1: 'wireless client', - 2: 'wireless client via WGB', - 3: 'WGB itself', - } - - _clientstatus = { - 0: 'n/a', - 1: 'idle', - 2: 'aaa Pending', - 3: 'authenticated', - 4: 'associated', - 5: 'powersave', - 6: 'disassociated', - 7: 'to be deleted', - 8: 'probing', - 9: 'excluded', - } - - _interfacetype = { - 0: 'n/a', - 1: '802.11bg', - 2: '802.11a', - 3: 'Ultra wideband', - 4: '802.11abgn', - 5: '802.11ac', - 6: '802.11b', - 7: '802.11g', - 8: '802.11n 2.4GHz', - 9: '802.11n 5GHz', - 10: 'unknown', - } - - _powersavemode = { - 0: 'n/a', - 1: 'active', - 2: 'powersave', - } - - def render_mac_address(bytestring): - return ':'.join(['%02s' % hex(ord(m))[2:] for m in bytestring]).replace(' ', '0').upper() - - removecolumns = None - - if params: - if params.get('disable'): - return - # get list of columns to remove from inventory - removecolumns = params.get('removecolumns', removecolumns) - - node = inv_tree_list('networking.wlan.controller.clients:') - - for client in info: - macaddress,status,wlanprofilename,wgbstatus,wgbmacaddress,protocol,associationmode, \ - apmacaddress,iftype,ipaddress,nacstate,quarantinevlan,accessvlan,logintime,uptime, \ - powersavemode,currenttxrateset,datarateset,hreapapauth,ieee80211ucapable,posturestate, \ - aclname,aclapplied,redirecturl,aaaoverrideaclname,aaaoverrideaclapplied,username, \ - ssid,securitytagid,typekts,ipv6aclname,ipv6aclapplied,dataswitching,authentication, \ - channel,authmode,reasoncode,sessionid,aproammacaddress,mdnsprofile,mdnsadvcount, \ - policyname,aaarole,devicetype,userauthtype = client - - node.append({ - 'macaddress' : render_mac_address(macaddress), - 'status' : _clientstatus.get(int(status)), - 'wlanprofilename' : wlanprofilename, - 'wgbstatus' : _wgbstatus.get(int(wgbstatus)), - 'wgbmacaddress' : wgbmacaddress, - 'protocol' : _protocol.get(int(protocol)), - 'associationmode' : _associationmode.get(int(associationmode)), - 'apmacaddress' : render_mac_address(apmacaddress), - 'iftype' : _interfacetype.get(int(iftype)), - 'ipaddress' : ipaddress, - 'nacstate' : _nacstate.get(int(nacstate)), - 'quarantinevlan' : quarantinevlan, - 'accessvlan' : accessvlan, - 'logintime' : logintime, - 'uptime' : uptime, - 'powersavemode' : _powersavemode.get(int(powersavemode)), - 'currenttxrateset' : currenttxrateset, - 'datarateset' : datarateset, - 'hreapapauth' : _hreapapauth.get(int(hreapapauth)), - 'ieee80211ucapable' : enable_disable.get(int(ieee80211ucapable)), - 'posturestate' : enable_disable.get(int(posturestate)), - 'aclname' : aclname, - 'aclapplied' : isaclapplied.get(int(aclapplied)), - 'redirecturl' : redirecturl, - 'aaaoverrideaclname' : aaaoverrideaclname, - 'aaaoverrideaclapplied' : isaclapplied.get(int(aaaoverrideaclapplied)), - 'username' : username, - 'ssid' : ssid, - 'securitytagid' : securitytagid, - 'typekts' : enable_disable.get(int(typekts)), - 'ipv6aclname' : ipv6aclname, - 'ipv6aclapplied' : isaclapplied.get(int(ipv6aclapplied)), - 'dataswitching' : _dataswitching.get(int(dataswitching)), - 'authentication' : _authentication.get(int(authentication)), - 'channel' : channel, - 'authmode' : _authmode.get(int(authmode)), - 'reasoncode' : _reasoncode.get(int(reasoncode)), - 'sessionid' : sessionid, - 'aproammacaddress' : render_mac_address(aproammacaddress), - 'mdnsprofile' : mdnsprofile, - 'mdnsadvcount' : mdnsadvcount, - 'policyname' : policyname, - 'aaarole' : aaarole, - 'devicetype' : devicetype, - 'userauthtype' : _userauthtype.get(int(userauthtype)), - }) - - for i in node: - if removecolumns is not None: - for column in removecolumns: - if i.get(column) is not None: - i.pop(column) - - return node - - -inv_info['inv_cisco_wlc_clients'] = { - 'inv_function' : inv_cisco_wlc_clients, - 'snmp_scan_function': lambda oid: oid('.1.3.6.1.2.1.1.1.0') == 'Cisco Controller', - 'snmp_info' : ('.1.3.6.1.4.1.9.9.599.1.3.1.1', [ # CISCO-LWAPP-DOT11-CLIENT-MIB::cldcClientEntry - '1', #cldcClientMacAddress - '2', #cldcClientStatus - '3', #cldcClientWlanProfileName - '4', #cldcClientWgbStatus - '5', #cldcClientWgbMacAddress - '6', #cldcClientProtocol - '7', #cldcAssociationMode - '8', #cldcApMacAddress - '9', #cldcIfType - '10', #cldcClientIPAddress - '11', #cldcClientNacState - '12', #cldcClientQuarantineVLAN - '13', #cldcClientAccessVLAN - '14', #cldcClientLoginTime - '15', #cldcClientUpTime - '16', #cldcClientPowerSaveMode - '17', #cldcClientCurrentTxRateSet - '18', #cldcClientDataRateSet - '19', #cldcClientHreapApAuth - '20', #cldcClient80211uCapable - '21', #cldcClientPostureState - '22', #cldcClientAclName - '23', #cldcClientAclApplied - '24', #cldcClientRedirectUrl - '25', #cldcClientAaaOverrideAclName - '26', #cldcClientAaaOverrideAclApplied - '27', #cldcClientUsername - '28', #cldcClientSSID - '29', #cldcClientSecurityTagId - '30', #cldcClientTypeKTS - '31', #cldcClientIpv6AclName - '32', #cldcClientIpv6AclApplied - '33', #cldcClientDataSwitching - '34', #cldcClientAuthentication - '35', #cldcClientChannel - '36', #cldcClientAuthMode - '37', #cldcClientReasonCode - '38', #cldcClientSessionID - '39', #cldcClientApRoamMacAddress - '40', #cldcClientMdnsProfile - '41', #cldcClientMdnsAdvCount - '42', #cldcClientPolicyName - '43', #cldcClientAAARole - '44', #cldcClientDeviceType - '45', #cldcUserAuthType - ]), -} -- GitLab