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

update project

parent b5b20c4c
No related branches found
No related tags found
No related merge requests found
......@@ -9,3 +9,4 @@
2020-06-08: changed snmp-scan function
code cleanup
2022-11-30: WATO: fixed CheckParameterRulespecWithoutItem (from CheckParameterRulespecWithItem)
2023-03-04: changed for CMK 2.1 (moved gui files from local/share/.. to local/lib/..)
......@@ -20,6 +20,7 @@
# 2021-08-24: rewritten for CMK 2.0,
# added relative thresholds (idea and code based on cmk PR #312 by https://github.com/gradecke)
# added lower levels and admin_table_limit, removed default values except for 'levels_upper_relative'
# 2023-03-04: changed for CMK 2.1 (moved gui files from local/share/.. to local/lib/..)
#
#
# sample string_table
......
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-17
#
# Check Point Firewall connections metrics plugins
# checkpoint_fw_connections
#
# 2023-02-18: moved metrics file 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,
)
metric_info['checkpoint_fw_connections_fwconnectionstcp'] = {
'title': _('TCP connections'),
'unit': '1/s',
'color': '11/a',
}
metric_info['checkpoint_fw_connections_fwconnectionsudp'] = {
'title': _('UDP connections'),
'unit': '1/s',
'color': '25/a',
}
metric_info['checkpoint_fw_connections_fwconnectionsicmp'] = {
'title': _('ICMP connections'),
'unit': '1/s',
'color': '31/a',
}
metric_info['checkpoint_fw_connections_fwconnectionsother'] = {
'title': _('Other connections'),
'unit': '1/s',
'color': '41/a',
}
metric_info['checkpoint_fw_connections_fwconnectionssum'] = {
'title': _('Total connections'),
'unit': '1/s',
'color': '15/a',
}
metric_info['checkpoint_fw_connections_fwconnectionrate'] = {
'title': _('Connections rate'),
'unit': '1/s',
'color': '22/a',
}
metric_info['checkpoint_fw_connections_fwcurrentnumconn'] = {
'title': _('Current connections'),
'unit': 'count',
'color': '26/a',
}
metric_info['checkpoint_fw_connections_fwpeaknumconn'] = {
'title': _('Peak Connections'),
'unit': 'count',
'color': '16/a',
}
metric_info['checkpoint_fw_connections_relative'] = {
'title': _('Connections relative'),
'unit': '%',
'color': '36/a',
}
graph_info['checkpoint_fw_connections_fwpeaknumconn'] = {
'title': _('Check Point Firewall Connections absolute'),
'metrics': [
('checkpoint_fw_connections_fwcurrentnumconn', 'area'),
('checkpoint_fw_connections_fwpeaknumconn', 'line'),
],
'scalars': [
('checkpoint_fw_connections_fwcurrentnumconn:crit', _('crit')),
('checkpoint_fw_connections_fwcurrentnumconn:warn', _('warn')),
],
}
graph_info['checkpoint_fw_connections_relative'] = {
'title': _('Check Point Firewall Connections relative to connection table limit'),
'metrics': [
('checkpoint_fw_connections_relative', 'area'),
],
'scalars': [
('checkpoint_fw_connections_relative:crit', _('crit')),
('checkpoint_fw_connections_relative:warn', _('warn')),
],
'range': (0, 110),
}
graph_info['checkpoint_fw_connections_fwconnectionstcp'] = {
'title': _('Check Point Firewall Connections per second'),
'metrics': [
('checkpoint_fw_connections_fwconnectionsother', 'stack'),
('checkpoint_fw_connections_fwconnectionsicmp', 'stack'),
('checkpoint_fw_connections_fwconnectionsudp', 'stack'),
('checkpoint_fw_connections_fwconnectionstcp', 'stack'),
('checkpoint_fw_connections_fwconnectionssum', 'line'),
('checkpoint_fw_connections_fwconnectionrate', 'line'),
],
}
perfometer_info.append(('stacked', [
{
'type': 'linear',
'segments': ['checkpoint_fw_connections_relative'],
'total': 100,
},
{
'type': 'logarithmic',
'metric': 'checkpoint_fw_connections_fwconnectionrate',
'half_value': 1000.0,
'exponent': 2,
},
]))
perfometer_info.append(('stacked', [
{
'type': 'logarithmic',
'metric': 'checkpoint_fw_connections_fwcurrentnumconn',
'half_value': 100000.0,
'exponent': 2,
},
{
'type': 'logarithmic',
'metric': 'checkpoint_fw_connections_fwconnectionrate',
'half_value': 1000.0,
'exponent': 2,
},
]))
#!/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 : 2020-06-07
#
# 2023-02-18: moved wato file from ~/local/share/check_mk/... to ~/local/lib/check_mk/...
#
from cmk.gui.i18n import _
from cmk.gui.valuespec import (
Dictionary,
Tuple,
Integer,
Percentage,
)
from cmk.gui.plugins.wato.utils import (
CheckParameterRulespecWithItem,
rulespec_registry,
RulespecGroupCheckParametersNetworking,
)
def _parameter_valuespec_checkpoint_fw_connections():
return Dictionary(
elements=[
('levels_upper_absolute',
Tuple(
title=_('Maximum number of firewall connections'),
help=_('This rule sets upper limits to the current number of connections through '
'a Checkpoint firewall.'),
elements=[
Integer(title=_('Warning at'), minvalue=0, unit=_('connections')),
Integer(title=_('Critical at'), minvalue=0, unit=_('connections')),
])),
('levels_lower_absolute',
Tuple(
title=_('Minimum number of firewall connections'),
help=_('This rule sets lower limits to the current number of connections through '
'a Checkpoint firewall.'),
elements=[
Integer(title=_('Warning blow'), minvalue=0, unit=_('connections')),
Integer(title=_('Critical below'), minvalue=0, unit=_('connections')),
])),
('admin_table_limit',
Integer(
title=_('Admin connection table limit'),
help=_('This rule sets the maximum number of connections through the firewall. This is use full '
'if your firewall is set to automatic connection table limit and you still want '
'relative metrics. This setting takes precedence over the the fwConnTableLimit '
'configured on the firewall (only for monitoring purposes of curse). This value should match'
'the real values of your firewall, if not you might get relative values above 100%.'),
minvalue=0,
unit=_('connections'),
)),
('levels_upper_relative',
Tuple(
title=_('Percentage of maximum connections (only used if a limit is defined on '
'the Check Point device)'),
help=_('This relative threshold can only be used if a maximum number is defined on '
'the firewall side and then read from fwConnTableLimit. By default, this '
'limit is not set in Check Point devices and this check than falls back to '
'the absolute defaults or the ones defined above'),
elements=[
Percentage(
title=_('Warning at'), unit='%', minvalue=0.0, maxvalue=100.0, default_value=80.0),
Percentage(
title=_('Critical at'), unit='%', minvalue=0.0, maxvalue=100.0, default_value=90.0),
])),
('levels_lower_relative',
Tuple(
title=_('Percentage of minimum connections (only used if a limit is defined on '
'the Check Point device)'),
help=_('This relative threshold can only be used if a maximum number is defined on '
'the firewall side and then read from fwConnTableLimit. By default, this '
'limit is not set in Check Point devices and this check than falls back to '
'the absolute defaults or the ones defined above'),
elements=[
Percentage(
title=_('Warning below'), unit='%', minvalue=0.0, maxvalue=100.0),
Percentage(
title=_('Critical below'), unit='%', minvalue=0.0, maxvalue=100.0),
])),
],
# optional_keys=['levels_upper_relative'],
)
rulespec_registry.register(
CheckParameterRulespecWithItem(
check_group_name='checkpoint_fw_connections',
group=RulespecGroupCheckParametersNetworking,
match_type='dict',
parameter_valuespec=_parameter_valuespec_checkpoint_fw_connections,
title=lambda: _('Check Point Firewall Connections'),
))
......@@ -15,7 +15,8 @@
' - Connections rate/s\n'
' - Current connections\n'
' - Peak Connections\n'
' - Current connections relative to table limit (if available)\n'
' - Current connections relative to table limit (if '
'available)\n'
'\n'
'WATO\n'
' - Upper/Lower levels for current connections (absolute)\n'
......@@ -24,12 +25,11 @@
' - Admin connection table limit\n',
'download_url': 'https://thl-cmk.hopto.org',
'files': {'agent_based': ['checkpoint_fw_connections.py'],
'web': ['plugins/metrics/checkpoint_fw_connections.py',
'plugins/wato/checkpoint_fw_connections.py']},
'gui': ['metrics/checkpoint_fw_connections.py',
'wato/checkpoint_fw_connections.py']},
'name': 'checkpoint_fw_connections',
'num_files': 3,
'title': 'Check Point Connections',
'version': '20210825.v.0.0.3a',
'version.min_required': '2.0.0',
'version.packaged': '2021.07.14',
'version.usable_until': None}
'version': '20230303.v.0.0.4',
'version.min_required': '2.1.0',
'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