> Web 场景 object

以下objects与webcheckAPI直接相关.

Web 场景

Web场景 object 具有以下属性。

属性 数据类型 描述
httptestid string (只读) Web场景的ID。
hostid
(required)
string Web场景所属的 主机 的ID。
name
(required)
string Web场景的名称。
agent string Web场景将使用的用户 agent string。

默认值:Zabbix
authentication integer Web场景将使用的认证方法。

可能的值:
0 - (默认) 无;
1 - 基本HTTP认证;
2 - NTLM认证。
delay string Web场景的执行间隔。接受秒数、带后缀的时间单位及用户宏。

默认值:1m。
headers array of HTTP fields 执行请求时将发送的HTTP头。
http_password string 用于基本HTTP或NTLM认证的密码。
http_proxy string Web场景将使用的 Proxy,格式为 http://[用户名[:密码]@]proxy.example.com[:端口]
http_user string 用于基本HTTP或NTLM认证的用户名。
nextcheck timestamp (只读) 下一次Web场景执行的时间。
retries integer Web场景在失败前尝试 execute 每个步骤的次数。

默认值:1。
ssl_cert_file string 用于客户端认证的SSL证书 file 的名称(必须为PEM格式)。
ssl_key_file string 用于客户端认证的SSL私钥 file 的名称(必须为PEM格式)。
ssl_key_password string SSL私钥密码。
status integer Web场景是否启用。

可能的值:
0 - (默认) 启用;
1 - 禁用。
templateid string (只读) 父模板Web场景的ID。
variables array of HTTP fields Web场景变量。
verify_host integer 是否验证连接的 主机 名称与 主机 证书中的名称匹配。

可能的值:
0 - (默认) 跳过 主机 验证;
1 - 验证 主机。
verify_peer integer 是否验证 主机 的证书是真实的。

可能的值:
0 - (默认) 跳过对等验证;
1 - 验证对等。
uuid string 全局唯一标识符,用于将导入的Web场景与已存在的Web场景关联。仅用于模板上的Web场景。

注意,对于某些方法(update、delete),必需/可选参数的组合是不同的。

Web 场景标签

Web场景标签object具有以下属性.

属性 数据类型 描述
tag
(required)
string Web场景标签名称.
value string Web场景标签值.

场景步骤

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

属性 数据类型 描述
httpstepid string (只读) 场景步骤的ID。
name
(required)
string 场景步骤的名称。
no
(required)
integer Web场景中步骤的序列号。
url
(required)
string 要检查的URL。
follow_redirects integer 是否跟随HTTP重定向。

可能的值为:
0 - 不跟随重定向;
1 - (默认) 跟随重定向。
headers array of HTTP fields 执行请求时将发送的HTTP头。场景步骤头将覆盖为Web场景指定的头。
httptestid string (只读) 步骤所属的Web场景的ID。
posts string
array of HTTP fields
HTTP POST变量作为string(原始POST数据)或作为HTTP字段的array(表单字段数据)。
required string 响应中必须存在的文本。
retrieve_mode integer 场景步骤必须检索的HTTP响应部分。

可能的值为:
0 - (默认) 仅正文;
1 - 仅头;
2 - 头和正文。
status_codes string 以逗号分隔的所需HTTP状态码范围。
timeout string 请求超时时间(秒)。接受秒数、带后缀的时间单位和用户宏。

默认: 15s。最大: 1h。最小: 1s。
variables array of HTTP fields 场景步骤变量。
query_fields array of HTTP fields query字段 - 执行请求时将添加到URL的HTTP字段的array

HTTP 字段

HTTP字段object用于定义名称和值,用于指定变量、HTTP头部、POST表单字段数据或query字段数据。它具有以下属性。

属性 数据类型 描述
name
(required)
string 头部/变量/POST或GET字段的名称。
value
(required)
string 头部/变量/POST或GET字段的值。