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

update project

parent 814533b7
No related branches found
No related tags found
No related merge requests found
#!/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
#
# Monitors Cisco WLC CPU utilization
#
# tested with WLC2504
#
# 2016-03-31: initial release
# 2016-07-02: fixed crit/warn to >=
# 2018-01-15: changed scan function, added wato plugin
# 2021-07-15: rewritten for CMK 2.0
#
from typing import Optional
from cmk.base.plugins.agent_based.agent_based_api.v1.type_defs import (
DiscoveryResult,
CheckResult,
StringTable,
)
from cmk.base.plugins.agent_based.agent_based_api.v1 import (
register,
Service,
SNMPTree,
contains,
render,
check_levels,
)
def parse_cisco_wlc_cpu(string_table: StringTable) -> Optional[int]:
try:
return int(string_table[0][0])
except IndexError:
pass
def discovery_cisco_wlc_cpu(section: int) -> DiscoveryResult:
yield Service()
def check_cisco_wlc_cpu(params, section: int) -> CheckResult:
yield from check_levels(
value=section,
label='CPU utilization',
levels_upper=params['levels_upper'],
render_func=render.percent,
metric_name='util',
boundaries=(0, 100),
)
register.snmp_section(
name='cisco_wlc_cpu',
parse_function=parse_cisco_wlc_cpu,
fetch=SNMPTree(
base='.1.3.6.1.4.1.14179.1.1.5', # AIRESPACE-SWITCHING-MIB::agentResourceInfoGroup
oids=[
'1', # agentCurrentCPUUtilization
]
),
detect=contains('.1.3.6.1.2.1.1.1.0', 'Cisco Controller'), # sysDescr
)
register.check_plugin(
name='cisco_wlc_cpu',
service_name='CPU utilization',
discovery_function=discovery_cisco_wlc_cpu,
check_function=check_cisco_wlc_cpu,
check_default_parameters={'levels_upper': (70, 80)},
check_ruleset_name='cisco_wlc_cpu',
)
No preview for this file type
{'author': u'Th.L. (thl-cmk[at]outlook[dot]com)',
'description': u'monitor Cisco WLC CPU usage\n',
{'author': 'Th.L. (thl-cmk[at]outlook[dot]com)',
'description': 'monitor Cisco WLC CPU utilization\n',
'download_url': 'https://thl-cmk.hopto.org',
'files': {'checks': ['cisco_wlc_cpu'],
'web': ['plugins/wato/cisco_wlc_cpu.py',
'plugins/metrics/cisco_wlc_cpu.py']},
'files': {'agent_based': ['cisco_wlc_cpu.py'],
'web': ['plugins/wato/cisco_wlc_cpu.py']},
'name': 'cisco_wlc_cpu',
'num_files': 3,
'title': u'monitor Cisco WLC CPU usage',
'version': '20180805.v.0.2',
'version.min_required': '1.2.8b8',
'version.packaged': '1.4.0p35'}
\ No newline at end of file
'num_files': 2,
'title': 'monitor Cisco WLC CPU usage',
'version': '20210715.v.0.3',
'version.min_required': '2.0.0',
'version.packaged': '2021.07.14',
'version.usable_until': None}
\ No newline at end of file
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Author : Th.L.
# Date : 2018-01-15
# Content: wato plugin for snmp check 'cisco_wlc_cpu'
# to configure waring/critical levels
# 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_cpu'
#
#
register_check_parameters(
subgroup_os,
'cisco_wlc_cpu',
'Cisco WLC CPU utilisation',
Dictionary(
elements=[
('levels',
Tuple(
title=_('Levels for Cisco WLC CPU utilisation'),
elements=[
Integer(title=_('Warning at'), default_value=60, unit=_('% utilisation')),
Integer(title=_('Critical at'), default_value=70, unit=_('% utilisation')),
])),
]),
None,
match_type='dict'
from cmk.gui.i18n import _
from cmk.gui.valuespec import (
Dictionary,
Tuple,
Integer,
)
from cmk.gui.plugins.wato import (
CheckParameterRulespecWithItem,
rulespec_registry,
RulespecGroupCheckParametersNetworking,
)
def _parameter_valuespec_cisco_wlc_cpu():
return Dictionary(elements=[
('levels_upper',
Tuple(
title=_('Upper levels'),
help=_('Set the maximum for CPU utilization in %'),
elements=[
Integer(title=_('Warning at'), unit='%', default_value=70, minvalue=0, maxvalue=100),
Integer(title=_('Critical at'), unit='%', default_value=80, minvalue=0, maxvalue=100)
],
),
),
])
rulespec_registry.register(
CheckParameterRulespecWithItem(
check_group_name='cisco_wlc_cpu',
group=RulespecGroupCheckParametersNetworking,
match_type='dict',
parameter_valuespec=_parameter_valuespec_cisco_wlc_cpu,
title=lambda: _('Cisco WLC CPU utilization'),
))
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