diff --git a/cisco_asa_connections-0.5.0-200607.mkp b/cisco_asa_connections-0.5.0-200607.mkp new file mode 100644 index 0000000000000000000000000000000000000000..6e08ca531a62074b05d6a47ab965c3a984335744 Binary files /dev/null and b/cisco_asa_connections-0.5.0-200607.mkp differ diff --git a/cisco_asa_connections.mkp b/cisco_asa_connections.mkp index 6b4a80b38c88e671dbd57bcf5982770678309bce..6e08ca531a62074b05d6a47ab965c3a984335744 100644 Binary files a/cisco_asa_connections.mkp and b/cisco_asa_connections.mkp differ diff --git a/gui/metrics/cisco_asa_connections.py b/gui/metrics/cisco_asa_connections.py new file mode 100644 index 0000000000000000000000000000000000000000..14c8b7bff6c19bb7ed60dcec324fce1687ea5fae --- /dev/null +++ b/gui/metrics/cisco_asa_connections.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Cisco ASA connections metrics plugin +# + +from cmk.gui.i18n import _ + +from cmk.gui.plugins.metrics.utils import ( + metric_info, + graph_info, +) + +metric_info['fw_connections_active'] = { + 'title': _('Active connections'), + 'unit': 'count', + 'color': '26/a', +} + +metric_info['fw_connections_peak'] = { + 'title': _('Peak connections'), + 'unit': 'count', + 'color': '16/a', +} + +graph_info['cisco_asa_connections'] = { + 'title': _('Firewall connections'), + 'metrics': [ + ('fw_connections_active', 'line'), + ('fw_connections_peak', 'area'), + ], + 'scalars': [ + ('fw_connections_active:crit', _('crit level')), + ('fw_connections_active:warn', _('warn level')), + ], +} diff --git a/gui/wato/cisco_fw_connections.py b/gui/wato/cisco_fw_connections.py new file mode 100644 index 0000000000000000000000000000000000000000..c12e20b3db406b03f0dc4ec17a3034666eeaf490 --- /dev/null +++ b/gui/wato/cisco_fw_connections.py @@ -0,0 +1,52 @@ +#!/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.utils 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'), + )) diff --git a/packages/cisco_asa_connections b/packages/cisco_asa_connections index 068fa9428140a1781d525c70e893fb652416ffb0..e696af75c5ea8f859395d293bfe1dcf958fcc1be 100644 --- a/packages/cisco_asa_connections +++ b/packages/cisco_asa_connections @@ -11,11 +11,11 @@ 'download_url': 'https://thl-cmk.hopto.org', 'files': {'agent_based': ['cisco_asa_connections.py'], 'checks': ['cisco_asa_connections'], - 'web': ['plugins/metrics/cisco_asa_connections.py', - 'plugins/wato/cisco_fw_connections.py']}, + 'gui': ['metrics/cisco_asa_connections.py', + 'wato/cisco_fw_connections.py']}, 'name': 'cisco_asa_connections', 'title': 'Monitor Cisco ASA connections', - 'version': '200607.v.0.5', - 'version.min_required': '2.0.0b1', + 'version': '0.5.0-200607', + 'version.min_required': '2.1.0b1', 'version.packaged': '2.1.0p21', 'version.usable_until': None} \ No newline at end of file