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

update project

parent ab963fe3
No related branches found
No related tags found
No related merge requests found
......@@ -461,7 +461,7 @@ def check_curl(item, params, section: Dict[str, Any]) -> CheckResult:
if show_session_info and _data.get('TLS_INFO'):
yield Result(state=State.OK, notice=f' ')
yield Result(state=State.OK, notice=f'TLS/SSL info:')
yield Result(state=State.OK, notice=f'TLS/SSL/SSH info:')
for line in _data['TLS_INFO']:
if line:
yield Result(state=State.OK, notice=f'{line}')
......
......@@ -44,7 +44,10 @@
# 2022-03-21: fixed handling of limits and sub directories from wato
# 2022-03-24: added options --hostpubmd5, --hostpubsha256, --pubkey
# 2022-03-24: added options --key --passs
# 2022-03-25: added options --compressed-ssh, --list-only, --use-ascii
# added options --path-as-is, --ssl-allow-beast, --no-buffer, --no-keepalive, --no-sessionid
#
from pathlib import Path
from typing import List, Tuple, Dict
......@@ -60,7 +63,7 @@ from cmk.base.cee.plugins.bakery.bakery_api.v1 import (
)
bakery_version = '20220324.v0.0.6'
bakery_version = '20220325.v0.0.6'
def get_curl_files(conf: Tuple[str, Dict[str, List[any]]]) -> FileGenerator:
......@@ -343,11 +346,22 @@ def get_curl_files(conf: Tuple[str, Dict[str, List[any]]]) -> FileGenerator:
url_settings.pop('cert_verify')
if url_settings.get('advanced_settings'):
no_apln, no_npn, tcp_fastopen, tcp_nodelay = url_settings['advanced_settings']
allow_beast, no_apln, no_buffering, no_npn, no_sessionid, no_keepalive, \
path_as_is, tcp_fastopen, tcp_nodelay = url_settings['advanced_settings']
if allow_beast:
options_array.append(f'--ssl-allow-beast')
if no_apln:
options_array.append(f'--no-alpn')
if no_buffering:
options_array.append(f'--no-buffer')
if no_npn:
options_array.append(f'--no-npn')
if no_sessionid:
options_array.append(f'--no-sessionid')
if no_keepalive:
options_array.append(f'--no-keepalive')
if path_as_is:
options_array.append(f'--path-as-is')
if tcp_fastopen:
options_array.append(f'--tcp-fastopen')
if tcp_nodelay:
......@@ -433,6 +447,12 @@ def get_curl_files(conf: Tuple[str, Dict[str, List[any]]]) -> FileGenerator:
if ftp_ssl_ccc:
options_array.append(f'--ftp-ssl-ccc')
options_array.append(f'--ftp-ssl-ccc-mode {ftp_ssl_ccc_mode}')
if ftp_options.get('compressed_ssh'):
options_array.append(f'--compressed-ssh')
if ftp_options.get('list_only'):
options_array.append(f'--list-only')
if ftp_options.get('use_ascii'):
options_array.append(f'--use-ascii')
url_settings.pop('ftp_settings')
if save_output:
......
......@@ -5,7 +5,7 @@ Author: thl-cmk[at]outlook[dot]com
URL : https://thl-cmk.hopto.org
Date : 2022-02-10
based on the work by Christian Wirtz doc[at]snowheaven[dot]de and
based on the work by Christian Wirtz doc[at]snowheaven[dot]de and Ingo Hambrock
Wrapper around: https://curl.se/
......
No preview for this file type
......@@ -5,15 +5,17 @@
'not the monitoring server ;-). Deployment and configuration '
'of the plugin is integrated in the CMK bakery.\n'
'\n'
'The plugin is based on a idea by based on the work by '
'Christian Wirtz doc[at]snowheaven[dot]de and Ingo Hambrock\n'
'This agent plugin for Linux and Windows is build around the '
'curl command line tool from https://curl.se.\n'
'\n'
'The executable is not included in this package. The plugin '
'will use by default the system provided curl executable.\n'
'\n'
'Note: this plugin needs a fairly new version of curl to work. '
'You can use my CMK package "curl_executable.mkp" to deploy a '
'compatible version.\n',
'Note: this plugin needs at leat curl version 7.70.0 from '
'April 29 2020 to work. You can use my CMK package '
'"curl_executable.mkp" to deploy a compatible version.\n',
'download_url': 'https://thl-cmk.hopto.org/gitlab/checkmk/vendor-independent/curl',
'files': {'agent_based': ['curl.py'],
'agents': ['bakery/curl.py', 'plugins/curl.sh', 'plugins/curl.ps1'],
......@@ -21,7 +23,7 @@
'name': 'curl',
'num_files': 6,
'title': 'cURL agent plugin',
'version': '20220324.v0.1.3',
'version': '20220325.v0.1.4',
'version.min_required': '2.0.0',
'version.packaged': '2021.09.20',
'version.usable_until': None}
\ No newline at end of file
......@@ -62,7 +62,10 @@
# 2022-03-24: added options --hostpubmd5, --hostpubsha256, --pubkey
# 2022-03-24: added options --key --passs
# reworked user_auth section
# 2022-03-25: added options --compressed-ssh, --list-only, --use-ascii
# added options --path-as-is, --ssl-allow-beast, --no-buffer, --no-keepalive, --no-sessionid
#
import ipaddress
from cmk.gui.i18n import _
from cmk.gui.exceptions import MKUserError
......@@ -101,7 +104,7 @@ from cmk.gui.cee.plugins.wato.agent_bakery.rulespecs.utils import (
RulespecGroupMonitoringAgentsAgentPlugins,
)
bakery_plugin_version = '20220324.v0.0.6'
bakery_plugin_version = '20220325.v0.0.6'
# unsafe characters https://www.tutorialspoint.com/html/html_url_encoding.htm
forbidden_chars = '"<>#%{}|\^~[]` \''
......@@ -393,8 +396,13 @@ _option_advanced_settings = ('advanced_settings',
Tuple(
title='Advanced settings',
elements=[
Checkbox('Allow SSL beast security flaw to improve interoperability'),
Checkbox('Disable Application Layer Protocol Negotiation (ALPN)'),
Checkbox('Disable buffering of the output stream'),
Checkbox('Disable Next Protocol Negotiation (NPN)'),
Checkbox('Disable SSL session-ID reusing'),
Checkbox('Disable TCP keep alive on the connection'),
Checkbox('Do not squash .. sequences in URL path'),
Checkbox('Use TCP fast open option'),
Checkbox('Use TCP no delay option'),
]
......@@ -648,7 +656,7 @@ _option_address_resolution = ('ip_address_resolution',
_option_ftp_settings = ('ftp_settings',
Foldable(
Dictionary(
title=_('FTP options'),
title=_('FTP/SCP/SFTP options'),
elements=[
('ftp_account', TextUnicode(title=_('Account data string')),),
('ftp_alternate_to_user', TextUnicode(title=_('String to replace USER command'))),
......@@ -713,9 +721,24 @@ _option_ftp_settings = ('ftp_settings',
)
]
)),
('compressed_ssh', FixedValue(
True,
title=_('Enable ssh compression'),
totext=_('enabled'),
)),
('list_only', FixedValue(
True,
title=_('Enable list only'),
totext=_('enabled'),
)),
('use_ascii', FixedValue(
True,
title=_('Enable ASCII transfer'),
totext=_('enabled'),
)),
],
),
title=_('Set FTP options'),
title=_('Set FTP/SCP/SFTP options'),
))
_option_expected_strings = ('expected_strings',
......@@ -982,21 +1005,6 @@ _option_limits = ('limits',
),
title=_('Set connection limits')
))
_url_limits = ('limits',
Foldable(
Dictionary(
title=_('Limits'),
elements=[
_url_limit_rate,
_url_max_file_size,
_url_connect_timeout,
_url_max_time,
_url_speed_limit,
_url_speed_time,
]
),
title=_('Set connection limits')
))
_option_user_agent = ('user_agent',
TextUnicode(
......@@ -1106,7 +1114,7 @@ _option_url_settings = ('url_settings',
_url_user_agent,
_url_header_strings,
_url_expected_strings,
_url_limits,
_option_limits,
_option_address_resolution,
_option_ftp_settings,
_option_tls_ssl_version,
......
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