Collection of CheckMK checks (see https://checkmk.com/). All checks and plugins are provided as is. Absolutely no warranty. Send any comments to thl-cmk[at]outlook[dot]com

Skip to content
Snippets Groups Projects
Commit 8b64541a authored by thl-cmk's avatar thl-cmk :flag_na:
Browse files

cleanup

parents
No related branches found
No related tags found
No related merge requests found
# Cisco ASA temperature
Monitors status of Cisco ASA temperature sensors
Check Info:
* *service*: this check will create one service per temperature sensor
* *state*: **critical**/**warning** if temperature outside the configured levels
* *wato*: you can configure the warn/crit level for the temperature and also an minimum temperature
* *perfdata*: temperature in degrees Celsius
Testetd with: ASA 5512-X, 5515-X, 5555-X, 5585-X, 5506-X
Sample output
![sample output](/doc/sample.png?raw=true "sample [SHORT TITLE]")
title: Cisco ASA: temperatur sensors
agents: snmp
author: Th.L.
catalog: hw/network/cisco
license: GPLv3
distribution: unkown
description:
The Cisco "Adaptive Security Appliances" (ASA) has some temperatur sensors.
This check allows to monitor this Sensors. Default levels are 60°/70° celsius
for warning/critical.
The check uses the entPhySensorEntry from the ENTITY-SENSOR-MIB (1.3.6.1.2.1.99.1.1.1).
The check is tested against ASA-5506W devices.
perfdata:
Temperatur
item:
One item per temperatur sensor is generated.
inventory:
The check detects ASA temperatur sensors and saves them.
parameters:
Warning/Critical levels. Default is 60°/70° celsius.
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# created by Th.L.:
# Monitors Cisco ASA temperatur sensors
# works with Cisco ASA 55xx-X and later
# tested with 5506W and 5512-X, 5585-SSP20
# 24.03.2016: changed "47.1.1.1.1.2" PhysDescription to "47.1.1.1.1.7" entPhysicalName (duplicate descr. with ASA5585)
# 02.07.2016: fixed crit/warn to >=
# 09.01.2018: minimum temp value added
# 03.05.2018: fixed inventory for empty sensorname (asa context)
#
# warn, crit, minimum temp value
cisco_asa_temp_default_levels = (60, 70, 20)
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
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
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
] ),
}
File added
doc/sample.png

31.2 KiB

{'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',
'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']},
'name': 'cisco_asa_temp',
'num_files': 4,
'title': 'monitor Cisco ASA temperature sensors',
'version': '20180503.v03a',
'version.min_required': '1.2.6p12',
'version.packaged': '1.4.0p35'}
\ No newline at end of file
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# Cisco ASa fan sensor metrics plugin
#
# Author: Th.L.
# Date : 2018-01-09
#
# replaces: pnp-templates/check_mk-cisco_asa_temp.php
# web/plugins/perfometer/cisco_asa_temp.py
#
# missing a way to include hostname and service description
#
# key a green 11/a 21/a 31/a 41/a 12/a 22/a 32/a 42/a
colors_a = ['#80F000', '#a500ff', '#ffc600', '#00ffb2', '#0075ff', '#cc00ff', '#ffd600', '#00ffff', '#0047ff',
# 13/a 23/a 33/a 43/a 14/a 24/a 34/a 44/a 15/a
'#f900ff', '#ffed00', '#00e8ff', '#000aff', '#ff4c00', '#e2ff00', '#00d1ff', '#4200ff', '#ff7a00',
# 25/a 35/a 45/a 16/a 26/a 36/a 46/a 51/a 52/a
'#bcff00', '#00b2ff', '#6000ff', '#ffa000', '#7fff00', '#0093ff', '#7f00ff', '#7f7f7f', '#7f4a26',
# 53/a
'#8c531c']
# key b green 21/b 31/b 41/b 12/b 22/b 32/b 42/b 13/b
colors_b = ['#80F000', '#c966ff', '#cc9f00', '#00cc8e', '#66acff', '#e066ff', '#ccab00', '#00cccc', '#6690ff',
# 23/b 33/b 43/b 14/b 24/b 34/b 44/b 15/b 25/b
'#fb66ff', '#ccbd00', '#00b9cc', '#666cff', '#ff9366', '#b5cc00', '#00a7cc', '#8d66ff', '#ffaf66',
# 35/b 45/b 16/b 26/b 36/b 46/b 51/b 52/b 53/b
'#96cc00', '#008ecc', '#a066ff', '#ffc666', '#66cc00', '#0076cc', '#b266ff', '#7f7f7f', '#7f5f49',
'#8c6a48']
#####################################################################################################################
#
# define units for cisco_asa_temp perfdata
#
#####################################################################################################################
#####################################################################################################################
#
# define metrics for cisco_asa_temp perfdata
#
#####################################################################################################################
metric_info['cisco_asa_temp_temp'] = {
'title': _('Temperature'),
'unit': 'c',
'color': colors_a[0],
}
######################################################################################################################
#
# map cisco_asa_temp perfdata to metric, not really necessary but makes sure to use the right metrics
#
######################################################################################################################
check_metrics['check_mk-cisco_asa_temp'] = {
'temp': {'name': 'cisco_asa_temp_temp', },
}
######################################################################################################################
#
# how to graph perdata for cisco_asa_temp
#
######################################################################################################################
graph_info.append({
'title': _('Temperature'),
'metrics': [
('cisco_asa_temp_temp', 'line'),
],
'range': (0, 100),
'scalars': [
('cisco_asa_temp_temp:crit', _('crit level')),
('cisco_asa_temp_temp:warn', _('warn level')),
],
})
######################################################################################################################
#
# define perf-o-meter for cisco_asa_temp Temperature
#
######################################################################################################################
perfometer_info.append({
'type': 'linear',
'segments': ['cisco_asa_temp_temp'],
'total': 100,
})
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# Author : Th.L.
# Content: wato plugin for snmp check "cisco_asa_temp"
# to configure waring/critical levels
#
#
register_check_parameters(
subgroup_environment,
"cisco_asa_temp",
_("Cisco ASA temperatur sensor"),
Tuple(
title = _("Cisco ASA temperatur sensor thresholds"),
elements = [
Integer(title = _("warning at"), unit = _("° celsius"), default_value = 60 ),
Integer(title = _("critical at"), unit = _("° celsius"), default_value = 70 ),
Integer(title = _("minium"), unit = _("° celsius"), default_value = 20 ),
]
),
TextAscii(
title = _("Check description"),
help = _("begin of check description without 'Environment:'")
),
None
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment