diff --git a/agent_based/cisco_asyncos_cpu.py b/agent_based/cisco_asyncos_cpu.py new file mode 100644 index 0000000000000000000000000000000000000000..1ad56b159c62ddb4da7ef62b483c84f207c95c5f --- /dev/null +++ b/agent_based/cisco_asyncos_cpu.py @@ -0,0 +1,82 @@ +#!/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 : 2021-03-21 + +from typing import Mapping, Dict, List, Tuple, NamedTuple + +from .agent_based_api.v1.type_defs import ( + DiscoveryResult, + CheckResult, + StringTable, +) + +from .agent_based_api.v1 import ( + register, + Service, + equals, + Result, + check_levels, + State, + SNMPTree, + contains, + startswith, + all_of, + any_of, +) + + +# +# sample string_table +# [[['41']]] +# +def parse_cisco_asyncos_cpu(string_table: List[StringTable]) -> int: + try: + return int(string_table[0][0][0]) + except KeyError: + pass + + +def discovery_cisco_asyncos_cpu(section: int) -> DiscoveryResult: + yield Service() + + +def check_cisco_asyncos_cpu(params, section: int) -> CheckResult: + def render_percent(value) -> str: + return '%s%%' % value + + yield from check_levels( + section, + label='CPU utilization in the last minute', + levels_upper=params.get('util', None), + metric_name='util', # if params.get('output_metrics') else None, + render_func=render_percent, + ) + + +register.snmp_section( + name='cisco_asyncos_cpu', + parse_function=parse_cisco_asyncos_cpu, + fetch=[ + SNMPTree( + base='.1.3.6.1.4.1.15497.1.1.1', + oids=[ + '2' # ASYNCOS-MAIL-MIB::perCentCPUUtilization + ] + ), + ], + detect=contains('.1.3.6.1.2.1.1.1.0', 'AsyncOS'), +) + +register.check_plugin( + name='cisco_asyncos_cpu', + service_name='CPU Utilization 1 min', + discovery_function=discovery_cisco_asyncos_cpu, + check_function=check_cisco_asyncos_cpu, + check_default_parameters={}, + check_ruleset_name='cpu_utilization' +) diff --git a/agent_based/cisco_asyncos_mem.py b/agent_based/cisco_asyncos_mem.py new file mode 100644 index 0000000000000000000000000000000000000000..b4ddf2373032697114e5f1a9fa21c0d094e5fea8 --- /dev/null +++ b/agent_based/cisco_asyncos_mem.py @@ -0,0 +1,95 @@ +#!/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 : 2021-03-21 +# +# .1.3.6.1.4.1.15497.1.1.1.1.0 = INTEGER: 0 +# .1.3.6.1.4.1.15497.1.1.1.7.0 = INTEGER: 1 +# +# ASYNCOS-MAIL-MIB::perCentMemoryUtilization.0 = INTEGER: 0 +# ASYNCOS-MAIL-MIB::memoryAvailabilityStatus.0 = INTEGER: memoryAvailable(1) +# +# sample info +# [[u'0', u'1']] +# + +from typing import Mapping, Dict, List, Tuple, NamedTuple + +from .agent_based_api.v1.type_defs import ( + DiscoveryResult, + CheckResult, + StringTable, +) + +from .agent_based_api.v1 import ( + register, + Service, + equals, + Result, + check_levels, + State, + SNMPTree, + contains, + startswith, + all_of, + any_of, +) + + +# factory_settings['cisco_asyncos_mem_default_levels'] = { +# 'levels':(80.0, 90.0), +# } + +# +# [[['48']] +# +def parse_cisco_asyncos_mem(string_table: List[StringTable]) -> int: + try: + return int(string_table[0][0][0]) + except KeyError: + pass + + +def discovery_cisco_asyncos_mem(section: int) -> DiscoveryResult: + yield Service() + + +def check_cisco_asyncos_mem(params, section: int) -> CheckResult: + def render_percent(value) -> str: + return '%s%%' % value + + yield from check_levels( + section, + label='Memory utilization', + levels_upper=params.get('util', None), + metric_name='util', # if params.get('output_metrics') else None, + render_func=render_percent, + ) + + +register.snmp_section( + name='cisco_asyncos_mem', + parse_function=parse_cisco_asyncos_mem, + fetch=[ + SNMPTree( + base='.1.3.6.1.4.1.15497.1.1.1', + oids=[ + '1', # perCentMemoryUtilization + ] + ), + ], + detect=contains('.1.3.6.1.2.1.1.1.0', 'AsyncOS'), +) + +register.check_plugin( + name='cisco_asyncos_mem', + service_name='Memory utilization', + discovery_function=discovery_cisco_asyncos_mem, + check_function=check_cisco_asyncos_mem, + check_default_parameters={}, + check_ruleset_name='memory' +) diff --git a/agent_based/cisco_asyncos_temp.py b/agent_based/cisco_asyncos_temp.py new file mode 100644 index 0000000000000000000000000000000000000000..2b26886dbfde085d1d5c3b6b615681a58410be9e --- /dev/null +++ b/agent_based/cisco_asyncos_temp.py @@ -0,0 +1,107 @@ +#!/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 : 2020-02-10 +# +# monitors status Cisco IronPort Appliances (ESA/SMA/WSA) temperature sensors +# Tested with: C380, M380, C370, M670, S370 +# +# 2021-03-21: rewrite for CMK 2.0 +# +# sample snmpwalk +# .1.3.6.1.4.1.15497.1.1.1.9.1.1.1 = INTEGER: 1 +# .1.3.6.1.4.1.15497.1.1.1.9.1.2.1 = INTEGER: 22 +# .1.3.6.1.4.1.15497.1.1.1.9.1.3.1 = STRING: Ambient +# +# ASYNCOS-MAIL-MIB::temperatureIndex.1 = INTEGER: 1 +# ASYNCOS-MAIL-MIB::degreesCelsius.1 = INTEGER: 22 +# ASYNCOS-MAIL-MIB::temperatureName.1 = STRING: Ambient +# + +from typing import Mapping, Dict, List, Tuple, NamedTuple + +from .agent_based_api.v1.type_defs import ( + DiscoveryResult, + CheckResult, + StringTable, +) + +from .agent_based_api.v1 import ( + register, + Service, + equals, + Result, + check_levels, + State, + SNMPTree, + contains, + startswith, + all_of, + any_of, +) + +from .utils.temperature import ( + check_temperature, + TempParamType, + to_celsius, +) + + +# +# [[['22', 'FP_TEMP_SENSOR']]] +# +def parse_cisco_asyncos_temp(string_table: List[StringTable]) -> dict: + sensors = {} + for sensor in string_table[0]: + try: + value, item = sensor + item = item.replace('_', ' ') + sensors.update({item: int(value)}) + except (ValueError, IndexError): + pass + return sensors + + +def discovery_cisco_asyncos_temp(section: Dict) -> DiscoveryResult: + for key in section.keys(): + yield Service(item=key) + + +def check_cisco_asyncos_temp(item, params: TempParamType, section) -> CheckResult: + try: + yield from check_temperature( + section[item], + params=params, + unique_name='check_cisco_asyncos_temp.%s' % item, + ) + except KeyError: + pass + + +register.snmp_section( + name='cisco_asyncos_temp', + parse_function=parse_cisco_asyncos_temp, + fetch=[ + SNMPTree( + base='.1.3.6.1.4.1.15497.1.1.1.9.1', # ASYNCOS-MAIL-MIB::temperatureEntry + oids=[ + '2', # degreesCelsius + '3', # temperatureName + ] + ), + ], + detect=contains('.1.3.6.1.2.1.1.1.0', 'AsyncOS'), +) + +register.check_plugin( + name='cisco_asyncos_temp', + service_name='Temperature %s', + discovery_function=discovery_cisco_asyncos_temp, + check_function=check_cisco_asyncos_temp, + check_default_parameters={}, + check_ruleset_name='temperature' +) diff --git a/checks/cisco_asyncos_cpu b/checks/cisco_asyncos_cpu deleted file mode 100644 index 1beb308237daa18515a7ed2b753f0d559883378f..0000000000000000000000000000000000000000 --- a/checks/cisco_asyncos_cpu +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/python -# -*- encoding: utf-8; py-indent-offset: 4 -*- -# +------------------------------------------------------------------+ -# | ____ _ _ __ __ _ __ | -# | / ___| |__ ___ ___| | __ | \/ | |/ / | -# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | -# | | |___| | | | __/ (__| < | | | | . \ | -# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | -# | | -# | Copyright Mathias Kettner 2013 mk@mathias-kettner.de | -# +------------------------------------------------------------------+ -# -# This file is part of Check_MK. -# The official homepage is at http://mathias-kettner.de/check_mk. -# -# check_mk is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation in version 2. check_mk is distributed -# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- -# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public License for more de- -# ails. You should have received a copy of the GNU General Public -# License along with GNU Make; see the file COPYING. If not, write -# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, -# Boston, MA 02110-1301 USA. - - -cisco_asyncos_cpu_default_levels = (80.0, 90.0) - - -def inventory_cisco_asyncos_cpu(info): - if len(info) > 0: - return [(None, 'cisco_asyncos_cpu_default_levels')] - - -def check_cisco_asyncos_cpu(_no_item, params, info): - warn, crit = params - util = float(info[0][0]) - perfdata=[('util', util, warn, crit, 0, 100)] - infotext = '%2.1f%% utilization in the last minute' % util - if util >= crit: - return 2, infotext + ' (critical at %d%%)' % crit, perfdata - elif util >= warn: - return 1, infotext + ' (warning at %d%%)' % warn, perfdata - else: - return 0, infotext, perfdata - - -check_info['cisco_asyncos_cpu'] = { - 'check_function': check_cisco_asyncos_cpu, - 'inventory_function': inventory_cisco_asyncos_cpu, - 'service_description': 'CPU Utilization', - 'has_perfdata': True, - 'group': 'cpu_utilization', - 'snmp_info': ('.1.3.6.1.4.1.15497.1.1.1', ['2']), # ASYNCOS-MAIL-MIB::perCentCPUUtilization - 'snmp_scan_function': scan_cisco_asyncos, - 'includes': ['cisco_asyncos.include'], -} diff --git a/checks/cisco_asyncos_dns b/checks/cisco_asyncos_dns index 4d651166db1cf3f918cc11e2bc11a75372c70159..a98e20d84a223527bec9a70f414911dad5abd6e9 100644 --- a/checks/cisco_asyncos_dns +++ b/checks/cisco_asyncos_dns @@ -66,7 +66,8 @@ check_info['cisco_asyncos_dns'] = { '15', # outstandingDNSRequests '16', # pendingDNSRequests ]), - 'snmp_scan_function': scan_cisco_asyncos, - 'includes': ['cisco_asyncos.include'], + 'snmp_scan_function': lambda oid: oid('.1.3.6.1.2.1.1.1.0').find('AsyncOS') != -1, + # 'snmp_scan_function': scan_cisco_asyncos, + # 'includes': ['cisco_asyncos.include'], 'default_levels_variable': 'cisco_asyncos_dns_default_levels', } diff --git a/checks/cisco_asyncos_fan b/checks/cisco_asyncos_fan index 7109cc55e8d3f13225ad1042cf7db4985c0e1dfc..6c3291981a839043200cebf2970d6c43d440be2a 100644 --- a/checks/cisco_asyncos_fan +++ b/checks/cisco_asyncos_fan @@ -90,7 +90,9 @@ check_info['cisco_asyncos_fan'] = { '2', # fanRPMs '3', # fanName ]), - 'snmp_scan_function': scan_cisco_asyncos, - 'includes': ['cisco_asyncos.include', 'fan.include'], 'default_levels_variable': 'cisco_asyncos_fan_default_levels', + 'snmp_scan_function': lambda oid: oid('.1.3.6.1.2.1.1.1.0').find('AsyncOS') != -1, + # 'snmp_scan_function': scan_cisco_asyncos, + # 'includes': ['cisco_asyncos.include', 'fan.include'], + # 'includes': ['fan.include'], } diff --git a/checks/cisco_asyncos_license b/checks/cisco_asyncos_license index 789ddd0921acf8d84428bac1eca9dff0b613870b..f950eb918f47f3487e2a0222de2f43690c1a24cf 100644 --- a/checks/cisco_asyncos_license +++ b/checks/cisco_asyncos_license @@ -190,8 +190,9 @@ check_info['cisco_asyncos_license'] = { '3', # keyIsPerpetual '4', # keySecondsUntilExpire ]), - 'snmp_scan_function': scan_cisco_asyncos, - 'default_levels_variable': 'cisco_asyncos_license_default_levels', + 'snmp_scan_function': lambda oid: oid('.1.3.6.1.2.1.1.1.0').find('AsyncOS') != -1, + # 'snmp_scan_function': scan_cisco_asyncos, + # 'default_levels_variable': 'cisco_asyncos_license_default_levels', 'includes': ['cisco_asyncos.include'], } diff --git a/checks/cisco_asyncos_mem b/checks/cisco_asyncos_mem deleted file mode 100644 index 7efdd67c4893c2a4c96d881c1edcb5f9c280911d..0000000000000000000000000000000000000000 --- a/checks/cisco_asyncos_mem +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/python -# -*- encoding: utf-8; py-indent-offset: 4 -*- -# -# original check by Andreas Doehler, rewritten by thl-cmk[at]outlook.com -# date: 09.03.2020 -# -# added oid for memoryAvailabilityStatus, added mitrics (Graph, Perf-O-Meter) -# -# -# check_mk is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation in version 2. check_mk is distributed -# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- -# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public License for more de- -# ails. You should have received a copy of the GNU General Public -# License along with GNU Make; see the file COPYING. If not, write -# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, -# Boston, MA 02110-1301 USA. -# -# .1.3.6.1.4.1.15497.1.1.1.1.0 = INTEGER: 0 -# .1.3.6.1.4.1.15497.1.1.1.7.0 = INTEGER: 1 -# -# ASYNCOS-MAIL-MIB::perCentMemoryUtilization.0 = INTEGER: 0 -# ASYNCOS-MAIL-MIB::memoryAvailabilityStatus.0 = INTEGER: memoryAvailable(1) -# -# sample info -# [[u'0', u'1']] -# - - -factory_settings['cisco_asyncos_mem_default_levels'] = { - 'levels':(80.0, 90.0), - } - - -def inventory_cisco_asyncos_mem(info): - if len(info) > 0: - return [(None, None)] - - -def check_cisco_asyncos_mem(_no_item, params, info): - if 'levels' in params: - warn, crit = params['levels'] - else: - warn, crit = params - - perc_used, memoryStatus = info[0] - perc_used = float(perc_used) - - perfdata=[('mem_used', perc_used, warn, crit, 0, 100)] - infotext = '%2.1f%% Memory usage' % perc_used - if perc_used >= crit: - yield 2, infotext + ' (critical at %d%%)' % crit, perfdata - elif perc_used >= warn: - yield 1, infotext + ' (warning at %d%%)' % warn, perfdata - else: - yield 0, infotext, perfdata - - if memoryStatus.isdigit(): - memoryStatus = int(memoryStatus) - if memoryStatus == 1: - yield 0, 'Memory: available' - elif memoryStatus == 2: - yield 2, 'Memory: shortage' - elif memoryStatus == 3: - yield 1, 'Memory: full' - - -check_info['cisco_asyncos_mem'] = { - 'check_function': check_cisco_asyncos_mem, - 'inventory_function': inventory_cisco_asyncos_mem, - 'service_description': 'Memory Usage', - 'has_perfdata': True, - 'group': 'memory', - 'snmp_info': ('.1.3.6.1.4.1.15497.1.1.1', [ # ASYNCOS-MAIL-MIB - '1', # perCentMemoryUtilization - '7', # memoryAvailabilityStatus - ]), - 'snmp_scan_function': scan_cisco_asyncos, - 'includes': ['cisco_asyncos.include'], - 'default_levels_variable': 'cisco_asyncos_mem_default_levels', -} \ No newline at end of file diff --git a/checks/cisco_asyncos_messageage b/checks/cisco_asyncos_messageage index c2b3fc5a9580a6b66fd08fb590cda38bc7e412e3..b1e3ee5ebf64dd2dae51b5875a933eb0ef8886e4 100644 --- a/checks/cisco_asyncos_messageage +++ b/checks/cisco_asyncos_messageage @@ -71,7 +71,8 @@ check_info['cisco_asyncos_messageage'] = { [ '14', # oldestMessageAge ]), - 'snmp_scan_function': scan_cisco_asyncos, - 'includes': ['cisco_asyncos.include'], 'default_levels_variable': 'cisco_asyncos_messageage_default_levels', + 'snmp_scan_function': lambda oid: oid('.1.3.6.1.2.1.1.1.0').find('AsyncOS') != -1, + # 'snmp_scan_function': scan_cisco_asyncos, + # 'includes': ['cisco_asyncos.include'], } diff --git a/checks/cisco_asyncos_power b/checks/cisco_asyncos_power index b89ad0030e122e0662e9a9d19b92931d51d4ee33..fe9aa178a8cc126f2fce2be92f7df1c41edfc1d2 100644 --- a/checks/cisco_asyncos_power +++ b/checks/cisco_asyncos_power @@ -97,6 +97,7 @@ check_info['cisco_asyncos_power'] = { '3', # powerSupplyRedundancy '4', # powerSupplyName ]), - 'snmp_scan_function': scan_cisco_asyncos, - 'includes': ['cisco_asyncos.include'], + 'snmp_scan_function': lambda oid: oid('.1.3.6.1.2.1.1.1.0').find('AsyncOS') != -1, + # 'snmp_scan_function': scan_cisco_asyncos, + # 'includes': ['cisco_asyncos.include'], } \ No newline at end of file diff --git a/checks/cisco_asyncos_queue b/checks/cisco_asyncos_queue index 582e574ba861fac85e53e9f21d63725a18667149..4330b2ee4a20151e49cca9366128a901356e15f0 100644 --- a/checks/cisco_asyncos_queue +++ b/checks/cisco_asyncos_queue @@ -78,8 +78,9 @@ check_info['cisco_asyncos_queue'] = { '11' # workQueueMessages ] ), - 'snmp_scan_function': scan_cisco_asyncos, - 'includes': ['cisco_asyncos.include'], + 'snmp_scan_function': lambda oid: oid('.1.3.6.1.2.1.1.1.0').find('AsyncOS') != -1, 'default_levels_variable': 'cisco_asyncos_queue_default_levels', + # 'snmp_scan_function': scan_cisco_asyncos, + # 'includes': ['cisco_asyncos.include'], } diff --git a/checks/cisco_asyncos_raid b/checks/cisco_asyncos_raid index 12bd8311270ee96b2c7f8d1c8ff7d1e34b79e2d6..ef9e921487b6375046d7bf07be866f5ec024cbb2 100644 --- a/checks/cisco_asyncos_raid +++ b/checks/cisco_asyncos_raid @@ -93,6 +93,7 @@ check_info['cisco_asyncos_raid'] = { '3', # raidID '4', # raidLastError ]), - 'snmp_scan_function': scan_cisco_asyncos, - 'includes': ['cisco_asyncos.include'], + 'snmp_scan_function': lambda oid: oid('.1.3.6.1.2.1.1.1.0').find('AsyncOS') != -1, + # 'snmp_scan_function': scan_cisco_asyncos, + # 'includes': ['cisco_asyncos.include'], } \ No newline at end of file diff --git a/checks/cisco_asyncos_resources b/checks/cisco_asyncos_resources index 2915a744ec48b33bdedacf3f429b54fb7cd9a35f..761a5bbfc8b1b37d01bcead341875183602632c0 100644 --- a/checks/cisco_asyncos_resources +++ b/checks/cisco_asyncos_resources @@ -57,6 +57,7 @@ check_info['cisco_asyncos_resources'] = { [ '6', # resourceConservationReason ]), - 'snmp_scan_function': scan_cisco_asyncos, - 'includes': ['cisco_asyncos.include'], + 'snmp_scan_function': lambda oid: oid('.1.3.6.1.2.1.1.1.0').find('AsyncOS') != -1, + # 'snmp_scan_function': scan_cisco_asyncos, + # 'includes': ['cisco_asyncos.include'], } diff --git a/checks/cisco_asyncos_temp b/checks/cisco_asyncos_temp deleted file mode 100644 index ac21c20c809fc2743759839a64e0896d181f2992..0000000000000000000000000000000000000000 --- a/checks/cisco_asyncos_temp +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/python -# -*- encoding: utf-8; py-indent-offset: 4 -*- -# -# Author: Th.L. -# Date: 10-02-2020 -# -# monitors status Cisco IronPort Appliances (ESA/SMA/WSA) temperature sensors -# Tested with: C380, M380, C370, M670, S370 -# -# -# based on original Check_MK temp checks (fireeye) -# -# check_mk is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation in version 2. check_mk is distributed -# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- -# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public License for more de- -# ails. You should have received a copy of the GNU General Public -# License along with GNU Make; see the file COPYING. If not, write -# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, -# Boston, MA 02110-1301 USA. -# -# OMD[cmk16x]:~/local/share/check_mk/checks$ snmpwalk -v2c -c C370-MAIL localhost -ObentU -m ASYNCOS-MAIL-MIB temperatureTable -# .1.3.6.1.4.1.15497.1.1.1.9.1.1.1 = INTEGER: 1 -# .1.3.6.1.4.1.15497.1.1.1.9.1.2.1 = INTEGER: 22 -# .1.3.6.1.4.1.15497.1.1.1.9.1.3.1 = STRING: Ambient -# -# OMD[cmk16x]:~/local/share/check_mk/checks$ snmpwalk -v2c -c C370-MAIL localhost -m ASYNCOS-MAIL-MIB temperatureTable -# ASYNCOS-MAIL-MIB::temperatureIndex.1 = INTEGER: 1 -# ASYNCOS-MAIL-MIB::degreesCelsius.1 = INTEGER: 22 -# ASYNCOS-MAIL-MIB::temperatureName.1 = STRING: Ambient -# - -factory_settings['cisco_asyncos_temp_default_levels'] = {'levels_lower': (0.0, -10.0), - 'levels': (60, 80), - 'output_unit': 'c', - 'device_levels_handling': 'usr', - } - -def inventory_cisco_asyncos_temp(info): - if info: - for line in info: - celsius, name = line - item = name - yield item, {} - - -def check_cisco_asyncos_temp(item, params, info): - if info: - for line in info: - reading_str, name = line - if item == name: - yield check_temperature(float(reading_str), - params, - 'cisco_asyncos_temp_%s' % name, - ) - - -check_info['cisco_asyncos_temp'] = { - 'inventory_function': inventory_cisco_asyncos_temp, - 'check_function': check_cisco_asyncos_temp, - 'service_description': 'Temperature %s', - 'has_perfdata': True, - 'snmp_info': ( - '.1.3.6.1.4.1.15497.1.1.1.9.1', # ASYNCOS-MAIL-MIB::temperatureEntry - [ - '2', # degreesCelsius - '3', # temperatureName - ]), - 'snmp_scan_function': scan_cisco_asyncos, - 'group': 'temperature', - 'default_levels_variable': 'cisco_asyncos_temp_default_levels', - 'includes': ['temperature.include', 'cisco_asyncos.include'], -} diff --git a/checks/cisco_asyncos_update b/checks/cisco_asyncos_update index 5c597db8e68f1f6ef17b51c706eed987ac9a1cb2..333795a342f68678e72603e9970abf71a9c2c4cf 100644 --- a/checks/cisco_asyncos_update +++ b/checks/cisco_asyncos_update @@ -251,8 +251,9 @@ check_info['cisco_asyncos_update'] = { '3', # updates --> The number of successful attempts that have occurred when updating a service '4', # updateFailures --> "The number of failed attempts that have occurred when updating a service ]), - 'snmp_scan_function': scan_cisco_asyncos, 'default_levels_variable': 'cisco_asyncos_update_default_levels', - 'includes': ['cisco_asyncos.include'], + 'snmp_scan_function': lambda oid: oid('.1.3.6.1.2.1.1.1.0').find('AsyncOS') != -1, + # 'snmp_scan_function': scan_cisco_asyncos, + # 'includes': ['cisco_asyncos.include'], } diff --git a/cisco_asyncos.mkp b/cisco_asyncos.mkp index 75863cc0dbe251e94846b745d23683252e7f5917..0587cbb03450684d01757b1a334ebf94537a97dd 100644 Binary files a/cisco_asyncos.mkp and b/cisco_asyncos.mkp differ diff --git a/packages/cisco_asyncos b/packages/cisco_asyncos index c62480ee48945ecfacda7b8a55195a7fd142c1c6..ceae4b30b3db0b2f78b2a5bd67649e77f61e2e74 100644 --- a/packages/cisco_asyncos +++ b/packages/cisco_asyncos @@ -1,17 +1,37 @@ -{'author': u'Th.L. (thl-cmk[at]outlook[dot]com)', - 'description': u'Cisco AsyncOS (IronPort) checks\n\n- fixed inventory function\n- changed scan function, to look for "AsyncOS"\n- cisco_asyncos_queue: added wato\n\n- cisco_asyncos_fan, cisco_asyncos_power, cisco_asyncos_raid, cisco_asyncos_license, cisco_asyncos_update and cisco_asyncos_temp rewriten by Th.L. all other checks by A.Doehler\n\n- cisco_asyncos_fan uses fan.include\n- cisco_asyncos_temp uses temperature.include\n\n- 2020-03-08: added cisco_asyncos_dns, cisco_asyncos_resources, cisco_asyncos_messageage\n- 2020-05-14: added wato option to cisco_asyncos_update to ignore features\n', +{'author': 'Th.L. (thl-cmk[at]outlook[dot]com)', + 'description': 'Cisco AsyncOS (IronPort) checks\n' + '\n' + '- fixed inventory function\n' + '- changed scan function, to look for "AsyncOS"\n' + '- cisco_asyncos_queue: added wato\n' + '\n' + '- cisco_asyncos_fan, cisco_asyncos_power, cisco_asyncos_raid, ' + 'cisco_asyncos_license, cisco_asyncos_update and ' + 'cisco_asyncos_temp rewriten by Th.L. all other checks by ' + 'A.Doehler\n' + '\n' + '- cisco_asyncos_fan uses fan.include\n' + '- cisco_asyncos_temp uses temperature.include\n' + '\n' + '- 2020-03-08: added cisco_asyncos_dns, ' + 'cisco_asyncos_resources, cisco_asyncos_messageage\n' + '- 2020-05-14: added wato option to cisco_asyncos_update to ' + 'ignore features\n' + '\n' + '- 2021-03-21: rewrite cisco_asyncos_cpu, cisco_asyncos_mem, ' + 'cisco_asyncos_temp for CMK 2.0\n', 'download_url': 'https://thl-cmk.hopto.org', - 'files': {'checks': ['cisco_asyncos_bandwidth', + 'files': {'agent_based': ['cisco_asyncos_cpu.py', + 'cisco_asyncos_mem.py', + 'cisco_asyncos_temp.py'], + 'checks': ['cisco_asyncos_bandwidth', 'cisco_asyncos_cache', 'cisco_asyncos_conn', - 'cisco_asyncos_cpu', 'cisco_asyncos_fan', 'cisco_asyncos_license', - 'cisco_asyncos_mem', 'cisco_asyncos_power', 'cisco_asyncos_queue', 'cisco_asyncos_raid', - 'cisco_asyncos_temp', 'cisco_asyncos_update', 'cisco_asyncos.include', 'cisco_asyncos_dns', @@ -23,7 +43,8 @@ 'plugins/metrics/cisco_asyncos.py']}, 'name': 'cisco_asyncos', 'num_files': 20, - 'title': u'Cisco AsyncOS (IronPort) checks', + 'title': 'Cisco AsyncOS (IronPort) checks', 'version': '20200514_v0.1.4', - 'version.min_required': '1.6.0p6', - 'version.packaged': '1.6.0p8'} \ No newline at end of file + 'version.min_required': '2.0.0', + 'version.packaged': '2.0.0p1', + 'version.usable_until': None} \ No newline at end of file