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

update project

parent 392a0308
No related branches found
No related tags found
No related merge requests found
......@@ -180,8 +180,8 @@ def get_curl_files(conf) -> FileGenerator:
_headers = []
# filter options
_options.append(url_settings['get_header_only']) if url_settings.get('get_header_only') else None
_options.append(url_settings['compressed']) if url_settings.get('compressed') else None
_options.append(f'--head') if url_settings.get('get_header_only') else None
_options.append(f'--compressed') if url_settings.get('compressed') else None
_options.append(f'--max-time {url_settings["max_time"]}') if url_settings.get('max_time') else None
_options.append(f'--speed-time {url_settings["speed_time"]}') if url_settings.get('speed_time') else None
_options.append(f'--connect-timeout {url_settings["connect_timeout"]}') if url_settings.get('connect_timeout') else None
......
No preview for this file type
......@@ -26,7 +26,7 @@
'name': 'curl',
'num_files': 6,
'title': 'cURL agent plugin',
'version': '20220410.v0.1.7',
'version': '20220411.v0.1.7',
'version.min_required': '2.0.0',
'version.packaged': '2021.09.20',
'version.usable_until': None}
\ No newline at end of file
......@@ -69,32 +69,33 @@
# windows/linux summarized under on option, no separate WATO rules per OS necessary anymore
# replaced most CascadingDropdown with Alternative to avoid the need for adusting default and url settings
# in the bakery
# 2020-04-11: fixed user-agent per url (changed from CascadingDropdown to Alternative)
#
import ipaddress
from cmk.gui.i18n import _
from cmk.gui.exceptions import MKUserError
from cmk.gui.valuespec import (
Dictionary,
ListOf,
Age,
Alternative,
CAorCAChain,
CascadingDropdown,
TextUnicode,
Checkbox,
Dictionary,
DropdownChoice,
FixedValue,
Foldable,
Integer,
Tuple,
DropdownChoice,
MonitoringState,
ListOf,
ListOfStrings,
MonitoringState,
Optional,
TextInput,
Checkbox,
TextUnicode,
Transform,
CAorCAChain,
Optional,
Foldable,
Age,
# Url,
Tuple,
UploadOrPasteTextFile,
Alternative,
# Url,
)
from cmk.gui.plugins.wato import (
rulespec_registry,
......@@ -391,7 +392,8 @@ _option_regex_response = ('regex_response',
elements=[
TextUnicode(
label=_('Regular expression'),
placeholder=_('If empty regex search will be disabled')
placeholder=_('If empty regex search will be disabled'),
size=70,
),
Checkbox('Case insensitive'),
Checkbox('Multiline string matching'),
......@@ -417,17 +419,17 @@ _option_advanced_settings = ('advanced_settings',
_options_get_header_only = ('get_header_only',
FixedValue(
'--head',
True,
# help=_('cURL will will only download headers. Implements the "--head" option'),
title=_('Get header only'),
totext=_('Only headers will be downloaded'),
help=_('cURL will will only download headers. Implements the "--head" option'),
totext=_(''),
))
_url_get_header_only = ('get_header_only',
DropdownChoice(
Alternative(
title=_('Get Header only'),
choices=[
('--head', _('Get header only')),
('', _('Get the hole document')),
elements=[
_options_get_header_only[1],
FixedValue(None, title=_('Get the hole document'), totext=_('')),
],
))
......@@ -478,8 +480,12 @@ _option_auth_priv_key = ('priv_key_auth',
title=_('Pass phrase'),
allow_empty=False,
),
Foldable(UploadOrPasteTextFile(title='Private key', file_title='Private key (PEM)'),
title='Private key'),
Foldable(
UploadOrPasteTextFile(
title='Private key',
file_title='Private key (PEM)'
),
title='Private key'),
]
))
_option_auth = ('user_auth',
......@@ -524,7 +530,6 @@ _option_proxy_server = ('proxy_server',
],
orientation='horizontal',
))
_option_proxy_auth = ('proxy_auth',
Tuple(
title=_('Proxy authentication'),
......@@ -556,7 +561,6 @@ _option_proxy_auth = ('proxy_auth',
]),
],
))
_options_proxy = ('http_proxy',
Alternative(
title=_('Configure proxy server'),
......@@ -876,7 +880,7 @@ _option_api_key_header = ('api_key_header',
))
_url_api_key_header = ('api_key_header',
Alternative(
title=_('Set API key header'),
title=_('Override API key header'),
elements=[
_option_api_key_header[1],
FixedValue(None, title=_('Don\'t configure an API key header'), totext=_('')),
......@@ -1059,13 +1063,11 @@ _option_user_agent = ('user_agent',
forbidden_chars='"|'
))
_url_user_agent = ('user_agent',
CascadingDropdown(
title=_('Set user agent'),
sorted=False,
choices=[
('user_agent', _('Override default user agent'),
_option_user_agent[1],),
('', _('Don\'t configure a user agent')),
Alternative(
title=_('Override user agent'),
elements=[
_option_user_agent[1],
FixedValue(None, title=_('Don\'t configure a user agent'), totext=_('')),
],
))
......@@ -1088,20 +1090,20 @@ _url_referer = ('referer',
_options_compressed = ('compressed',
FixedValue(
'--compressed',
True,
title=_('Request compressed response'),
totext=_('Request compressed response enabled'),
totext=_(''),
))
_url_compressed = ('compressed',
DropdownChoice(
Alternative(
title=_('Request compressed response'),
choices=[
('--compressed', _('Request compressed response')),
('', _('Don\'t Request compressed response')),
elements=[
_options_compressed[1],
FixedValue(None, title=_('Don\'t Request compressed response'), totext=_('')),
],
))
_option_post = ('post_binary',
_options_post = ('post_binary',
Tuple(
title=_('Send HTTP POST data'),
elements=[
......@@ -1121,6 +1123,14 @@ _option_post = ('post_binary',
),
]
))
_url_post = ('post_binary',
Alternative(
title=_('Override send HTTP POST data'),
elements=[
_options_post[1],
FixedValue(None, title='Don\'t send HTTP POST data', totext=_('')),
]
))
_option_url_settings = ('url_settings',
Foldable(
......@@ -1134,7 +1144,7 @@ _option_url_settings = ('url_settings',
_url_get_header_only,
_option_regex_response,
_url_compressed,
_option_post,
_url_post,
_url_api_key_header,
_url_referer,
_url_request_headers,
......@@ -1217,7 +1227,7 @@ _option_default_settings = ('default_settings',
_options_get_header_only,
_option_regex_response,
_options_compressed,
_option_post,
_options_post,
_option_api_key_header,
_option_referer,
_option_request_headers,
......
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