diff --git a/README.md b/README.md index 7feadfb8d5ae5e47bbe37f78dde2858dfe5ff042..8ae4af02f75f90a52848f34977cdcb24a0726dd0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[PACKAGE]: ../../raw/master/mkp/squid-2.1.0-20231202.mkp "squid-2.1.0-20231202.mkp" +[PACKAGE]: ../../raw/master/mkp/squid-2.1.1-20240514.mkp "squid-2.1.1-20240514.mkp" # Squid Web Proxy This CheckMK plugin monitors the performance of the _**Squid Web Proxy**_. This plugin is intended to use with the Agent Bakery of CheckMK. diff --git a/mkp/squid-2.1.1-20240514.mkp b/mkp/squid-2.1.1-20240514.mkp new file mode 100644 index 0000000000000000000000000000000000000000..00959a093125a037d3348604740b6d8d8112d0d3 Binary files /dev/null and b/mkp/squid-2.1.1-20240514.mkp differ diff --git a/source/gui/wato/squid.py b/source/gui/wato/check_parameters/squid.py similarity index 73% rename from source/gui/wato/squid.py rename to source/gui/wato/check_parameters/squid.py index 2ef9d7249332ff3b084b9b16c84d998e2e5e6895..8dbcdb1d4d64d1d9d2435c388568497482e92964 100644 --- a/source/gui/wato/squid.py +++ b/source/gui/wato/check_parameters/squid.py @@ -18,25 +18,21 @@ # changed cpu_time to cpu_usage # 2023-12-02: add ip_address option for agent plugin # add available_number_of_file_descriptors for check section +# 2024-05-14: moved to check_parameters +# separated WATO for bakery and check in two files from cmk.gui.i18n import _ from cmk.gui.valuespec import ( Dictionary, - Integer, - Tuple, - TextInput, Float, + TextInput, + Tuple, ) from cmk.gui.plugins.wato.utils import ( - rulespec_registry, - HostRulespec, - RulespecGroupCheckParametersApplications, CheckParameterRulespecWithItem, Levels, -) - -from cmk.gui.cee.plugins.wato.agent_bakery.rulespecs.utils import ( - RulespecGroupMonitoringAgentsAgentPlugins, + RulespecGroupCheckParametersApplications, + rulespec_registry, ) @@ -94,33 +90,3 @@ rulespec_registry.register( help='Service name without "Squid" i.e. "DNS response time"', ), )) - - -def _valuespec_agent_squid(): - return Dictionary( - help=_('The plugin <tt>squid</tt> allows monitoring of Squid Web Proxies.'), - title=_('Squid Web Proxy (Linux)'), - elements=[ - ('ip_address', - TextInput( - title=_('IP Address/Hostname'), - help=_('The IP-Address/Hostname squidclient connects to.'), - default_value='localhost', - )), - ('port', - Integer( - title=_('Port number'), - help=_('TCP port number that squidclient connects to.'), - default_value=3128, - )), - ] - ) - - -rulespec_registry.register( - HostRulespec( - group=RulespecGroupMonitoringAgentsAgentPlugins, - name='agent_config:squid', - valuespec=_valuespec_agent_squid, - ) -) diff --git a/source/gui/wato/check_parameters/squid_bakery.py b/source/gui/wato/check_parameters/squid_bakery.py new file mode 100644 index 0000000000000000000000000000000000000000..a028355a2bfe965e11b07806482512d71f6dd9d0 --- /dev/null +++ b/source/gui/wato/check_parameters/squid_bakery.py @@ -0,0 +1,67 @@ +#!/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 : 2023-05-20 + +# based on https://github.com/allangood/check_mk/tree/master/plugins/squid +# +# rewritten for cmk 2.x +# +# 2023-05-20: moved to ~/local/lib/check_mk/gui/plugins/wato +# renamed from check_squid.py to squid.py +# changed client_reqps to client_requests +# changed server_reqps to server_requests +# changed cpu_time to cpu_usage +# 2023-12-02: add ip_address option for agent plugin +# add available_number_of_file_descriptors for check section +# 2024-05-14: moved to check_parameters +# separated WATO for bakery and check in two files + +from cmk.gui.i18n import _ +from cmk.gui.valuespec import ( + Dictionary, + Integer, + TextInput, +) +from cmk.gui.plugins.wato.utils import ( + HostRulespec, + rulespec_registry, +) + +from cmk.gui.cee.plugins.wato.agent_bakery.rulespecs.utils import ( + RulespecGroupMonitoringAgentsAgentPlugins, +) + + +def _valuespec_agent_squid(): + return Dictionary( + help=_('The plugin <tt>squid</tt> allows monitoring of Squid Web Proxies.'), + title=_('Squid Web Proxy (Linux)'), + elements=[ + ('ip_address', + TextInput( + title=_('IP Address/Hostname'), + help=_('The IP-Address/Hostname squidclient connects to.'), + default_value='localhost', + )), + ('port', + Integer( + title=_('Port number'), + help=_('TCP port number that squidclient connects to.'), + default_value=3128, + )), + ] + ) + + +rulespec_registry.register( + HostRulespec( + group=RulespecGroupMonitoringAgentsAgentPlugins, + name='agent_config:squid', + valuespec=_valuespec_agent_squid, + ) +) diff --git a/source/packages/squid b/source/packages/squid index 603c7f9b45ab61f9f77cb7c69bf6fbe062c6b8c6..197e194dc83e76826f66d9ef305dde9e201ada45 100644 --- a/source/packages/squid +++ b/source/packages/squid @@ -9,11 +9,13 @@ 'files': {'agent_based': ['squid.py'], 'agents': ['plugins/squid'], 'checkman': ['squid'], - 'gui': ['wato/squid.py', 'metrics/squid.py'], + 'gui': ['metrics/squid.py', + 'wato/check_parameters/squid.py', + 'wato/check_parameters/squid_bakery.py'], 'lib': ['python3/cmk/base/cee/plugins/bakery/squid.py']}, 'name': 'squid', 'title': 'Squid3 Health Check', - 'version': '2.1.0-20231202', + 'version': '2.1.1-20240514', 'version.min_required': '2.1.0b1', - 'version.packaged': '2.2.0p17', + 'version.packaged': '2.2.0p24', 'version.usable_until': None}