diff --git a/checks/cisco_asa_temp b/checks/cisco_asa_temp index 0db03adc07e50c42c27b82199685c24e90b69ea9..a01ef03fb4874c8bc2d8263c7f1b7a1168bf574c 100644 --- a/checks/cisco_asa_temp +++ b/checks/cisco_asa_temp @@ -11,52 +11,44 @@ # 03.05.2018: fixed inventory for empty sensorname (asa context) # # warn, crit, minimum temp value -cisco_asa_temp_default_levels = (60, 70, 20) +factory_settings['cisco_asa_temp_default_levels'] = {'levels_lower': (0.0, -10.0), + 'levels': (60, 80), + 'output_unit': 'c', + 'device_levels_handling': 'usr', + } + def inventory_cisco_asa_temp(info): for sensorname, sensortype, sensorvalue, sensorstatus, sensorunits in info: if sensortype == '8' and sensorstatus == '1' and sensorname != '': - yield sensorname, cisco_asa_temp_default_levels + yield sensorname, None def check_cisco_asa_temp(item, params, info): - warn, crit, minimum = params - infotext = 'item not found(!!)' - state = 3 - params = [] for sensorname, sensortype, sensorvalue, sensorstatus, sensorunits in info: if sensorname == item and sensortype == '8': - sensorvalue = int(sensorvalue) - infotext = u'%d \xB0C' % (sensorvalue) - perfdata = [('temp', sensorvalue, warn, crit)] - - if sensorvalue >= crit: - infotext += u' (>=%d \xB0C)(!!)' % crit - return 2, infotext, perfdata - elif sensorvalue >= warn: - infotext += u' (>=%d \xB0C)(!)' % warn - return 1, infotext, perfdata - elif sensorvalue < minimum: - infotext += u' (<%d \xB0C)(!!)' % minimum - return 2, infotext, perfdata - else: - return 0, infotext, perfdata + yield check_temperature(reading=float(sensorvalue), + params=params, + unique_name='cisco_asa_temp_%s' % sensorname, + # dev_status=int(sensorstatus) + ) - return tate, infotext, perfdata check_info['cisco_asa_temp'] = { - 'check_function' : check_cisco_asa_temp, - 'inventory_function' : inventory_cisco_asa_temp, - 'service_description': 'Environment: %s', - 'has_perfdata' : True, - 'group' : 'cisco_asa_temp', - 'snmp_scan_function' : lambda oid: oid('.1.3.6.1.2.1.1.1.0').lower().startswith('cisco adaptive security appliance'), - 'snmp_info' : ( '.1.3.6.1.2.1', [ - '47.1.1.1.1.7', #ENTITY-MIB::entPhysicalName - '99.1.1.1.1', #ENTITY-SENSOR-MIB::entPhySensorType - '99.1.1.1.4', #ENTITY-SENSOR-MIB::entPhySensorValue - '99.1.1.1.5', #ENTITY-SENSOR-MIB::entPhySensorOperStatus - '99.1.1.1.6', #ENTITY-SENSOR-MIB::entPhySensorUnitsDisplay - ] ), + 'check_function' : check_cisco_asa_temp, + 'inventory_function' : inventory_cisco_asa_temp, + 'service_description' : 'Temperature %s', + 'has_perfdata' : True, + 'group' : 'temperature', + 'default_levels_variable' : 'cisco_asa_temp_default_levels', + 'snmp_scan_function' : lambda oid: oid('.1.3.6.1.2.1.1.1.0').lower().startswith('cisco adaptive security appliance'), + 'snmp_info' : ('.1.3.6.1.2.1', [ + '47.1.1.1.1.7', #ENTITY-MIB::entPhysicalName + '99.1.1.1.1', #ENTITY-SENSOR-MIB::entPhySensorType + '99.1.1.1.4', #ENTITY-SENSOR-MIB::entPhySensorValue + '99.1.1.1.5', #ENTITY-SENSOR-MIB::entPhySensorOperStatus + '99.1.1.1.6', #ENTITY-SENSOR-MIB::entPhySensorUnitsDisplay + ]), + 'includes': ['temperature.include'], } diff --git a/cisco_asa_temp.mkp b/cisco_asa_temp.mkp index 525082c24d8f3707900dfb284a3229101d821156..cdbe298b4040c185e9ad63e2c007cf0f65edb85b 100644 Binary files a/cisco_asa_temp.mkp and b/cisco_asa_temp.mkp differ diff --git a/packages/cisco_asa_temp b/packages/cisco_asa_temp index 327fda1f845703abc65f933717a3273fca45738f..1b92271888a050b9cc722c5351cacf311e4cf0a5 100644 --- a/packages/cisco_asa_temp +++ b/packages/cisco_asa_temp @@ -1,14 +1,10 @@ -{'author': 'Th.L. (thl-cmk[at]outlook[dot]com)', - 'description': 'Monitors Cisco ASA Temperatur sensors\nMinimum/Warning/Critical temperature level can be configured via wato', +{'author': u'Th.L. (thl-cmk[at]outlook[dot]com)', + 'description': u'Monitors Cisco ASA Temperatur sensors\n\nRewrite for CMK 1.6x to include "temperature.include"\n\nNOTE: changed item from Environment: <Sensorname> to Temperature <Sensorname>\n', 'download_url': 'https://thl-cmk.hopto.org', - 'files': {'checkman': ['cisco_asa_temp'], - 'checks': ['cisco_asa_temp'], - 'pnp-templates': [], - 'web': ['plugins/wato/cisco_asa_temp.py', - 'plugins/metrics/cisco_asa_temp.py']}, + 'files': {'checkman': ['cisco_asa_temp'], 'checks': ['cisco_asa_temp']}, 'name': 'cisco_asa_temp', - 'num_files': 4, - 'title': 'monitor Cisco ASA temperature sensors', - 'version': '20180503.v03a', - 'version.min_required': '1.2.6p12', + 'num_files': 2, + 'title': u'monitor Cisco ASA temperature sensors', + 'version': '20200224.v04', + 'version.min_required': '1.6.0', 'version.packaged': '1.6.0p8'} \ No newline at end of file