> Web场景对象

以下对象与webcheckAPI直接相关。

> Web scenario object

The following objects are directly related to the webcheck API.

Web场景

Web场景对象具有以下属性。

属性类型说明
httptestidstring(readonly) Web场景的ID
hostid
(required)
stringWeb场景所属主机的ID。
name
(required)
stringWeb场景的名称
agentstring将由Web场景使用的用户代理字符串。

默认: Zabbix
applicationidstringWeb场景所属应用程序的ID。
authenticationinteger将由Web场景使用的身份验证方法。

可能的值:
0 - (默认) 无;
1 - 基本的HTTP认证;
2 - NTLM身份验证
delaystringWeb场景的执行间隔。 接受秒,时间单位后缀和用户宏。

默认: 1m.
headersstring执行请求时将发送的HTTP标题。
http_passwordstring用于认证的密码。

对于具有基本HTTP或NTLM身份验证的Web场景是必需的.
http_proxystring将由Web场景使用的代理http://[username[:password]@]proxy.example.com[:port].
http_userstring用于认证的用户名

对于具有基本HTTP或NTLM身份验证的Web场景,必需。
nextchecktimestamp(readonly)下一个Web场景执行的时间。
retriesintegerWeb场景在失败之前尝试执行每个步骤的次数。

默认: 1.
ssl_cert_filestring用于客户端身份验证的SSL证书文件的名称(必须为PEM格式)。
ssl_key_filestring用于客户端认证的SSL私钥文件的名称(必须为PEM格式)。
ssl_key_passwordstringSSL私钥密码。
statusinteger是否启用了Web方案。

可能的值:
0 - (默认) 启用;
1 -禁用.
templateidstring(readonly) 父模板Web方案的ID。
variablesstringWeb场景变量。
verify_hostinteger验证SSL证书中指定的主机名是否与场景中使用的主机名相匹配。

可能的值:
0 - (默认) 跳过主机验证;
1 - 验证主机。
verify_peerinteger是否验证Web服务器的SSL证书。
\可能的值:
0 - (默认) 跳过对等验证;
1 - 验证对等

Web scenario

The web scenario object has the following properties.

PropertyTypeDescription
httptestidstring(readonly) ID of the web scenario.
hostid
(required)
stringID of the host that the web scenario belongs to.
name
(required)
stringName of the web scenario.
agentstringUser agent string that will be used by the web scenario.

Default: Zabbix
applicationidstringID of the application that the web scenario belongs to.
authenticationintegerAuthentication method that will be used by the web scenario.

Possible values:
0 - (default) none;
1 - basic HTTP authentication;
2 - NTLM authentication.
delaystringExecution interval of the web scenario. Accepts seconds, time unit with suffix and user macro.

Default: 1m.
headersstring (deprecated)
array of HTTP fields
HTTP headers that will be sent when performing a request.
http_passwordstringPassword used for authentication.

Required for web scenarios with basic HTTP or NTLM authentication.
http_proxystringProxy that will be used by the web scenario given as http://[username[:password]@]proxy.example.com[:port].
http_userstringUser name used for authentication.

Required for web scenarios with basic HTTP or NTLM authentication.
nextchecktimestamp(readonly) Time of the next web scenario execution.
retriesintegerNumber of times a web scenario will try to execute each step before failing.

Default: 1.
ssl_cert_filestringName of the SSL certificate file used for client authentication (must be in PEM format).
ssl_key_filestringName of the SSL private key file used for client authentication (must be in PEM format).
ssl_key_passwordstringSSL private key password.
statusintegerWhether the web scenario is enabled.

Possible values are:
0 - (default) enabled;
1 - disabled.
templateidstring(readonly) ID of the parent template web scenario.
variablesstring (deprecated)
array of HTTP fields
Web scenario variables.
verify_hostintegerWhether to verify that the host name specified in the SSL certificate matches the one used in the scenario.

Possible values are:
0 - (default) skip host verification;
1 - verify host.
verify_peerintegerWhether to verify the SSL certificate of the web server.

Possible values are:
0 - (default) skip peer verification;
1 - verify peer.

场景步骤

场景步骤对象定义特定的Web场景检查。 它具有以下属性。

属性类型说明
httpstepidstring(readonly) 情景步骤的ID
name
(required)
string场景步骤的名称。
no
(required)
integerWeb场景中步骤的序列号。
url
(required)
string要检查的URL。
follow_redirectsinteger是否遵循HTTP重定向

可能的值:
0 - 不要重新导向;
1 - (default) 遵循重定向
headersstring (deprecated)
array of HTTP fields
执行请求时将发送的HTTP headers。场景步骤headers将覆盖Web场景指定的HTTP headers。
httptestidstring(readonly) 该步骤所属的Web方案的ID。
postsstring
array of HTTP fields
HTTP POST字符串(原始POST数据)或者一个 HTTP字段 数组 (来自字段数据)。
requiredstring必须在响应中存在的文本。
retrieve_modeinteger方案步骤必须检索的HTTP响应的一部分。
\可能的值:
0 - (default) 仅有文体;
1 - 仅有标题.
status_codesstring所需HTTP状态代码的范围用逗号分隔。
timeoutstring请求超时(秒)。接受秒数,带后缀的时间单位和用户宏。

默认: 15s.
variablesstring (deprecated)
array of HTTP字段
场景步骤变量。
query_fieldsarray of HTTP字段查询字段 - 在执行请求时将添加到URL HTTP字段

对于Web场景和Web场景步骤对象的headersvariables字段,都允许使用HTTP字段类型的字符串和数组。
不推荐使用 headersvariables 的字符串数据类型,将来的版本将删除它们。

Scenario step

The scenario step object defines a specific web scenario check. It has the following properties.

PropertyTypeDescription
httpstepidstring(readonly) ID of the scenario step.
name
(required)
stringName of the scenario step.
no
(required)
integerSequence number of the step in a web scenario.
url
(required)
stringURL to be checked.
follow_redirectsintegerWhether to follow HTTP redirects.

Possible values are:
0 - don’t follow redirects;
1 - (default) follow redirects.
headersstring (deprecated)
array of HTTP fields
HTTP headers that will be sent when performing a request. Scenario step headers will overwrite headers specified for the web scenario.
httptestidstring(readonly) ID of the web scenario that the step belongs to.
postsstring
array of HTTP fields
HTTP POST variables as a string (raw post data) or as an array of HTTP fields (form field data).
requiredstringText that must be present in the response.
retrieve_modeintegerPart of the HTTP response that the scenario step must retrieve.

Possible values are:
0 - (default) only body;
1 - only headers.
status_codesstringRanges of required HTTP status codes separated by commas.
timeoutstringRequest timeout in seconds. Accepts seconds, time unit with suffix and user macro.

Default: 15s.
variablesstring (deprecated)
array of HTTP fields
Scenario step variables.
query_fieldsarray of HTTP fieldsQuery fields - array of HTTP fields that will be added to URL when performing a request

Both string and array of HTTP fields types are allowed for headers and variables fields of both web scenario and web scenario step object.
String data type for headers and variables is deprecated and will be removed in future versions.

HTTP 字段

HTTP字段对象定义名称和值,用于指定查询字段数据的变量,HTTP标头,POST表单字段数据。它具有以下属性。

属性类型说明
name
(required)
stringheader / variable / POST 或者 GET 字段的名称。
value
(required)
stringheader / variable / POST 或者 GET 字段的值。

HTTP field

The HTTP field object defines a name and value that is used to specify variable, HTTP header, POST form field data of query field data. It has the following properties.

PropertyTypeDescription
name
(required)
stringName of header / variable / POST or GET field.
value
(required)
stringValue of header / variable / POST or GET field.