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 4dcdd18f 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 fan
Monitors status of Cisco ASA fan sensors
Check Info:
* *service*: this check will create one service per fan sensor
* *state*: **critical**/**warning** if fan speed outside the configured levels
* *wato*: you can configure the warn/crit level for the fan speed and also an minimum fan speed
* *perfdata*: fan speed in rpm
Testetd with: ASA 5512-X, 5515-X, 5555-X, 5585-X
Sample output
![sample output](/doc/sample.png?raw=true "sample [SHORT TITLE]")
\ No newline at end of file
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 fan sensors.
This check allows to monitor this Sensors. Default levels are 7000/8000 rpm
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-5512X devices.
perfdata:
rpm
item:
One item per fan sensor is generated.
inventory:
The check detects ASA fan sensors and saves them.
parameters:
Warning/Critical levels. Default is 7000/8000 rpm.
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# created by Th.L.:
# Monitors Cisco ASA fan sensors
# works with Cisco ASA 55xx-X and later
# tested with and 5512-XX, 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: added minimum level
# 03.05.2018: fixed inventory for empty sensorname (asa context)
#
cisco_asa_fan_default_levels = (6000,7000,2000)
def inventory_cisco_asa_fan(info):
for sensorname, sensortype, sensorvalue, sensorstatus, sensorunits in info:
if sensortype == '10' and sensorstatus == '1' and sensorname != '':
yield sensorname, cisco_asa_fan_default_levels
def check_cisco_asa_fan(item, params, info):
warn, crit, minimum = params
infotext = 'item not found(!)'
state = 3
perfdata = []
for sensorname, sensortype, sensorvalue, sensorstatus, sensorunits in info:
if sensorname == item and sensortype == '10':
sensorvalue = int(sensorvalue)
infotext = '%d rpm' % (sensorvalue)
perfdata = [('rpm', sensorvalue, warn, crit)]
if sensorvalue >= crit:
infotext += '(>=%d)(!!)' % crit
return 2, infotext, perfdata
elif sensorvalue >= warn:
infotext += '(>=%d)(!)' % warn
return 1, infotext, perfdata
elif sensorvalue < minimum:
infotext += '(<%d)(!!)' % minimum
return 2, infotext, perfdata
else:
return 0, infotext, perfdata
return state, infotext, perfdata
check_info['cisco_asa_fan'] = {
'check_function' : check_cisco_asa_fan,
'inventory_function' : inventory_cisco_asa_fan,
'service_description': 'Environment: %s',
'has_perfdata' : True,
'group' : 'cisco_asa_fan',
'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

23.1 KiB

{'author': 'Th.L. (thl-cmk[at]outlook[dot]com)',
'description': 'monitor Cisco ASA fan sensors\nMinimum/Warning/Critical rpm level can be configured via wato',
'download_url': 'https://thl-cmk.hopto.org',
'files': {'checkman': ['cisco_asa_fan'],
'checks': ['cisco_asa_fan'],
'pnp-templates': [],
'web': ['plugins/wato/cisco_asa_fan.py',
'plugins/metrics/cisco_asa_fan.py']},
'name': 'cisco_asa_fan',
'num_files': 4,
'title': 'monitor cisco ASA fan sensors',
'version': '20180503.v03a',
'version.min_required': '1.2.6p16',
'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_fan.php
# web/plugins/perfometer/cisco_asa_fan.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_fan perfdata
#
#####################################################################################################################
#####################################################################################################################
#
# define metrics for cisco_asa_fan perfdata
#
#####################################################################################################################
metric_info['cisco_asa_fan_rpm'] = {
'title': _('rpm'),
'help': _('number of accepted prefixes'),
'unit': 'rpm',
'color': colors_a[0],
}
######################################################################################################################
#
# map cisco_asa_fan perfdata to metric, not really necessary but makes sure to use the right metrics
#
######################################################################################################################
check_metrics['check_mk-cisco_asa_fan'] = {
'rpm': {'name': 'cisco_asa_fan_rpm', },
}
######################################################################################################################
#
# how to graph perdata for cisco_asa_fan
#
######################################################################################################################
graph_info.append({
'title': _('rpm'),
'metrics': [
('cisco_asa_fan_rpm', 'line'),
],
'range': (0, 10000),
'scalars': [
('cisco_asa_fan_rpm:crit', _('crit level')),
('cisco_asa_fan_rpm:warn', _('warn level')),
],
})
######################################################################################################################
#
# define perf-o-meter for cisco_asa_fan rpm
#
######################################################################################################################
perfometer_info.append({
'type': 'linear',
'segments': ['cisco_asa_fan_rpm'],
'total': 10000,
})
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# Author : Th.L.
# Content: wato plugin for snmp check "cisco_asa_fan"
# to configure waring/critical levels
#
#
register_check_parameters(
subgroup_environment,
"cisco_asa_fan",
_("Cisco ASA fan sensor"),
Tuple(
title=_("Cisco ASA fan sensor thresholds"),
elements=[
Integer(title=_("warning at"), unit=_("rpm"), default_value=7000),
Integer(title=_("critical at"), unit=_("rpm"), default_value=8000),
Integer(title=_("minimum"), unit=_("rpm"), default_value=1000),
]
),
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