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

update project

parent 8d6c68f6
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,8 @@
# 2016-03-31: initial release
# 2016-07-02: fixed crit/warn to >=
# 2021-07-15: rewritten for CMK 2.0
# 2023-06-07: moved gui files to ~/local/lib/chek_mk/gui/plugins/...
#
from dataclasses import dataclass
from typing import Optional
......@@ -46,7 +48,7 @@ class CiscoWlcMem:
def parse_cisco_wlc_mem(string_table: StringTable) -> Optional[CiscoWlcMem]:
try:
totalmemory, freememory = string_table[0]
except IndexError:
except (IndexError, ValueError):
return
totalmemory = int(totalmemory) * 1024 # chenage from Kbytes to Bytes
......@@ -78,7 +80,7 @@ def check_cisco_wlc_mem(params, section: CiscoWlcMem) -> CheckResult:
usedmemory_mb = section.usedmemory / 1024 / 1024
totalmemory_mb = section.totalmemory / 1024 / 1024
freememory_mb = section.freememory /1024 / 1024
freememory_mb = section.freememory / 1024 / 1024
yield Result(state=State.OK, notice=f'(Memory total: {totalmemory_mb:.2f}MB, '
f'used: {usedmemory_mb:.2f}MB, '
......
File added
No preview for this file type
#!/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 : 2018-03-18
#
# metrics plugin for cisco_wlc_mem
from cmk.gui.i18n import _
from cmk.gui.plugins.metrics.utils import (
metric_info,
graph_info,
perfometer_info
)
metric_info['cisco_wlc_mem_utilization'] = {
'title': _('Memory utilization'),
'unit': '%',
'color': '26/a',
}
graph_info['cisco_wlc_mem.cisco_wlc_mem_utilization'] = {
'title': _('Memory utilization'),
'metrics': [
('cisco_wlc_mem_utilization', 'area'),
],
'range': (0, 100),
'scalars': [
('cisco_wlc_mem_utilization:crit', _('crit level')),
('cisco_wlc_mem_utilization:warn', _('warn level')),
],
}
perfometer_info.append({
'type': 'linear',
'segments': ['cisco_wlc_mem_utilization'],
'total': 100.0,
})
#!/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 : 2016-03-31
#
# wato plugin for cisco_wlc_mem plugin
#
from cmk.gui.i18n import _
from cmk.gui.valuespec import (
Dictionary,
Tuple,
Integer,
)
from cmk.gui.plugins.wato.utils import (
CheckParameterRulespecWithItem,
rulespec_registry,
RulespecGroupCheckParametersNetworking,
)
def _parameter_valuespec_cisco_wlc_mem():
return Dictionary(elements=[
('levels_upper',
Tuple(
title=_('Upper levels'),
help=_('Set the maximum for memory utilization in %'),
elements=[
Integer(title=_('Warning at'), unit='%', default_value=50, minvalue=0, maxvalue=100),
Integer(title=_('Critical at'), unit='%', default_value=70, minvalue=0, maxvalue=100)
],
),
),
])
rulespec_registry.register(
CheckParameterRulespecWithItem(
check_group_name='cisco_wlc_mem',
group=RulespecGroupCheckParametersNetworking,
match_type='dict',
parameter_valuespec=_parameter_valuespec_cisco_wlc_mem,
title=lambda: _('Cisco WLC memory utilization'),
))
......@@ -3,12 +3,10 @@
'download_url': 'https://thl-cmk.hopto.org',
'files': {'agent_based': ['cisco_wlc_mem.py'],
'checkman': ['cisco_wlc_mem'],
'web': ['plugins/wato/cisco_wlc_mem.py',
'plugins/metrics/cisco_wlc_mem.py']},
'gui': ['metrics/cisco_wlc_mem.py', 'wato/cisco_wlc_mem.py']},
'name': 'cisco_wlc_mem',
'num_files': 4,
'title': 'Cisco WLC memory usage',
'version': '20210715.v.0.3',
'version.min_required': '2.0.0',
'version.packaged': '2021.07.14',
'version': '0.3.0-20230607',
'version.min_required': '2.1.0b1',
'version.packaged': '2.1.0p21',
'version.usable_until': None}
\ 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