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 87c19390 authored by thl-cmk's avatar thl-cmk :flag_na:
Browse files

update project

parent d43f1d65
No related branches found
No related tags found
No related merge requests found
......@@ -202,10 +202,10 @@ def check_cisco_asa_fan(item, params: TempParamType, section) -> CheckResult:
yield from check_levels(
sensor.value,
label='Fan speed',
label='Speed',
levels_lower=params.get('levels_lower', None),
levels_upper=params.get('levels_upper', None),
metric_name='fan_speed',
metric_name='fan' if params.get('output_metrics') else None,
render_func=lambda v: render_rpm(v),
)
......@@ -220,7 +220,7 @@ register.check_plugin(
discovery_function=discovery_cisco_asa_fan,
check_function=check_cisco_asa_fan,
check_default_parameters={},
check_ruleset_name='fan_speed'
check_ruleset_name='hw_fans'
)
......
No preview for this file type
......@@ -2,11 +2,9 @@
'description': 'This plugin contains checks for Cisco ASA fan, temperature '
'and power supply\n',
'download_url': 'https://thl-cmk.hopto.org',
'files': {'agent_based': ['cisco_asa_sensors.py'],
'web': ['plugins/metrics/fan_speed.py',
'plugins/wato/fan_speed.py']},
'files': {'agent_based': ['cisco_asa_sensors.py']},
'name': 'cisco_asa_sensors',
'num_files': 3,
'num_files': 1,
'title': 'Cisco ASA Sensors',
'version': '20210318_v0.0.1',
'version.min_required': '2.0.0',
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
from cmk.gui.i18n import _
from cmk.gui.plugins.metrics import (
metric_info,
graph_info,
perfometer_info
)
metric_info["fan_speed"] = {
"title": _("Fan speed"),
"unit": "rpm",
"color": "16/a",
}
graph_info['fan_speed'] = {
'title': _('Fan speed'),
'metrics': [
('fan_speed', 'area'),
],
'scalars': [
('fan_speed:crit', _('crit level')),
('fan_speed:warn', _('warn level')),
],
}
perfometer_info.append({
'type': 'logarithmic',
'metric': 'fan_speed',
'half_value': 7500.0,
'exponent': 2,
})
\ No newline at end of file
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
from cmk.gui.i18n import _
from cmk.gui.valuespec import (
Dictionary,
DropdownChoice,
Float,
Integer,
TextAscii,
Transform,
Tuple,
)
from cmk.gui.plugins.wato import (
RulespecGroupCheckParametersEnvironment,
CheckParameterRulespecWithItem,
rulespec_registry,
)
# New fan speed rule for modern fan checks that have the
# sensor type (e.g. 'CPU', 'Chassis', etc.) as the beginning of their
# item (e.g. 'CPU 1', 'Chassis 17/11'). This will replace all other
# fan speed rulesets in future. Note: those few fan speed checks
# that do *not* use an item, need to be converted to use one single
# item (other than None).
def _parameter_valuespec_temperature():
return Transform(
Dictionary(elements=[
(
'levels',
Transform(
Tuple(
title=_('Upper fan speed Levels'),
elements=[
Float(title=_('Warning at'), unit=u'RPM'),
Float(title=_('Critical at'), unit=u'RPM'),
],
),
forth=lambda elems: (float(elems[0]), float(elems[1])),
),
),
(
'levels_lower',
Transform(
Tuple(
title=_('Lower fan speed Levels'),
elements=[
Float(title=_('Warning below'), unit=u'RPM'),
Float(title=_('Critical below'), unit=u'RPM'),
],
),
forth=lambda elems: (float(elems[0]), float(elems[1])),
),
),
# ('device_levels_handling',
# DropdownChoice(
# title=_('Interpretation of the device's own temperature status'),
# choices=[
# ('usr', _('Ignore device's own levels')),
# ('dev', _('Only use device's levels, ignore yours')),
# ('best', _('Use least critical of your and device's levels')),
# ('worst', _('Use most critical of your and device's levels')),
# ('devdefault', _('Use device's levels if present, otherwise yours')),
# ('usrdefault', _('Use your own levels if present, otherwise the device's')),
# ],
# default_value='usrdefault',
# )),
# (
# 'trend_compute',
# Dictionary(
# title=_('Trend computation'),
# elements=[
# ('period',
# Integer(
# title=_('Observation period for fan speed trend computation'),
# default_value=30,
# minvalue=5,
# unit=_('minutes'),
# )),
# ('trend_levels',
# Tuple(
# title=_('Levels on fan speed increase per period'),
# elements=[
# Integer(
# title=_('Warning at'),
# unit=u'RPM / ' + _('period'),
# default_value=5,
# ),
# Integer(
# title=_('Critical at'),
# unit=u'RPM / ' + _('period'),
# default_value=10,
# )
# ],
# )),
# ('trend_levels_lower',
# Tuple(
# title=_('Levels on fan speed decrease per period'),
# elements=[
# Integer(
# title=_('Warning at'),
# unit=u'RPM / ' + _('period'),
# default_value=5,
# ),
# Integer(
# title=_('Critical at'),
# unit=u'RPM / ' + _('period'),
# default_value=10,
# )
# ],
# )),
# ('trend_timeleft',
# Tuple(
# title=
# _('Levels on the time left until a critical fann speed (upper or lower) is reached'
# ),
# elements=[
# Integer(
# title=_('Warning if below'),
# unit=_('minutes'),
# default_value=240,
# ),
# Integer(
# title=_('Critical if below'),
# unit=_('minutes'),
# default_value=120,
# ),
# ],
# ))
# ],
# optional_keys=['trend_levels', 'trend_levels_lower', 'trend_timeleft'],
# ),
# ),
],),
forth=lambda v: isinstance(v, tuple) and {'levels': v} or v,
)
rulespec_registry.register(
CheckParameterRulespecWithItem(
check_group_name='fan_speed',
group=RulespecGroupCheckParametersEnvironment,
item_spec=lambda: TextAscii(title=_('Sensor ID'),
help=_('The identifier of the fan speed sensor.')),
match_type='dict',
parameter_valuespec=_parameter_valuespec_temperature,
title=lambda: _('Fan speed'),
))
\ No newline at end of file
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