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

update project

parent 5f8b97a3
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@
# more specific "1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40"
# 2020-02-24: added support for Cisco Firepower Threat Defense
# 2020-04-28: changed item from Cisco ASA connections to Firewall connections --> more clear, with cisco_asa_conn check
# 2021-03-24: rewrite for CMK 2.0 Check API
# 2021-03-24: rewrite for CMK 2.0 Check API, added lower levels
#
# sample snmp walk
#
......@@ -70,7 +70,7 @@ def discovery_cisco_asa_connections(section: CiscoAsaFwConnections) -> Discovery
def check_cisco_asa_connections(params, section: CiscoAsaFwConnections) -> CheckResult:
yield from check_levels(
section.current,
levels_lower=params.get('lower', None),
levels_lower=params.get('connections_lower', None),
levels_upper=params.get('connections', None),
metric_name='fw_connections_active',
render_func=lambda v: '%s' % str(v),
......@@ -79,7 +79,7 @@ def check_cisco_asa_connections(params, section: CiscoAsaFwConnections) -> Check
yield from check_levels(
section.peak,
label='Max. since system startup',
metric_name='peak_connections',
metric_name='fw_connections_peak',
render_func=lambda v: '%s' % str(v),
)
......
No preview for this file type
......@@ -10,9 +10,10 @@
'connections\n',
'download_url': 'https://thl-cmk.hopto.org',
'files': {'agent_based': ['cisco_asa_connections.py'],
'web': ['plugins/metrics/cisco_asa_connections.py']},
'web': ['plugins/metrics/cisco_asa_connections.py',
'plugins/wato/cisco_fw_connections.py']},
'name': 'cisco_asa_connections',
'num_files': 2,
'num_files': 3,
'title': 'Monitor Cisco ASA connections',
'version': '20210324.v.0.4',
'version.min_required': '2.0.0',
......
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Cisco ASA connections metrics plugin
#
# Author: Th.L.
# Date : 2018-01-09
#
#####################################################################################################################
#
# define units
#
#####################################################################################################################
from cmk.gui.i18n import _
#####################################################################################################################
#
# define metrics
#
#####################################################################################################################
from cmk.gui.plugins.metrics import (
metric_info,
graph_info,
)
metric_info['cisco_asa_connections_current_connections'] = {
'title': _('current conections'),
metric_info['fw_connections_active'] = {
'title': _('Active conections'),
'unit': 'count',
'color': '26/a',
}
metric_info['cisco_asa_connections_max_connections'] = {
'title': _('max conections'),
metric_info['fw_connections_peak'] = {
'title': _('Peak conections'),
'unit': 'count',
'color': '11/a',
'color': '16/a',
}
######################################################################################################################
#
# map perfdata to metric
#
######################################################################################################################
check_metrics['check_mk-cisco_asa_connections'] = {
'current_connections': {'name': 'cisco_asa_connections_current_connections', },
'max_connections': {'name': 'cisco_asa_connections_max_connections',}
}
######################################################################################################################
#
# how to graph perdata
#
######################################################################################################################
graph_info.append({
'title': _('connections'),
graph_info['cisco_asa_connections'] = {
'title': _('Firewall connections'),
'metrics': [
('cisco_asa_connections_max_connections', 'line'),
('cisco_asa_connections_current_connections', 'area'),
('fw_connections_active', 'line'),
('fw_connections_peak', 'area'),
],
'scalars': [
('cisco_asa_connections_current_connections:crit', _('crit level')),
('cisco_asa_connections_current_connections:warn', _('warn level')),
('fw_connections_active:crit', _('crit level')),
('fw_connections_active:warn', _('warn level')),
],
})
######################################################################################################################
#
# define perf-o-meter
#
######################################################################################################################
perfometer_info.append({
'type': 'logarithmic',
'metric': 'cisco_asa_connections_current_connections',
'half_value': 50000.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,
Integer,
Tuple,
)
from cmk.gui.plugins.wato import (
CheckParameterRulespecWithoutItem,
rulespec_registry,
RulespecGroupCheckParametersApplications,
)
def _parameter_valuespec_cisco_fw_connections():
return Dictionary(elements=[
('connections',
Tuple(
help=_('This rule sets ipper limits to the current number of connections through a Cisco firewall.'),
title=_('Maximum number of firewall connections'),
elements=[
Integer(title=_('Warning at'), unit='connections'),
Integer(title=_('Critical at'), unit='connections'),
],
)),
('connections_lower',
Tuple(
help=_('This rule sets lower limits to the current number of connections through a Cisco firewall.'),
title=_('Minimum number of firewall connections'),
elements=[
Integer(title=_('Warning if below'), unit='connections'),
Integer(title=_('Critical if below'), unit='connections'),
],
)),
],)
rulespec_registry.register(
CheckParameterRulespecWithoutItem(
check_group_name='cisco_fw_connections',
group=RulespecGroupCheckParametersApplications,
match_type='dict',
parameter_valuespec=_parameter_valuespec_cisco_fw_connections,
title=lambda: _('Cisco Firewall Connections'),
))
\ 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