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

update project

parent 38578295
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,8 @@
# 2023-06-17: added support for predicted levels for connection active
# changed bytes/packets metrics to check_levels/check_levels_predictive
# 2023-06-18: cleanup variable names to better meet python standards
#
# 2023-06-23: fixed _render_per_second to output non scientific format
# changed _render_per_second to match output in metrics
#
# snmpwalk sample
......@@ -55,50 +56,16 @@
# .1.3.6.1.4.1.2620.1.16.23.1.1.12.3.0 = STRING: "7074"
# .1.3.6.1.4.1.2620.1.16.23.1.1.13.3.0 = INTEGER: 0
#
# sample section
# section = {
# 'VSXGateway': CheckpointVsx(
# vsxStatusVSId='0', vsxStatusVsType='VSX Gateway', vsxStatusMainIP='10.10.2.3',
# vsxStatusPolicyName='Policy1', vsxStatusVsPolicyType='Active',
# vsxStatusSicTrustState='Trust established', vsxStatusHAState='Active',
# vsxStatusVSWeight='0', vsxCountersConnNum=31, vsxCountersConnPeakNum=140,
# vsxCountersConnTableLimit=14900,
# metrics_rate=[
# ('packets_processed', 315101), ('packets_dropped', 23),
# ('packets_accepted', 315078), ('packets_rejected', 0),
# ('bytes_accepted', 196127045), ('bytes_dropped', 1380),
# ('bytes_rejected', 0), ('loggs_send', 534)]
# ),
# 'VSSwitch': CheckpointVsx(
# vsxStatusVSId='2', vsxStatusVsType='Virtual Switch', vsxStatusMainIP='N/A',
# vsxStatusPolicyName='InitialPolicy', vsxStatusVsPolicyType='Initial Policy',
# vsxStatusSicTrustState='Trust established', vsxStatusHAState='N/A',
# vsxStatusVSWeight='0', vsxCountersConnNum=0, vsxCountersConnPeakNum=0,
# vsxCountersConnTableLimit=900,
# metrics_rate=[
# ('packets_processed', 0), ('packets_dropped', 0),
# ('packets_accepted', 0), ('packets_rejected', 0),
# ('bytes_accepted', 0), ('bytes_dropped', 0),
# ('bytes_rejected', 0), ('loggs_send', 3)]),
# 'VirtualSystem': CheckpointVsx(
# vsxStatusVSId='3', vsxStatusVsType='Virtual System',
# vsxStatusMainIP='10.10.30.33', vsxStatusPolicyName='Standard',
# vsxStatusVsPolicyType='Active', vsxStatusSicTrustState='Trust established',
# vsxStatusHAState='Standby', vsxStatusVSWeight='0', vsxCountersConnNum=58,
# vsxCountersConnPeakNum=575, vsxCountersConnTableLimit=999900,
# metrics_rate=[
# ('packets_processed', 9632), ('packets_dropped', 119),
# ('packets_accepted', 9513), ('packets_rejected', 0),
# ('bytes_accepted', 1494138), ('bytes_dropped', 3524),
# ('bytes_rejected', 0), ('loggs_send', 98)]),
# }
#
import ipaddress
import time
from dataclasses import dataclass
from typing import List, Dict, Optional, Any
# import same render function as used for the metrics (undocumented for check API, and metrics as well)
from cmk.utils.render import fmt_number_with_precision
from cmk.base.plugins.agent_based.agent_based_api.v1 import (
register,
Service,
......@@ -149,8 +116,10 @@ class CheckpointVsx:
metrics_rate: List[VsxMetric]
# render the /s in the same way as in the metrics
def _render_per_second(value: float) -> str:
return f'{value:.2}/s'
return fmt_number_with_precision(value, drop_zeroes=True, unit="/s")
# return f'{value:.2f}/s'
def parse_checkpoint_vsx_system(string_table: StringTable) -> Optional[Dict[str, CheckpointVsx]]:
......@@ -334,7 +303,7 @@ def check_checkpoint_vsx_system(item, params, section: Dict[str, CheckpointVsx])
)
except GetRateError:
continue
# yield Metric(name=f'checkpoint_vsx_{key}', value=value, boundaries=(0, None))
yield from check_levels_predictive(
value=value,
metric_name=f'checkpoint_vsx_{metric.name}',
......
title: Check Point VSX gateway state monitoring
title: Check Point VSX device
agents: snmp
catalog: hw/network/checkpoint
license: GPLv2
distribution: https://thl-cmk.hopto.org/gitlab/checkmk/check-point/gateway/checkpoint_vsx_system
author: thl-cmk[at]outlook[dot]com
catalog: see modules/catalog.py for possible values
license: GPL
distribution: check_mk
description:
This plugin monitors the state of Check Point VSX gateways.
With default settings the VSX system gets {critical} if the H/A state is other than activ/standby,
the SIC trust is not established or the policy type is not active. The monitoring state becomes
{warning} if the policy name or the H/A state is differnet from discovery time. All this states are
configurable via WATO.
This plugin monitors the state of Check Point VSX devices.
With default settings the VSX system gets {critical} if the H/A state is other than active/standby,
the SIC trust is not established or the policy type is not active.
The monitoring state becomes {warning} if the policy name or the H/A state is different from discovery time.
All this states are configurable via WATO.
item:
The system name.
The system name of the Virtual device.
discovery:
One service is created for each Virtual device.
perfdata:
This plugin adds the following perfdata:
connections (count)
connections peak (count)
packets processed/s
packets dropped/s
packets accepted/s
packets rejected/s
bytes accepted/s
bytes dropped/s
bytes rejected/s
loggs send/s
One graph for connections active/peak/limit.
One graph for packets/s processed/dropped/accepted/rejected/.
One graph for bytes/s accepted/dropped/rejected,
One graph for loggs send/s
inventory:
By default the inventory will discover {Virtual Systems}. Via WATO you can change this to discover also
the {VSX Gateway} itself, {Virtual Switches} and {Virtual Routers}.
parameters:
Here you can define all the monitoring states.
excample (default) parameters:
{
'state_sic_not_established': 2, # SIC trust is not established
'state_ha_not_act_stb': 2, # H/A state is other than activ/standby
'state_policy_not_installed': 2, # policy type is not active
'state_policy_changed': 1, # policy name changed
'state_ha_changed': 1, # H/A state changed
}
File added
File added
......@@ -7,18 +7,42 @@
# URL : https://thl-cmk.hopto.org
# Date : 2018-03-13
#
# Check Point VSX status metrics plugin
# checkpoint_vsx
# Check Point VSX status metrics plugin checkpoint_vsx_system
#
# 2023-06-23: made '/s' unit output non scientific readable numbers
# set predictive metrics to not auto graph
# 2023-06-26: added definitions for predictive monitoring
#
from cmk.gui.i18n import _
from cmk.gui.plugins.metrics.utils import (
unit_info,
metric_info,
graph_info,
perfometer_info,
check_metrics,
)
# make /s unit to use non scientific but readable numbers
# 60.000.000 -> becomes 60M/s instead of 6e+07/s
from cmk.utils.render import fmt_number_with_precision
from cmk.gui.valuespec import Integer
unit_info["1/s_nonscientific"] = {
"title": _("per second"),
"description": _("Frequency (displayed in events/s)"),
"symbol": _("/s"),
# "render": lambda v: "{}{}".format(scientific(v, 2), _("/s")),
"render": lambda v: fmt_number_with_precision(v, drop_zeroes=True, unit="/s"),
# "js_render": "v => cmk.number_format.scientific(v, 2) + '/s'",
"js_render": "v => cmk.number_format.fmt_number_with_precision(v, cmk.number_format.SIUnitPrefixes, 2, true)"
" + '/s'",
"stepping": "integer", # for vertical graph labels
"valuespec": Integer,
}
metric_info['checkpoint_vsx_connections'] = {
'title': _('Connections active'),
'unit': 'count',
......@@ -37,29 +61,29 @@ metric_info['checkpoint_vsx_connections_limit'] = {
metric_info['checkpoint_vsx_packets_processed'] = {
'title': _('Packets processed'),
'unit': '1/s',
'color': '12/a',
'unit': '1/s_nonscientific',
'color': '13/a',
}
metric_info['checkpoint_vsx_packets_dropped'] = {
'title': _('Packets dropped'),
'unit': '1/s',
'unit': '1/s_nonscientific',
'color': '22/a',
}
metric_info['checkpoint_vsx_packets_accepted'] = {
'title': _('Packets accepted'),
'unit': '1/s',
'unit': '1/s_nonscientific',
'color': '32/a',
}
metric_info['checkpoint_vsx_packets_rejected'] = {
'title': _('Packets rejected'),
'unit': '1/s',
'unit': '1/s_nonscientific',
'color': '42/a',
}
metric_info['checkpoint_vsx_bytes_accepted'] = {
'title': _('Bytes accepted'),
'unit': 'bytes/s',
'color': '13/a',
'color': '16/a',
}
metric_info['checkpoint_vsx_bytes_dropped'] = {
'title': _('Bytes dropped'),
......@@ -74,13 +98,73 @@ metric_info['checkpoint_vsx_bytes_rejected'] = {
metric_info['checkpoint_vsx_loggs_send'] = {
'title': _('Loggs send'),
'unit': '1/s',
'unit': '1/s_nonscientific',
'color': '14/a',
}
metric_info['predict_checkpoint_vsx_connections'] = {
'title': _('Predicted Connections active'),
'unit': 'count',
'color': '26/b',
}
metric_info['predict_checkpoint_vsx_packets_processed'] = {
'title': _('Predicted Packets processed'),
'unit': '1/s_nonscientific',
'color': '13/b',
}
metric_info['predict_checkpoint_vsx_packets_dropped'] = {
'title': _('Predicted Packets dropped'),
'unit': '1/s_nonscientific',
'color': '22/b',
}
metric_info['predict_checkpoint_vsx_packets_accepted'] = {
'title': _('Predicted Packets accepted'),
'unit': '1/s_nonscientific',
'color': '32/b',
}
metric_info['predict_checkpoint_vsx_packets_rejected'] = {
'title': _('Predicted Packets rejected'),
'unit': '1/s_nonscientific',
'color': '42/b',
}
metric_info['predict_checkpoint_vsx_bytes_accepted'] = {
'title': _('Predicted Bytes accepted'),
'unit': 'bytes/s',
'color': '16/b',
}
metric_info['predict_checkpoint_vsx_bytes_dropped'] = {
'title': _('Predicted Bytes dropped'),
'unit': 'bytes/s',
'color': '23/b',
}
metric_info['predict_checkpoint_vsx_bytes_rejected'] = {
'title': _('Predicted Bytes rejected'),
'unit': 'bytes/s',
'color': '33/b',
}
metric_info['predict_checkpoint_vsx_loggs_send'] = {
'title': _('Predicted Loggs send'),
'unit': '1/s_nonscientific',
'color': '14/b',
}
check_metrics['check_mk-checkpoint_vsx_system'] = {
'checkpoint_vsx_connections_peak': {'auto_graph': False},
'checkpoint_vsx_connections_limit': {'auto_graph': False},
'checkpoint_vsx_connections_peak': {'auto_graph': False},
'checkpoint_vsx_connections_limit': {'auto_graph': False},
# no autograph for predictive monitoring
'predict_checkpoint_vsx_connections': {'auto_graph': False},
'predict_checkpoint_vsx_packets_processed': {'auto_graph': False},
'predict_checkpoint_vsx_packets_dropped': {'auto_graph': False},
'predict_checkpoint_vsx_packets_accepted': {'auto_graph': False},
'predict_checkpoint_vsx_packets_rejected': {'auto_graph': False},
'predict_checkpoint_vsx_bytes_accepted': {'auto_graph': False},
'predict_checkpoint_vsx_bytes_dropped': {'auto_graph': False},
'predict_checkpoint_vsx_bytes_rejected': {'auto_graph': False},
'predict_checkpoint_vsx_loggs_send': {'auto_graph': False},
}
graph_info['checkpoint_vsx_connections'] = {
......@@ -109,9 +193,9 @@ graph_info['checkpoint_vsx_packets'] = {
graph_info['checkpoint_vsx_bytes'] = {
'title': _('Check Point VSX: Bytes'),
'metrics': [
('checkpoint_vsx_bytes_rejected', 'line'),
('checkpoint_vsx_bytes_dropped', 'line'),
('checkpoint_vsx_bytes_accepted', 'line'),
('checkpoint_vsx_bytes_rejected', 'stack'),
('checkpoint_vsx_bytes_dropped', 'stack'),
('checkpoint_vsx_bytes_accepted', 'stack'),
]
}
......@@ -126,13 +210,13 @@ perfometer_info.append(('stacked', [
{
'type': 'logarithmic',
'metric': 'checkpoint_vsx_connections',
'half_value': 50000.0,
'half_value': 1000000.0,
'exponent': 2,
},
{
'type': 'logarithmic',
'metric': 'checkpoint_vsx_packets_processed',
'half_value': 50000.0,
'metric': 'checkpoint_vsx_bytes_accepted',
'half_value': 10000000.0,
'exponent': 2,
},
]))
......@@ -16,8 +16,6 @@ from cmk.gui.i18n import _
from cmk.gui.valuespec import (
Dictionary,
TextAscii,
Tuple,
Integer,
MonitoringState,
ListChoice,
TextUnicode,
......@@ -63,7 +61,9 @@ def _parameter_valuespec_checkpoint_vsx_system():
('state_sic_not_established',
MonitoringState(
title=_('State if SIC is not established'),
help=_('Monitoring state if SIC (Secure Internal Communication) is not established. Default is "CRIT"'),
help=_(
'Monitoring state if SIC (Secure Internal Communication) is not established. Default is "CRIT"'
),
default_value=2,
)),
('levels_bytes_accepted', Levels(title=_('Levels for Bytes Accepted'), unit=_('Bytes/s'), )),
......@@ -77,7 +77,6 @@ def _parameter_valuespec_checkpoint_vsx_system():
('levels_packets_processed', Levels(title=_('Levels for Packets Processed'), unit=_('Packets/s'), )),
# added by plugin discovery function -> hidden key
('policyname', TextUnicode()),
# added by plugin discovery function -> hidden key
('ha_state', TextUnicode()),
],
hidden_keys=['policyname', 'ha_state'],
......
{'author': 'Th.L. (thl-cmk[at]outlook[dot]com)',
'description': 'Monitor status of virtual systems in Check Point vsx/vsls '
'cluster.\n'
'description': 'Monitors the status of a Check Point VSX/VSLS system\n'
'\n'
' - creates one check for each virtual system. \n'
' - check goes critical if virtual system status is not '
"'Active' or 'Standby'\n"
' - long output gives details for each virtual system.\n'
' - monitors VSX virtual system counters '
'(connections/packets/bytes/logs).\n'
' - supersedes checkpoint_vsx, checkpoint_vsx_connections, '
'checkpoint_vsx_traffic, checkpoint_vsx_packets and '
'checkpoint_vsx_status\n',
' - creates one service for each discovered system (see '
'Discovery rules)\n'
' Virtual Systems, VSX Gateways, Virtual Routers, Virtual '
'Switches \n'
' - long output includes:\n'
' System name, Main IP, VS ID and type, HA status, SIC '
'status, Weight, Policy name and type\n'
' - performance data include:\n'
' Connections: active/peak/limit\n'
' Packets /s: processed/accepted/dropped/rejected\n'
' Bytes /s: accepted/dropped/rejected\n'
' Logs send /s\n'
' - all performance data allow predictive monitoring\n'
' - monitoring state can be configured for\n'
' HA state not Active/Standby\n'
' HA state has changed from discovery time\n'
' no policy installed\n'
' policy name has changed\n'
' SIC is not established\n'
' - supersedes the build in checks\n'
' checkpoint_vsx\n'
' checkpoint_vsx_connections\n'
' checkpoint_vsx_traffic\n'
' checkpoint_vsx_packets\n'
' checkpoint_vsx_status\n'
' \n',
'download_url': 'https://thl-cmk.hopto.org/gitlab/checkmk/check-point/gateway/checkpoint_vsx_system',
'files': {'agent_based': ['checkpoint_vsx_system.py'],
'checkman': ['checkpoint_vsx_system'],
'gui': ['metrics/checkpoint_vsx_system.py',
'wato/check_parameters/checkpoint_vsx_system.py']},
'name': 'checkpoint_vsx_system',
'title': 'Check Point VSX system status and counter',
'version': '0.5.0-20230619',
'title': 'Check Point VSX status and counters',
'version': '0.5.1-20230626',
'version.min_required': '2.1.0b1',
'version.packaged': '2.2.0p2',
'version.usable_until': None}
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