diff --git a/inventory/snmp_cisco_wlc_aps_lwap b/inventory/snmp_cisco_wlc_aps_lwap deleted file mode 100644 index 71fde8cf4cc0cdba593b858ed7b0b2fbb482148c..0000000000000000000000000000000000000000 --- a/inventory/snmp_cisco_wlc_aps_lwap +++ /dev/null @@ -1,355 +0,0 @@ -#!/usr/bin/python -# -*- encoding: utf-8; py-indent-offset: 4 -*- -# -# inventory of cisco wlc aps -# -# writen by Th.L. thl-cmk[at]outlook[dot]com -# -# 22.08.2016 : removed index column -# 04.08.2018 : changed scan function, code cleanup -# 04.09.2018 : changes for CMK 1.5.x (inv_tree --> inv_tree_list) -# - - -def inv_wlc_aps_lwap(info, params): - removecolumns = [] - - last_reboot_reason = { - 0: 'none', - 1: 'dot11gModeChange', - 2: 'ipAddressSet', - 3: 'ipAddressReset', - 4: 'rebootFromController', - 5: 'dhcpFallbackFail', - 6: 'discoveryFail', - 7: 'noJoinResponse', - 8: 'denyJoin', - 9: 'noConfigResponse', - 10: 'configController', - 11: 'imageUpgradeSuccess', - 12: 'imageOpcodeInvalid', - 13: 'imageCheckSumInvalid', - 14: 'imageDataTimeout', - 15: 'configFileInvalid', - 16: 'imageDownloadError', - 17: 'rebootFromConsole', - 18: 'rapOverAir', - 19: 'powerLow', - 20: 'crash', - 21: 'powerHigh', - 22: 'powerLoss', - 23: 'powerChange', - 24: 'componentFailure', - 25: 'watchdog', - } - - enable_disable = { - 0: 'N/A', - 1: 'enabled', - 2: 'disabled', - } - - failover_pirority = { - 0: 'N/A', - 1: 'low', - 2: 'medium', - 3: 'high', - 4: 'critical', - } - - power_status = { - 0: 'N/A', - 1: 'low', - 2: '15.4W', - 3: '16.8W', - 4: 'full', - 5: 'external', - 6: 'mixedmode', - } - - pwr_injector_selection = { - 0: 'N/A', - 1: 'unknown', - 2: 'installed', - 3: 'override', - } - - monitor_mode_optimization = { - 0: 'N/A', - 1: 'all', - 2: 'tracking', - 3: 'wips', - 4: 'none', - } - - encryption_supported = { - 0: 'N/A', - 1: 'yes', - 2: 'no', - } - - inet_address_type = { - 0: 'N/A', - 1: 'ipv4', - 2: 'ipv6', - 3: 'ipv4z', - 4: 'ipv6z', - 16: 'dns', - } - - antenna_band_mode = { - 0: 'N/A', - 1: 'not applicable', - 2: 'single', - 3: 'dual', - } - - venueconfigvenuegroup = { - 0: 'N/A', - 1: 'unspecified', - 2: 'assembly', - 3: 'business', - 4: 'educational', - 5: 'factory and industrial', - 6: 'institutional', - 7: 'mercantile', - 8: 'residential', - 9: 'storage', - 10: 'utility and misc', - 11: 'vehicular', - 12: 'outdoor', - } - - venueconfigvenuetype = { - 0: 'N/A', - 1: 'unspecified', - 2: 'unspecified assembly', - 3: 'arena', - 4: 'stadium', - 5: 'passenger terminal', - 6: 'amphitheater', - 7: 'amusement park', - 8: 'place of worship', - 9: 'convention center', - 10: 'library', - 11: 'museum', - 12: 'restaurant', - 13: 'theater', - 14: 'bar', - 15: 'coffee shop', - 16: 'zoo or aquarium', - 17: 'emergency coordination center', - 18: 'unspecified business', - 19: 'doctor or dentist office', - 20: 'bank', - 21: 'firestation', - 22: 'policestation', - 23: 'postoffice', - 24: 'professional office', - 25: 'research and development facility', - 26: 'attorney office', - 27: 'unspecified educational', - 28: 'school primary', - 29: 'school secondary', - 30: 'university or college', - 31: 'unspecified factory and industrial', - 32: 'factory', - 33: 'unspecified institutional', - 34: 'hospital', - 35: 'longterm carefacility', - 36: 'alcohol and drug rehabilitation center', - 37: 'group home', - 38: 'prison or jail', - 39: 'unspecified mercantile', - 40: 'retail store', - 41: 'grocery market', - 42: 'auomotive service station', - 43: 'shoppin gmall', - 44: 'gas station', - 45: 'unspecified residential', - 46: 'privat eresidence', - 47: 'hotel or motel', - 48: 'dormitory', - 49: 'boarding house', - 50: 'unspecified storage', - 51: 'unspecified utility', - 52: 'unspecified vehicular', - 53: 'automobile or truck', - 54: 'airplane', - 55: 'bus', - 56: 'ferry', - 57: 'ship or boat', - 58: 'train', - 59: 'motorbike', - 60: 'unspecified outdoor', - 61: 'muni mesh network', - 62: 'citypark', - 63: 'restarea', - 64: 'traffic control', - 65: 'busstop', - 66: 'kiosk', - } - - apsubmode = { - 0: 'N/A', - 1: 'none', - 2: 'wips', - 3: 'pppoe', - 4: 'pppoewips', - } - - # get parameters from wato - if params: - # do nothing if disabled via vato - if params.get('disable') is True: - return - # get list of columns to remove from inventory - removecolumns = params.get('removecolumns', removecolumns) - - def render_mac_address(bytestring): - return ':'.join(['%02s' % hex(ord(m))[2:] for m in bytestring]).replace(' ', '0').upper() - - def render_ip_address(bytestring): - return '.'.join(['%s' % ord(m) for m in bytestring]) - - node = inv_tree_list('networking.wlan.controller.accesspoints_lwap:') - - for ap in info: - - wlcprimaryaddress = ap[5] - if inet_address_type.get(int(ap[4])) == 'ipv4': - wlcprimaryaddress = render_ip_address(wlcprimaryaddress) - - wlcsecondaryaddress = ap[7] - if inet_address_type.get(int(ap[6])) == 'ipv4': - wlcsecondaryaddress = render_ip_address(wlcsecondaryaddress) - - wlctertiaryaddress = ap[9] - if inet_address_type.get(int(ap[8])) == 'ipv4': - wlctertiaryaddress = render_ip_address(wlctertiaryaddress) - - node.append({ - 'if_mac_address' : render_mac_address(ap[0]), - 'max_#_of_dot11_slots' : ap[1], - 'name' : ap[2], - 'max_#_of_ethernet_slots' : ap[3], - 'wlc_primary_address' : wlcprimaryaddress, - 'wlc_secondary_address' : wlcsecondaryaddress, - 'wlc_tertiary_address' : wlctertiaryaddress, - 'last_reboot_reason' : last_reboot_reason.get(int(ap[10])), - 'encryption' : enable_disable.get(int(ap[11])), - 'failover_priority' : failover_pirority.get(int(ap[12])), - 'power_status' : power_status.get(int(ap[13])), - 'telnet' : enable_disable.get(int(ap[14])), - 'ssh' : enable_disable.get(int(ap[15])), - 'pwr_pre_std_state' : enable_disable.get(int(ap[16])), - 'pwr_injector_state' : enable_disable.get(int(ap[17])), - 'pwr_injector_selection' : pwr_injector_selection.get(int(ap[18])), - 'pwr_injector_sw_mac_addr' : render_mac_address(ap[19]), - 'wips' : enable_disable.get(int(ap[20])), - 'monitor_mode_optimization' : monitor_mode_optimization.get(int(ap[18])), - 'amsdu' : enable_disable.get(int(ap[22])), - 'encryption_supported' : encryption_supported.get(int(ap[23])), - 'rogue_detection' : enable_disable.get(int(ap[24])), - 'tcp_mss' : ap[25], - 'data_encryption' : enable_disable.get(int(ap[26])), - 'admin' : enable_disable.get(int(ap[27])), - 'port_number' : ap[28], - 'venue_config_venue_group' : venueconfigvenuegroup.get(int(ap[29])), - 'venue_config_venue_type' : venueconfigvenuetype.get(int(ap[30])), - 'venue_config_venue_name' : ap[31], - 'venue_config_language' : ap[32], - 'led_state' : enable_disable.get(int(ap[33])), - 'trunk_vlan' : ap[34], - 'trunk_vlan_status' : enable_disable.get(int(ap[35])), - 'location' : ap[36], - 'submode' : apsubmode.get(int(ap[37])), - 'real_time_stats_mode_enabled' : enable_disable.get(int(ap[38])), - 'upgrade_from_version' : ap[39], - 'upgrade_to_version' : ap[40], - 'upgrade_failure_cause' : ap[41], - 'max_client_limit_number_trap' : ap[42], - 'max_client_limit_cause' : ap[43], - 'max_client_limit_set' : enable_disable.get(int(ap[44])), - 'floor_label' : ap[45], - 'adj_channel_rogue_enabled' : ap[46], - 'sys_net_id' : ap[47], - 'antenna_band_mode' : antenna_band_mode.get(int(ap[48])), - 'module_inserted' : ap[49], - 'enable_module' : enable_disable.get(int(ap[50])), - 'is_universal' : enable_disable.get(int(ap[51])), - 'universal_prime_status' : ap[52], - 'is_master' : enable_disable.get(int(ap[53])), - 'ble_fw_download_status' : enable_disable.get(int(ap[54])), - }) - - if removecolumns is not None: - for i in node: - for column in removecolumns: - if i.get(column) is not None: - i.pop(column) - - return node - -inv_info['inv_wlc_aps_lwap'] = { - 'inv_function' : inv_wlc_aps_lwap, - '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.513.1.1.1.1', [ # CISCO-LWAPP-AP-MIB::cLApEntry - '2', # cLApIfMacAddress (2) - '3', # cLApMaxNumberOfDot11Slots (3) - '5', # cLApName (5) - '9', # cLApMaxNumberOfEthernetSlots (9) - '10', # cLApPrimaryControllerAddressType (10) - '11', # cLApPrimaryControllerAddress (11) - '12', # cLApSecondaryControllerAddressType (12) - '13', # cLApSecondaryControllerAddress (13) - '14', # cLApTertiaryControllerAddressType (14) - '15', # cLApTertiaryControllerAddress (15) - '16', # cLApLastRebootReason (16) - '18', # cLApEncryptionEnable (18) - '19', # cLApFailoverPriority (19) - '20', # cLApPowerStatus (20) - '21', # cLApTelnetEnable (21) - '22', # cLApSshEnable (22) - '23', # cLApPreStdStateEnabled (23) - '24', # cLApPwrInjectorStateEnabled (24) - '25', # cLApPwrInjectorSelection (25) - '26', # cLApPwrInjectorSwMacAddr (26) - '27', # cLApWipsEnable (27) - '28', # cLApMonitorModeOptimization (28) - '32', # cLApAMSDUEnable (32) - '33', # cLApEncryptionSupported (33) - '34', # cLApRogueDetectionEnabled (34) - '35', # cLApTcpMss (35) - '36', # cLApDataEncryptionStatus (36) - '38', # cLApAdminStatus (38) - '39', # cLApPortNumber (39) - - '42', # cLApVenueConfigVenueGroup - '43', # cLApVenueConfigVenueType - '44', # cLApVenueConfigVenueName - '45', # cLApVenueConfigLanguage - '46', # cLApLEDState - '47', # cLApTrunkVlan - '48', # cLApTrunkVlanStatus - '49', # cLApLocation - '50', # cLApSubMode - '53', # cLApRealTimeStatsModeEnabled - '59', # cLApUpgradeFromVersion - '60', # cLApUpgradeToVersion - '61', # cLApUpgradeFailureCause - '62', # cLApMaxClientLimitNumberTrap - '63', # cLApMaxClientLimitCause - '64', # cLApMaxClientLimitSet - '65', # cLApFloorLabel - '69', # cLAdjChannelRogueEnabled - '74', # cLApSysNetId - '76', # cLApAntennaBandMode - '80', # cLApModuleInserted - '81', # cLApEnableModule - '82', # cLApIsUniversal - '83', # cLApUniversalPrimeStatus - '84', # cLApIsMaster - '85', # cLApBleFWDownloadStatus - ]), -}