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

update project

parent 5f377a31
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
# 2022-05-31: removed "Software" from snmp detect function # 2022-05-31: removed "Software" from snmp detect function
# 2022-10-23: fixed warning on upgrade "non-empty params vanished" for inv_ap_info # 2022-10-23: fixed warning on upgrade "non-empty params vanished" for inv_ap_info
# 2023-02-21: added cluster function (backport from check_mk) THX to roger[dot]ellenberger[at]wagner[dot]ch # 2023-02-21: added cluster function (backport from check_mk) THX to roger[dot]ellenberger[at]wagner[dot]ch
# # 2023-02-21: moved gui files from ~/local/share/check_mk/... to ~/local/lib/check_mk...
from time import time from time import time
from dataclasses import dataclass from dataclasses import dataclass
......
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-01-06
#
#
# missing a way to include hostname and service description
#
# 2023-02-21: moved from ~/local/share/check_mk/... to ~/local/lib/check_mk...
#
from cmk.gui.i18n import _
from cmk.gui.plugins.metrics.utils import (
metric_info,
graph_info,
perfometer_info
)
#####################################################################################################################
#
# define metrics for perfdata
#
#####################################################################################################################
metric_info['cisco_wlc_uptime_seconds'] = {
'title': _('AP uptime'),
'help': _(''),
'unit': 's',
'color': '26/a',
}
metric_info['cisco_wlc_lwap_uptime_seconds'] = {
'title': _('LWAP uptime'),
'help': _(''),
'unit': 's',
'color': '41/a',
}
metric_info['cisco_wlc_active_client_count'] = {
'title': _('Active clients'),
'help': _(''),
'unit': 'count',
'color': '11/a',
}
metric_info['cisco_wlc_associated_clients'] = {
'title': _('Associated clients'),
'help': _(''),
'unit': 'count',
'color': '23/a',
}
metric_info['cisco_wlc_reassoiation_success_count'] = {
'title': _('Reassoiation success'),
'help': _(''),
'unit': '1/s',
'color': '21/a',
}
metric_info['cisco_wlc_reassoiation_failure_count'] = {
'title': _('Reassoiation failure'),
'help': _(''),
'unit': '1/s',
'color': '31/a',
}
metric_info['cisco_wlc_reassoiation_failure_count_by_rate'] = {
'title': _('Reassoiation failure rate'),
'help': _(''),
'unit': '1/s',
'color': '41/a',
}
metric_info['cisco_wlc_echo_request_count'] = {
'title': _('Echo request'),
'help': _(''),
'unit': '1/s',
'color': '12/a',
}
metric_info['cisco_wlc_echo_response_loss_count'] = {
'title': _('Echo response loss'),
'help': _(''),
'unit': '1/s',
'color': '22/a',
}
metric_info['cisco_wlc_association_fail_count_for_rssi_low'] = {
'title': _('Association fail rssi low'),
'help': _(''),
'unit': '1/s',
'color': '32/a',
}
metric_info['cisco_wlc_association_fail_times'] = {
'title': _('Association fail times'),
'help': _(''),
'unit': '1/s',
'color': '42/a',
}
metric_info['cisco_wlc_association_count'] = {
'title': _('Associations'),
'help': _(''),
'unit': '1/s',
'color': '13/a',
}
######################################################################################################################
#
# how to graph perdata
#
######################################################################################################################
graph_info['cisco_wlc.ap_uptime'] = {
'title': _('AP/LWAP Uptime'),
'metrics': [
('cisco_wlc_lwap_uptime_seconds', '-area'),
('cisco_wlc_uptime_seconds', 'area'),
],
'optional_metrics': ['cisco_wlc_lwap_uptime_seconds'],
}
graph_info['cisco_wlc.active_client'] = {
'title': _('Active clients'),
'metrics': [
('cisco_wlc_active_client_count', 'area'),
('cisco_wlc_associated_clients', 'line'),
],
}
graph_info['cisco_wlc.counters'] = {
'title': _('Counters'),
'metrics': [
('cisco_wlc_reassoiation_success_count', 'line'),
('cisco_wlc_reassoiation_failure_count', 'line'),
('cisco_wlc_association_fail_times', 'line'),
('cisco_wlc_association_fail_count_for_rssi_low', 'line'),
('cisco_wlc_association_count', 'line'),
],
}
graph_info['cisco_elc_echo'] = {
'title': _('Echos'),
'metrics': [
('cisco_wlc_echo_request_count', 'area'),
('cisco_wlc_echo_response_loss_count', '-area'),
],
}
######################################################################################################################
#
# define perf-o-meter
#
######################################################################################################################
perfometer_info.append(('stacked', [
{
'type': 'logarithmic',
'metric': 'cisco_wlc_uptime_seconds',
'half_value': 2592000.0,
'exponent': 2,
},
{
'type': 'linear',
'segments': ['cisco_wlc_active_client_count'],
'total': 200,
}
]))
#!/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 :
#
# 2023-02-21: moved from ~/local/share/check_mk/... to ~/local/lib/check_mk...
#
from cmk.gui.i18n import _
from cmk.gui.valuespec import (
Dictionary,
Tuple,
TextAscii,
ListOf,
MonitoringState,
TextUnicode,
)
from cmk.gui.plugins.wato.utils import (
CheckParameterRulespecWithItem,
rulespec_registry,
RulespecGroupCheckParametersNetworking,
)
def _parameter_valuespec_cisco_wlc():
return Dictionary(
elements=[
('state_ap_missing',
MonitoringState(
title=_('State if AP is missing'),
help=_('Set the monitoring state if the access point is not in the SNMP data. Default is WARN.'),
default_value=1,
)),
('state_ap_adminstatus',
MonitoringState(
title=_('State if AP is not admin enabled'),
help=_('Set the monitoring state if the access point is not in "admin enable". Default is WARN.'),
default_value=1,
)),
('state_ap_operationstatus',
MonitoringState(
title=_('State if AP is not operational'),
help=_('Set the monitoring state if the access point is not in "operational" state. Default is WARN.'),
default_value=1,
)),
('state_ap_telnetenable',
MonitoringState(
title=_('State if Telnet is enabled'),
help=_('Set the monitoring state if the access point has telnet access enabled. Default is CRIT.'),
default_value=2,
)),
('state_ap_sshenable',
MonitoringState(
title=_('State if SSH is enabled'),
help=_('Set the monitoring state if the access point has SSH access enabled. Default is WARN.'),
default_value=1,
)),
('stateap_encryptionenable',
MonitoringState(
title=_('State if encryption is not enabled'),
help=_('Set the monitoring state if the LEAP/CAPWAP tunnel encryption nor enabled. Default is WARN.'),
default_value=1,
)),
('state_ap_dataencryptionstatus',
MonitoringState(
title=_('State if encryption is not active'),
help=_('Set the monitoring state if the LWAP/CAPWAP tunnel encryption enabled but not active. '
'Default is WARN.'),
default_value=1,
)),
('state_ap_powerstatus',
MonitoringState(
title=_('State if AP is not on full power'),
help=_('Set the monitoring state if the access point not on full power. Default is CRIT.'),
default_value=2,
)),
('state_cdp_duplex',
MonitoringState(
title=_('State if CDP "half duplex"'),
help=_('Set the monitoring state if the the CDP neighbour info for "duplex" is "half duplex". '
'Default is WARN.'),
default_value=1,
)),
('state_cdp_change',
MonitoringState(
title=_('State if CDP info is changed/missing'),
help=_('Set the monitoring state if the CDP info from the access point has changed or is missing. '
'This happens if the AP was moved to a different switch/interface. The CDP info will be used '
'to help locating a missing access point. '
'Default is WARN.'),
default_value=1,
)),
('state_ap_change',
MonitoringState(
title=_('State if H/W has changed'),
help=_('Set the monitoring state if the hard ware of the access point has changed. This information '
'will be used to help locate a missing access point '
'Default is WARN.'),
default_value=1,
)),
('ap_list',
ListOf(
Tuple(
elements=[
TextUnicode(
title=_('AP name'),
help=_('The configured value must match a AP item as reported by the monitored '
'device. For example: "AP1.4"'),
allow_empty=False,
size=40,
),
TextUnicode(
title=_('AP Alias'),
help=_('You can configure an individual alias here for the access point matching '
'the text configured in the "AP item name" field. The alias will '
'be shown in the check info'),
allow_empty=False,
size=40,
),
],
orientation='horizontal',
),
title=_('AP alias'),
add_label=_('Add name'))),
('inv_ap_info', # added by plugin discovery function
Dictionary(
elements=[
('ap_location', TextUnicode()),
('ap_model', TextUnicode()),
('ap_serialnumber', TextUnicode()),
('ap_ipaddress', TextUnicode()),
('ap_ethernetmacaddress', TextUnicode()),
('cdp_neigh_name', TextUnicode()),
('cdp_neigh_address', TextUnicode()),
('cdp_neigh_interface', TextUnicode()),
('cdp_neigh_platform', TextUnicode()),
],
)),
],
hidden_keys=['inv_ap_info'],
)
rulespec_registry.register(
CheckParameterRulespecWithItem(
check_group_name='cisco_wlc',
group=RulespecGroupCheckParametersNetworking,
match_type='dict',
parameter_valuespec=_parameter_valuespec_cisco_wlc,
title=lambda: _('Cisco WLC APs'),
item_spec=lambda: TextAscii(title=_('Cisco WLC AP name'), ),
))
...@@ -9,11 +9,10 @@ ...@@ -9,11 +9,10 @@
'Perfdata: Clientcount, clientfail, uptime, ...\n', 'Perfdata: Clientcount, clientfail, uptime, ...\n',
'download_url': 'http://thl-cmk.hopto.org', 'download_url': 'http://thl-cmk.hopto.org',
'files': {'agent_based': ['cisco_wlc.py'], 'files': {'agent_based': ['cisco_wlc.py'],
'web': ['plugins/wato/cisco_wlc.py', 'gui': ['metrics/cisco_wlc.py', 'wato/cisco_wlc.py']},
'plugins/metrics/cisco_wlc.py']},
'name': 'cisco_wlc', 'name': 'cisco_wlc',
'title': 'monitor Cisco WLC APs', 'title': 'monitor Cisco WLC APs',
'version': '20230221.v0.7', 'version': '20230221.v0.8',
'version.min_required': '2.0.0', 'version.min_required': '2.1.0',
'version.packaged': '2.1.0p21', 'version.packaged': '2.1.0p21',
'version.usable_until': None} '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