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

update project

parent 33b8439c
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@
# added redirect_url, remote_ip, scheme, http_version, http_connect
# 2022-02-22: added params for all values
# 2022-02-23: changed items on service info line
#
# 2022-02-28: added expected_strings oprion
# Example output from agent:
#
......@@ -171,6 +171,15 @@ def parse_curl(string_table):
except (IndexError, TypeError, json.JSONDecodeError):
return {}
if 'ERROR' not in section.keys():
if len(string_table) > 1:
# insert splitter, split (and implicit remove splitter), avoid removal of '}{'
for line in string_table[1][0].replace('}{', '}|||{').split('|||'):
# '{'thl-cmk.hopto.org': {'expected_strings': [['string1', 1], ['string2', 1], ['html', 0]]}}'
line = json.loads(line)
# get first key from line
key = list(line.keys())[0]
# update section data for key
section[key].update(line[key])
return section
......@@ -193,17 +202,17 @@ def check_curl(item, params, section: Dict[str, Any]) -> CheckResult:
try:
_data = section[item]
except KeyError:
yield Result(state=State.UNKNOWN, notice='Item not found in agent data')
yield Result(state=State(params['state_item_not_found']), notice='Item not found in agent data')
return
url = _data['url'].replace('://', ': //') # ugly workaround to stop cmk from replacing the url
# url = _data['url'].replace('://', ': //') # ugly workaround to stop cmk from replacing the url
http_return_code = _data['data']['http_code']
ssl_verify_result = _data['data']['ssl_verify_result']
curl_error_code = int(_data['error_level'])
curl_error_code = int(_data['data']['exitcode'])
yield Result(state=State.OK, notice=f'URL from cfg: {url}')
# yield Result(state=State.OK, notice=f'URL from cfg: {url}')
for key, label in [
('url', 'URL from cURL'),
('url', 'URL'),
('redirect_url', 'URL redirect'),
('url_effective', 'URL effective'),
('referer', 'Referer'),
......@@ -245,6 +254,13 @@ def check_curl(item, params, section: Dict[str, Any]) -> CheckResult:
if _data.get('curl_options'):
yield Result(state=State.OK, notice=f'cURL options: {_data["curl_options"]}')
if _data.get('expected_strings'):
for expected_string, result in _data['expected_strings']:
if result == 0:
yield Result(state=State.OK, notice=f'Expected string: "{expected_string}" found')
else:
yield Result(state=State.WARN, notice=f'Expected string: "{expected_string}" not found')
yield Result(state=State.OK, notice=f' ')
yield Result(state=State.OK, notice=f'Performance data:')
......@@ -348,9 +364,11 @@ register.check_plugin(
check_function=check_curl,
check_default_parameters={
'show_raw_data': False,
'state_item_not_found': 3,
'state_http_result_not_200': 1,
'state_curl_result_not_0': 1,
'state_verify_sll_not_0': 1,
'state_expected_str_not_found': 1,
'time_namelookup': {},
'time_connect': {},
'time_appconnect': {},
......
......@@ -20,6 +20,9 @@
# added double quotas to curl options for linux to be equal with windows
# added plugin interval and timeout
# added noproxy option to default settings
# 2022-02-26: removed 'http://' prefix from proxy server address
# added proxy protocol
# 2022-02-27: added expected_strings options
from pathlib import Path
from typing import List, Tuple, Dict
......@@ -70,18 +73,25 @@ def get_curl_files(conf: Tuple[str, Dict[str, List[any]]]) -> FileGenerator:
# }
# }
# )
field_separator: str = '|' # needs matching separator in the shell scripts
options_separator: str = ' '
_os = None
_script = None
if conf[0] == 'linux':
_os = OS.LINUX
_script = 'curl.sh'
_curl_output = '-o /dev/null'
_temp_path = '/var/tmp/'
elif conf[0] == 'windows':
_os = OS.WINDOWS
_script = 'curl.cmd'
_script = 'curl.ps1'
_curl_output = '-o NUL'
_temp_path = 'c:/windows/temp/'
else:
_os = None
_script = None
_curl_output = None
_temp_path = None
field_separator: str = '|' # needs matching separator in the shell scripts
options_separator: str = ' '
options = conf[1].copy()
ca_certs = []
url_cfg_lines = []
......@@ -100,6 +110,7 @@ def get_curl_files(conf: Tuple[str, Dict[str, List[any]]]) -> FileGenerator:
timeout = options['timeout'] * 60 # minutes to seconds
options.pop('timeout')
curl_item = 0
for entry in url_list:
options_array = []
service_name = entry['service_name']
......@@ -118,6 +129,7 @@ def get_curl_files(conf: Tuple[str, Dict[str, List[any]]]) -> FileGenerator:
# adjust per url settings with default settings (tuple)
for key in [
'user_auth',
'expected_strings',
]:
if type(url_settings.get(key)) == tuple:
if type(url_settings[key][1]) == dict:
......@@ -125,18 +137,19 @@ def get_curl_files(conf: Tuple[str, Dict[str, List[any]]]) -> FileGenerator:
# adjust per url settings with default settings (tuple)
for key in [
'http_proxy'
'http_proxy',
]:
if type(url_settings.get(key)) == tuple:
if type(url_settings[key][1]) == dict:
url_settings.update({key: url_settings[key][1]})
# filter options
if url_settings.get('http_proxy'):
if url_settings['http_proxy'] == '--noproxy':
options_array.append("--noproxy '*'")
else:
proxy_server, proxy_port = url_settings['http_proxy']['proxy_server']
options_array.append(f'--proxy http://{proxy_server}:{proxy_port}')
proxy_protocol, proxy_server, proxy_port = url_settings['http_proxy']['proxy_server']
options_array.append(f'{proxy_protocol} {proxy_server}:{proxy_port}')
if url_settings['http_proxy'].get('proxy_auth'):
proxy_user, proxy_password, proxy_auth = url_settings['http_proxy']['proxy_auth']
if proxy_password[0] == 'store':
......@@ -162,11 +175,29 @@ def get_curl_files(conf: Tuple[str, Dict[str, List[any]]]) -> FileGenerator:
options_array.append(f'--cacert {service_name}.pem')
url_settings.pop('ca_cert')
if url_settings.get('expected_strings'):
curl_item += 1
options_array.append(f'-o {_temp_path}curl_output')
yield PluginConfig(
base_os=_os,
lines=url_settings['expected_strings'],
target=Path(f'curl_item_{curl_item}.search'),
include_header=False,
)
url_settings.pop('expected_strings')
else:
options_array.append(_curl_output)
for value in url_settings.values():
options_array.append(value)
curl_options = options_separator.join(options_array)
url_cfg_lines.append(f'{service_name}{field_separator}{url}{field_separator}"{curl_options.strip()}"')
url_cfg_lines.append(
f'{service_name}{field_separator}'
f'{url}{field_separator}'
f'{curl_options.strip()}{field_separator}'
f'curl_item_{curl_item}'
)
yield Plugin(
base_os=_os,
......@@ -181,6 +212,12 @@ def get_curl_files(conf: Tuple[str, Dict[str, List[any]]]) -> FileGenerator:
target=Path('curl.cfg'),
include_header=False,
)
yield PluginConfig(
base_os=_os,
lines=url_cfg_lines,
target=Path('curl.cfg'),
include_header=False,
)
register.bakery_plugin(
......
......@@ -16,7 +16,7 @@
:: 2022-02-22: fixed search for curl.exe
:: 2022-02-23: fixed handling of options from curl.cfg
:: 2022-02-24: removed curl.format, replaced by -w %{json}
::
:: 2022-02-25: removed separate url and error_level from output
echo | set /p="<<<curl:sep(0)>>>"
echo.
......@@ -25,7 +25,7 @@ SETLOCAL ENABLEDELAYEDEXPANSION
set CURL_FORMAT=C:\ProgramData\checkmk\agent\plugins\curl.format
set CURL_CONFIG=C:\ProgramData\checkmk\agent\config\curl.cfg
:: 4x% escapes the single % (don't know why/how)
set CURL_OPTIONS=-q -w %%%%{json} -o NUL -s
set CURL_OPTIONS=-q -w %%%%{json} -s
set CURL_RUN="FIRST"
If Not Exist "%CURL_CONFIG%" (
......@@ -51,7 +51,7 @@ FOR /F "tokens=1,2,3 delims=|" %%a IN ('Type "%CURL_CONFIG%"') DO @call :GET_URL
echo }
goto :EOF
exit 0
:GET_URL
set OPTIONS=%3
......@@ -63,10 +63,9 @@ goto :EOF
set "CURL_RUN=SECOND"
)
echo | set /p=""%1":{"url":"%2","data""
echo | set /p=""%1":{"data""
echo | set /p=:
call "%CURL_EXECUTABLE%" --url %2 %CURL_OPTIONS% %STRIP_OPTIONS%
echo | set /p=,"error_level":%ERRORLEVEL%
call "%CURL_EXECUTABLE%" %CURL_OPTIONS% --url %2 %STRIP_OPTIONS%
echo | set /p=,"curl_options":"%CURL_OPTIONS% %STRIP_OPTIONS%"
echo | set /p=}
goto :EOF
<#
License: GNU General Public License v2
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
Wrapper around: https://curl.se/
2022-02-10: rewritten by thl-cmk[at]outlook.com to output json string
2022-02-16: added file checks for CURL_EXECUTABLE and CURL_FORMAT
2022-02-17: added ERRORLEVEL
2022-02-21: added curl_option to the output
2022-02-22: fixed search for curl.exe
2022-02-23: fixed handling of options from curl.cfg
2022-02-24: removed curl.format, replaced by -w %{json}
2022-02-25: removed separate url and error_level from output
2022-02-27: rewritten with for powershell (from windows cmd)
2022-02-28: added support to search for strings in cURL output
#>
$TEMP_DIR="c:\windows\temp"
# config file directory
$MK_CONFDIR = $env:MK_CONFDIR
# Fallback if no MK_CONFDIR is set
if (!$MK_CONFDIR) {
$MK_CONFDIR= "$env:ProgramData\checkmk\agent\config"
}
Write-Output "<<<curl:sep(0)>>>"
if (Test-Path -Path $MK_CONFDIR\curl.cfg -PathType Leaf) {
$CURL_CONFIG="$MK_CONFDIR\curl.cfg"
} else {
Write-Output '{"ERROR":"config file $MK_CONFDIR\curl.cfg does not exist"}'
exit 0
}
# first check for curl.exe in cmk agent directory
if (Test-Path -Path "C:\ProgramData\checkmk\agent\bin\curl.exe" -PathType Leaf) {
$CURL_EXECUTABLE="C:\ProgramData\checkmk\agent\bin\curl.exe"
# if not found look for system provided file
} elseif (Test-Path -Path "C:\Windows\System32\curl.exe" -PathType Leaf) {
$CURL_EXECUTABLE="C:\Windows\System32\curl.exe"
} else {
Write-Output '{"ERROR":"executable file curl.exe not found"}'
exit 0
}
$CURL_OPTIONS="-q -w %{json} -s"
$CURL_OPTIONS=$CURL_OPTIONS.Substring(0,$CURL_OPTIONS.Length -0)
$CURL_RUN="FIRST"
$CURL_RESULT=""
$CURL_OUTPUT="$TEMP_DIR\curl_output"
Write-Host -NoNewline "{"
foreach($LINE in Get-Content $CURL_CONFIG) {
$SERVICE_NAME=$LINE.split("|")[0]
$URL=$LINE.split("|")[1]
$OPTIONS=$LINE.split("|")[2]
$CURL_ITEM=$LINE.split("|")[3]
if ( $CURL_RUN -eq "SECOND") {
Write-Host -NoNewline ","
} else {
$CURL_RUN="SECOND"
}
if (Test-Path -Path $CURL_OUTPUT -PathType Leaf) {
Remove-Item -Path $CURL_OUTPUT
}
Write-Host -NoNewline """$SERVICE_NAME"":{""data"":"
$RUN="$CURL_EXECUTABLE $CURL_OPTIONS --url $URL $OPTIONS"
$RESULT = . cmd /c "$RUN"
Write-Host -NoNewline $RESULT
Write-Host -NoNewline ",""curl_options"":""$CURL_OPTIONS $OPTIONS""}"
# check for expected strings in output
if (Test-Path -Path "$CURL_OUTPUT" -PathType Leaf) {
if (Test-Path -Path "$MK_CONFDIR/$CURL_ITEM.search" -PathType Leaf) {
$CURL_STRING="FIRST"
$CURL_FILE=Get-Content $CURL_OUTPUT -Raw
$CURL_RESULT="$CURL_RESULT{""$SERVICE_NAME"":{""expected_strings"":["
foreach($SEARCH_STRING in Get-Content $MK_CONFDIR/$CURL_ITEM.search) {
if ( $CURL_STRING -eq "SECOND" ) {
$CURL_RESULT="$CURL_RESULT,"
} else {
$CURL_STRING="SECOND"
}
$CURL_SEARCH=$CURL_FILE.IndexOf($SEARCH_STRING)
$CURL_RESULT="$CURL_RESULT[""$SEARCH_STRING"", $CURL_SEARCH]"
}
$CURL_RESULT="$CURL_RESULT]}}"
}
}
}
Write-Output "}"
Write-Output $CURL_RESULT
# clean up
#if (Test-Path -Path $CURL_OUTPUT -PathType Leaf) {
# Remove-Item -Path $CURL_OUTPUT
#}
exit 0
......@@ -11,15 +11,19 @@
# 2022-02-21: added curl_option to the output
# 2022-02-24: changed to use -w %{json} instead of -w @$curl.format
# extended search for curl executable to agent dir
# 2022-02-25: removed separate url and error_level from output
# 2022-02-27: added support to search for strings in cURL output
# ToDo: add plugin timeout configuration
# ToDo: add plugin timeout enforcement
CONF_DIR="/etc/check_mk"
LIB_DIR="/usr/lib/check_mk_agent"
TEMP_DIR="/var/tmp"
CURL_OPTIONS="-q -w %{json} -o /dev/null -s"
CURL_OPTIONS="-q -w %{json} -s"
CURL_CONFIG=curl.cfg
CURL_RUN=FIRST
CURL_OUTPUT="$TEMP_DIR/curl_output"
printf "<<<curl:sep(0)>>>\n"
......@@ -34,9 +38,9 @@ else
exit
fi
if [ -f "$MK_CONFDIR/$CURL_CONFIG" ]; then
CURL_CONFIG=$MK_CONFDIR/$CURL_CONFIG
CONF_DIR="$MK_CONFDIR"
elif [ -f "$CONF_DIR/$CURL_CONFIG" ]; then
CURL_CONFIG=$CONF_DIR/$CURL_CONFIG
else
......@@ -44,6 +48,12 @@ else
exit
fi
if [ -f "$CURL_RESULT" ]; then
rm "$CURL_RESULT"
fi
CURL_RESULT=""
# start JSON
printf "{"
......@@ -51,27 +61,55 @@ while read -r LINE; do
SERVICE_NAME=$(echo "$LINE" | awk -F'|' '{print $1}')
URL=$(echo "$LINE" | awk -F'|' '{print $2}')
OPTIONS=$(echo "$LINE" | awk -F'|' '{print $3}')
CURL_ITEM=$(echo "$LINE" | awk -F'|' '{print $4}')
# FIELDS=($(awk -F"|" '{$1=$1} 1' <<<"${LINE}"))
if [ "$CURL_RUN" = "SECOND" ]
then
if [ "$CURL_RUN" = "SECOND" ]; then
printf ','
else
CURL_RUN="SECOND"
fi
printf '"%s":{"url":"%s","data":' "$SERVICE_NAME" "$URL"
if [ -f "$CURL_OUTPUT" ]; then
rm "$CURL_OUTPUT"
fi
printf '"%s":{"data":' "$SERVICE_NAME"
# cut double quotas from options, added in bakery to be equal with windows version
$CURL_EXECUTABLE --url $URL $CURL_OPTIONS ${OPTIONS:1:-1}
ERROR_LEVEL=$?
printf ',"error_level":"%s"' "$ERROR_LEVEL"
printf ',"curl_options":"%s %s"}' "$CURL_OPTIONS" "${OPTIONS:1:-1}"
$CURL_EXECUTABLE $CURL_OPTIONS --url $URL $OPTIONS
printf ',"curl_options":"%s %s"}' "$CURL_OPTIONS" "$OPTIONS"
# check for expected strings in output
if [ -f "$CURL_OUTPUT" ]; then
if [ -f "$CONF_DIR/$CURL_ITEM.search" ]; then
CURL_STRING=FIRST
CURL_RESULT=$CURL_RESULT$(printf '{"%s":{"expected_strings":[' $SERVICE_NAME)
while read -r SEARCH_STRING; do
if [ "$CURL_STRING" = "SECOND" ]; then
CURL_RESULT=$CURL_RESULT$(printf ',')
else
CURL_STRING="SECOND"
fi
# ToDo: remove grep, read $CURL_OUTPUT to $CURL_FILE and search in there
grep "$SEARCH_STRING" $CURL_OUTPUT > /dev/null
CURL_RESULT=$CURL_RESULT$(printf '["%s", %s]' $SEARCH_STRING $?)
done <"$CONF_DIR/$CURL_ITEM.search"
CURL_RESULT=$CURL_RESULT$(printf ']}}')
fi
fi
done <"$CURL_CONFIG"
printf "}\n"
# end JSON
echo $CURL_RESULT
# clean up
if [ -f "$CURL_OUTPUT" ]; then
rm "$CURL_OUTPUT"
fi
unset CONF_DIR
unset LIB_DIR
unset CURL_EXECUTABLE
......
No preview for this file type
......@@ -19,12 +19,13 @@
'agents': ['bakery/curl.py',
'plugins/curl.sh',
'plugins/curl.cfg',
'plugins/curl.cmd'],
'plugins/curl.cmd',
'plugins/curl.ps1'],
'web': ['plugins/wato/curl.py', 'plugins/metrics/curl.py']},
'name': 'curl',
'num_files': 7,
'num_files': 8,
'title': 'cURL agent plugin',
'version': '20220125.v0.0.3',
'version': '20220228.v0.0.5',
'version.min_required': '2.0.0',
'version.packaged': '2021.09.20',
'version.usable_until': None}
\ No newline at end of file
......@@ -47,7 +47,7 @@ metric_info['time_starttransfer'] = {
'color': '13/b',
}
metric_info['time_total'] = {
'title': _('Time otal'),
'title': _('Time Total'),
'unit': 's',
'color': '25/a',
}
......
......@@ -23,6 +23,9 @@
# 2022-02-24: changed forbidden_chars from '<>| ' to '"<>#%{}|\^~[]` ' + "'"
# 2022-02-25: added plugin interval and timeout options
# added noproxy option to default settings
# 2022-02-26: added proxy protocol (--socks4, --socks4a, --socks4a, --socks5-hostname)
# 2022-02-27: added expected_strings option to default settings
# 2022-02-28: added expected_strings option to url settings
from cmk.gui.i18n import _
from cmk.gui.valuespec import (
......@@ -37,6 +40,8 @@ from cmk.gui.valuespec import (
UploadOrPasteTextFile,
MonitoringState,
Float,
ListOfStrings,
TextInput,
)
from cmk.gui.plugins.wato import (
rulespec_registry,
......@@ -77,6 +82,12 @@ _limits = [
]
_curl_check_elements = [
('state_item_not_found',
MonitoringState(
default_value=1,
title=_('State on item not found'),
help=_('Monitoring state if the item is not found in the agent data. Default is UNKNOWN.')
)),
('state_http_result_not_200',
MonitoringState(
default_value=1,
......@@ -95,6 +106,13 @@ _curl_check_elements = [
title=_('State on SSL verify not OK'),
help=_('Monitoring state if the SSL verify code is not 0. Default is WARN.')
)),
('state_expected_str_not_found',
MonitoringState(
default_value=1,
title=_('State on expected string not found'),
help=_('Monitoring state if one expected string is not found in the cURL output. Default is WARN.')
)),
]
for key, label, unit in _limits:
......@@ -211,8 +229,16 @@ _option_user_auth = ('user_auth',
'password to authenticate with the server.'
),
elements=[
TextUnicode(title=_('Username'), allow_empty=False, forbidden_chars=forbidden_chars),
PasswordFromStore(title=_('Password of the user'), allow_empty=False),
TextUnicode(
title=_('Username'),
allow_empty=False,
forbidden_chars=forbidden_chars,
placeholder='username',
),
PasswordFromStore(
title=_('Password of the user'),
allow_empty=False,
),
DropdownChoice(
title=_('Authentication method'),
choices=[
......@@ -229,9 +255,18 @@ _option_user_auth = ('user_auth',
_option_proxy_server = ('proxy_server',
Tuple(
title=_('Proxy server'),
show_titles=False,
elements=[
DropdownChoice(
title=_('Protocol'),
choices=[
('--proxy', _('HTTP')),
('--socks4', _('SOCKS4')),
('--socks4a', _('SOCKS4a')),
('--socks5-hostname', _('SOCKS5')),
]),
TextUnicode(
label=_('Proxy server address'),
label=_('Server'),
help=_('Name or IP-address of the proxy server.'),
allow_empty=False,
size=40,
......@@ -239,7 +274,7 @@ _option_proxy_server = ('proxy_server',
forbidden_chars=forbidden_chars,
),
Integer(
label=_('TCP port'),
label=_('Port'),
default_value=3128,
minvalue=1,
maxvalue=65565,
......@@ -257,9 +292,16 @@ _option_proxy_auth = ('proxy_auth',
'password to authenticate with the proxy.'
),
elements=[
TextUnicode(title=_('Proxy username'), allow_empty=False,
forbidden_chars=forbidden_chars),
PasswordFromStore(title=_('Password of the user'), allow_empty=False),
TextUnicode(
title=_('Proxy username'),
allow_empty=False,
forbidden_chars=forbidden_chars,
placeholder='proxyusername',
),
PasswordFromStore(
title=_('Password of the user'),
allow_empty=False,
),
DropdownChoice(
title=_('Authentication method'),
choices=[
......@@ -268,18 +310,19 @@ _option_proxy_auth = ('proxy_auth',
('--proxy-ntlm', _('NTLM authentication')),
('--proxy-negotiate', _('HTTP Negotiate (SPNEGO) authentication')),
('--proxy-anyauth', _('Any authentication')),
('--socks5-basic', _('SOCKS5 basic authentication')),
]),
],
))
_options_proxy = ('http_proxy',
CascadingDropdown(
title=_('HTTP proxy'),
title=_('Proxy'),
sorted=False,
choices=[
('http_proxy', _('Use HTTP proxy'),
('http_proxy', _('Use proxy'),
Dictionary(
title='Use HTTP proxy',
title='Use proxy',
elements=[
_option_proxy_server,
_option_proxy_auth,
......@@ -321,6 +364,27 @@ _option_http_version = ('http_verion',
('--http1.0', _('Use HTTP 1.0')),
]),)
_option_address_resolution = ('ip_address_resolution',
DropdownChoice(
title=_('IP stack'),
choices=[
('', _('IPv4 and IPv6')),
('--ipv4', _('IPv4 only')),
('--ipv6', _('IPv6 only')),
]),)
_option_expected_strings = ('expected_strings',
ListOfStrings(
title=_('Strings to expect in response'),
# orientation='horizontal',
allow_empty=False,
valuespec=TextInput(allow_empty=False, regex='[a-zA-Z0-9\.]'),
help=_(
'Strings to expect in the cURL output. To search in response headers the option '
'"Header only" must be activated.'
),
))
_option_url_settings = ('url_settings',
Dictionary(
title=_('Override default settings'),
......@@ -343,6 +407,7 @@ _option_url_settings = ('url_settings',
)),
_option_tls_ssl_version,
_option_http_version,
_option_address_resolution,
('get_header_only',
DropdownChoice(
title=_('Header only'),
......@@ -353,7 +418,7 @@ _option_url_settings = ('url_settings',
)),
('user_auth',
CascadingDropdown(
title=_('Aurthentication'),
title=_('User authentication'),
sorted=False,
choices=[
('user_auth', _('Authenticate user'),
......@@ -369,12 +434,12 @@ _option_url_settings = ('url_settings',
)),
('http_proxy',
CascadingDropdown(
title=_('HTTP proxy'),
title=_('Proxy'),
sorted=False,
choices=[
('http_proxy', _('Use HTTP proxy'),
('http_proxy', _('Use proxy'),
Dictionary(
title='Use HTTP proxy',
title='Use proxy',
elements=[
_option_proxy_server,
_option_proxy_auth,
......@@ -382,7 +447,24 @@ _option_url_settings = ('url_settings',
required_keys=['proxy_server'],
)),
('--noproxy', _('Don\'t use any proxy')),
('', _('Don\'t configure an HTTP proxy')),
('', _('Don\'t configure an proxy')),
],
)),
('expected_strings',
CascadingDropdown(
title=_('Strings to expect in response'),
sorted=False,
choices=[
('expected_strings', _('Expected strings'),
Dictionary(
# title='Use proxy',
elements=[
_option_expected_strings,
],
required_keys=['expected_strings'],
)),
('', _('Don\'t expect any strings in response')),
],
)),
......@@ -429,14 +511,16 @@ _option_default_settings = ('default_settings',
_options_ssl_no_verify,
_option_tls_ssl_version,
_option_http_version,
_option_address_resolution,
_options_get_header_only,
_option_user_auth,
_options_proxy,
_option_expected_strings,
# _option_ca_cert,
]
))
_base_options_config_interval = ('interval',
_option_plugin_interval = ('interval',
Integer(
title=_('Plugin run interval'),
minvalue=1,
......@@ -448,7 +532,7 @@ _base_options_config_interval = ('interval',
),
),)
_base_options_config_timeout = ('timeout',
_option_plugin_timeout = ('timeout',
Integer(
title=_('Plugin timeout'),
minvalue=1,
......@@ -456,14 +540,14 @@ _base_options_config_timeout = ('timeout',
# default_value=300,
help=_(
'This is the maximum run time for the plugin. If not set the timeout for '
'the plugin is 1 minuteby default.'
'the plugin is 1 minute by default.'
),
),)
elements = [
_option_url,
_base_options_config_interval,
_base_options_config_timeout,
_option_plugin_interval,
_option_plugin_timeout,
_option_default_settings
]
......
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