diff --git a/checkpoint_mho_buffers-0.0.2-20230529.mkp b/checkpoint_mho_buffers-0.0.2-20230529.mkp new file mode 100644 index 0000000000000000000000000000000000000000..4552a472c32472218e7180734397142c222d9551 Binary files /dev/null and b/checkpoint_mho_buffers-0.0.2-20230529.mkp differ diff --git a/checkpoint_mho_buffers.mkp b/checkpoint_mho_buffers.mkp index a5df0745b63a0f2afe7f73902e33f2e782549511..4552a472c32472218e7180734397142c222d9551 100644 Binary files a/checkpoint_mho_buffers.mkp and b/checkpoint_mho_buffers.mkp differ diff --git a/gui/metrics/checkpoint_mho_buffers.py b/gui/metrics/checkpoint_mho_buffers.py new file mode 100644 index 0000000000000000000000000000000000000000..364abd62662454f96236774f50e7f7c022f3907e --- /dev/null +++ b/gui/metrics/checkpoint_mho_buffers.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# + +from cmk.gui.i18n import _ + +from cmk.gui.plugins.metrics.utils import ( + metric_info, + graph_info, + perfometer_info, +) + + +_i = 0 +while _i < 8: + metric_info[f'checkpoint_mho_port_buffer_{_i}_frames'] = { + 'title': _(f'RX buffer {_i} frames'), + 'unit': '1/s', + 'color': f'1{_i // 2 + 1}/{chr(97 + _i % 2)}', + } + metric_info[f'checkpoint_mho_port_buffer_{_i}_octets'] = { + 'title': _(f'RX buffer {_i} octets'), + 'unit': '1/s', + 'color': f'2{_i // 2 + 1}/{chr(97 + _i % 2)}', + } + + metric_info[f'checkpoint_mho_port_buffer_{_i}_discards'] = { + 'title': _(f'RX buffer {_i} discards'), + 'unit': '1/s', + 'color': f'3{_i // 2 + 1}/{chr(97 + _i % 2)}', + } + + _i += 1 + +metric_info['checkpoint_mho_port_buffer_sum_frames'] = { + 'title': _('RX buffer frames summary'), + 'unit': '1/s', + 'color': '15/a', +} +metric_info['checkpoint_mho_port_buffer_sum_octets'] = { + 'title': _('RX buffer octets summary'), + 'unit': '1/s', + 'color': '25/a', +} + +metric_info['checkpoint_mho_port_buffer_sum_discards'] = { + 'title': _('RX buffer discards summary'), + 'unit': '1/s', + 'color': f'35/a', +} + + +graph_info['checkpoint_mho_port_buffer_frames'] = { + 'title': _('Check Point MHO RX buffer frames'), + 'metrics': [ + ('checkpoint_mho_port_buffer_sum_frames', 'line'), + ('checkpoint_mho_port_buffer_0_frames', 'line'), + ('checkpoint_mho_port_buffer_1_frames', 'line'), + ('checkpoint_mho_port_buffer_2_frames', 'line'), + ('checkpoint_mho_port_buffer_3_frames', 'line'), + ('checkpoint_mho_port_buffer_4_frames', 'line'), + ('checkpoint_mho_port_buffer_5_frames', 'line'), + ('checkpoint_mho_port_buffer_6_frames', 'line'), + ('checkpoint_mho_port_buffer_7_frames', 'line'), + ], +} + +graph_info['checkpoint_mho_port_buffer_octets'] = { + 'title': _('Check Point MHO RX buffer octets'), + 'metrics': [ + ('checkpoint_mho_port_buffer_sum_octets', 'line'), + ('checkpoint_mho_port_buffer_0_octets', 'line'), + ('checkpoint_mho_port_buffer_1_octets', 'line'), + ('checkpoint_mho_port_buffer_2_octets', 'line'), + ('checkpoint_mho_port_buffer_3_octets', 'line'), + ('checkpoint_mho_port_buffer_4_octets', 'line'), + ('checkpoint_mho_port_buffer_5_octets', 'line'), + ('checkpoint_mho_port_buffer_6_octets', 'line'), + ('checkpoint_mho_port_buffer_7_octets', 'line'), + ], +} + +graph_info['checkpoint_mho_port_buffer_discards'] = { + 'title': _('Check Point MHO RX buffer discards'), + 'metrics': [ + ('checkpoint_mho_port_buffer_sum_discards', 'line'), + ('checkpoint_mho_port_buffer_0_discards', 'line'), + ('checkpoint_mho_port_buffer_1_discards', 'line'), + ('checkpoint_mho_port_buffer_2_discards', 'line'), + ('checkpoint_mho_port_buffer_3_discards', 'line'), + ('checkpoint_mho_port_buffer_4_discards', 'line'), + ('checkpoint_mho_port_buffer_5_discards', 'line'), + ('checkpoint_mho_port_buffer_6_discards', 'line'), + ('checkpoint_mho_port_buffer_7_discards', 'line'), + ], +} diff --git a/gui/wato/checkpoint_mho_buffers.py b/gui/wato/checkpoint_mho_buffers.py new file mode 100644 index 0000000000000000000000000000000000000000..2040dc49d94c433792fdef89438148f4621d0e43 --- /dev/null +++ b/gui/wato/checkpoint_mho_buffers.py @@ -0,0 +1,49 @@ +#!/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 : 2021-12-02 +# +from cmk.gui.i18n import _ +from cmk.gui.valuespec import ( + Dictionary, + FixedValue, +) + +from cmk.gui.plugins.wato.utils import ( + rulespec_registry, + RulespecGroupCheckParametersDiscovery, + HostRulespec, +) + + +def _valuespec_discovery_checkpoint_mho_buffers(): + return Dictionary( + title=_('Check Point MHO buffers'), + elements=[ + ('add_admin_down', + FixedValue( + False, + title=_('Do not add Admin down ports'), + totext=_('If enabled the plugin will not add ports in Admin down state'), + )), + ('add_link_down', + FixedValue( + False, + title=_('Do not add Link down ports'), + totext=_('If enabled the plugin will not add ports in Link down state'), + )), + ], + ) + + +rulespec_registry.register( + HostRulespec( + group=RulespecGroupCheckParametersDiscovery, + match_type='dict', + name='discovery_checkpoint_mho_buffers', + valuespec=_valuespec_discovery_checkpoint_mho_buffers, + )) diff --git a/packages/checkpoint_mho_buffers b/packages/checkpoint_mho_buffers index 4ade262d22842664ab38fad8638a5061f39f4c8a..ae8a74bb259590edbaf76b4a84ec0b329dbaea76 100644 --- a/packages/checkpoint_mho_buffers +++ b/packages/checkpoint_mho_buffers @@ -4,12 +4,11 @@ 'Tested on Orchestrator MHO-140 with R8020.SP HFA_317\n', 'download_url': 'https://thl-cmk.hopto.org', 'files': {'agent_based': ['checkpoint_mho_buffers.py'], - 'web': ['plugins/metrics/checkpoint_mho_buffers.py', - 'plugins/wato/checkpoint_mho_buffers.py']}, + 'gui': ['metrics/checkpoint_mho_buffers.py', + 'wato/checkpoint_mho_buffers.py']}, 'name': 'checkpoint_mho_buffers', - 'num_files': 3, 'title': 'Check Point MHO port RX buffers', - 'version': '20211130.v0.0.1', - 'version.min_required': '2.0.0', - 'version.packaged': '2021.09.20', + 'version': '0.0.2-20230529', + 'version.min_required': '2.1.0b1', + 'version.packaged': '2.1.0p21', 'version.usable_until': None} \ No newline at end of file