文档
测试

获取主机

POST
api_jsonrpc.php

请求头

参数名
类型
描述
必填
Content-Type
String
请求的 Content-Type 头部必须设置为以下值之一: application/json-rpc, application/json 或 application/jsonrequest
必填

请求参数

参数名
类型
描述
必填
jsonrpc
String
API使用的JSON-RPC协议的版本; API实现JSON-RPC版本2.0;
必填
method
String
调用的API方法; host.get
必填
params
JSON
请求传递参数
必填
output
String
定义所需输出的参数
必填
filter
JSON
仅返回完全匹配指定筛选后的结果。 接受一个数组,其键值为属性名,其值要么是一个单一的值,要么是一个匹配的数组值。 Allows filtering by interface properties.允许通过接口属性筛选。
必填
host
Array
根据名称检索数据
必填
id
String
请求的任意标识符;
必填
auth
String
用户认证令牌;
必填

响应参数

参数名
类型
描述
必填
jsonrpc
string
示例:2.0 JSON-RPC协议的版本;
必填
result
array
数据列表 方法返回的数据;
必填
maintenances
array
数据列表
必填
hostid
string
示例:10160 (readonly) ID of the host. (只读)主机的ID。
必填
proxy_hostid
string
示例:0 ID of the proxy that is used to monitor the host. 用于监控主机的代理服务器 ID。
必填
host
string
示例:server Technical name of the host. 主机的正式名称。
必填
status
string
示例:0 Status and function of the host. 主机的状态和功能。 Possible values are:可能的值为: 0 - (default) monitored host;(默认)已监控主机; 1 - unmonitored host.未监控主机
必填
disable_until
string
示例:0 (readonly) The next polling time of an unavailable agent.只读)对失效agent下一次的轮询时间。
必填
error
string
示例: (readonly) Error text if agent is unavailable.(只读)agent失效的错误文本。
必填
available
string
示例:0 (readonly) Availability of IPMI agent. (只读)IPMI agent的可用性。 Possible values are:可能的值为: 0 - (default) unknown;(默认)未知; 1 - available;可用; 2 - unavailable. 失效
必填
errors_from
string
示例:0 (readonly) Time when agent became unavailable.(只读)当agent失效时的时间。
必填
lastaccess
string
示例:0
必填
ipmi_authtype
string
示例:-1 IPMI authentication algorithm.IPMI认证算法。 Possible values are:可能的值为: -1 - (default) default; (默认)默认; 0 - none;无; 1 - MD2; 2 - MD5 4 - straight; 直连; 5 - OEM;原厂; 6 - RMCP+. 远程管理控制协议。
必填
ipmi_privilege
string
示例:2 IPMI privilege level. IPMI特权级别。 Possible values are:可能的值为: 1 - callback;回调; 2 - (default) user;(默认)用户; 3 - operator;操作员; 4 - admin;管理员; 5 - OEM. 原厂。
必填
ipmi_username
string
示例: IPMI username. IPMI用户名。
必填
ipmi_password
string
示例: IPMI password.IPMI密码。
必填
ipmi_disable_until
string
示例:0 (readonly) The next polling time of an unavailable IPMI agent. (只读)对失效IPMI agent下一次的轮询时间。
必填
ipmi_available
string
示例:0 (readonly) Availability of IPMI agent. (只读)IPMI agent的可用性。 Possible values are:可能的值为: 0 - (default) unknown;(默认)未知; 1 - available;可用; 2 - unavailable. 失效。
必填
snmp_disable_until
string
示例:0 (readonly) The next polling time of an unavailable SNMP agent.(只读)对失效SNMP agent下一次的轮询时间。
必填
snmp_available
string
示例:0 (readonly) Availability of SNMP agent. (只读)SNMP agent的可用性。 Possible values are:可能的值为: 0 - (default) unknown;(默认)未知; 1 - available;可用; 2 - unavailable. 失效。
必填
maintenanceid
string
示例:0 (readonly) ID of the maintenance that is currently in effect on the host.(只读)当前对主机起效的管理ID。
必填
maintenance_status
string
示例:0 (readonly) Effective maintenance status.(只读)有效管理的状态。 Possible values are:可能的值为: 0 - (default) no maintenance;(默认)管理断开; 1 - maintenance in effect.管理有效。
必填
maintenance_type
string
示例:0 (readonly) Effective maintenance type. (只读)有效管理的类型。 Possible values are:可能的值为: 0 - (default) maintenance with data collection;(默认)有数据收集的管理; 1 - maintenance without data collection. 没有数据收集的管理。
必填
maintenance_from
string
示例:0 (readonly) Starting time of the effective maintenance. (只读)开始有效管理的时间。
必填
ipmi_errors_from
string
示例:0 (readonly) Time when IPMI agent became unavailable.(只读)当IPMI agent失效时的时间。
必填
snmp_errors_from
string
示例:0 (readonly) Time when SNMP agent became unavailable. (只读)当SNMP agent失效时的时间。
必填
ipmi_error
string
示例: (readonly) Error text if IPMI agent is unavailable. (只读)IPMI agent失效的错误文本。
必填
snmp_error
string
示例: (readonly) Error text if SNMP agent is unavailable.(只读)SNMP agent失效的错误文本。
必填
jmx_disable_until
string
示例:0 (readonly) The next polling time of an unavailable JMX agent.(只读)对失效JMX agent下一次的轮询时间。
必填
jmx_available
string
示例:0 (readonly) Availability of JMX agent. (只读)JMX agent的可用性。 Possible values are:可能的值为: 0 - (default) unknown;(默认)未知; 1 - available;可用; 2 - unavailable.失效。
必填
jmx_errors_from
string
示例:0 (readonly) Time when JMX agent became unavailable. (只读)当JMX agent失效时的时间。
必填
jmx_error
string
示例: (readonly) Error text if JMX agent is unavailable. (只读)JMX失效的错误文本。
必填
name
string
示例:server Name. 名称。
必填
description
string
示例:The monitoring server. Description of the host.主机说明。
必填
tls_connect
string
示例:1
必填
tls_accept
string
示例:1 has PSK enabled. PSK身份
必填
tls_issuer
string
示例: Certificate issuer. 证书颁布。
必填
tls_subject
string
示例: Certificate subject.证书标题。
必填
tls_psk_identity
string
示例: PSK identity. Required if either tls_connect or tls_accept has PSK enabled. PSK身份,若要启用tls_connect或tls_accept,就必须启用PSK。
必填
tls_psk
string
示例:The preshared key, at least 32 hex digits. Required if either tls_connect or tls_accept has PSK enabled. PSK至少需要32位16进制数字构成。若要启用tls_connect或tls_accept,就必须启用PSK。
必填
id
number
示例:1 相应请求的标识符。
必填

说明 / 示例

请求示例 { "jsonrpc": "2.0", "method": "host.get", "params": { "output": "extend", "filter": { "host": [ "server", "Linux server" ] } }, "auth": "038e1d7b1735c6a5436ee9eae095879e", "id": 1 } { "jsonrpc": "2.0", "result": [ { "maintenances": [], "hostid": "10160", "proxy_hostid": "0", "host": "server", "status": "0", "disable_until": "0", "error": "", "available": "0", "errors_from": "0", "lastaccess": "0", "ipmi_authtype": "-1", "ipmi_privilege": "2", "ipmi_username": "", "ipmi_password": "", "ipmi_disable_until": "0", "ipmi_available": "0", "snmp_disable_until": "0", "snmp_available": "0", "maintenanceid": "0", "maintenance_status": "0", "maintenance_type": "0", "maintenance_from": "0", "ipmi_errors_from": "0", "snmp_errors_from": "0", "ipmi_error": "", "snmp_error": "", "jmx_disable_until": "0", "jmx_available": "0", "jmx_errors_from": "0", "jmx_error": "", "name": "server", "description": "The monitoring server.", "tls_connect": "1", "tls_accept": "1", "tls_issuer": "", "tls_subject": "", "tls_psk_identity": "", "tls_psk": "" }, { "maintenances": [], "hostid": "10167", "proxy_hostid": "0", "host": "Linux server", "status": "0", "disable_until": "0", "error": "", "available": "0", "errors_from": "0", "lastaccess": "0", "ipmi_authtype": "-1", "ipmi_privilege": "2", "ipmi_username": "", "ipmi_password": "", "ipmi_disable_until": "0", "ipmi_available": "0", "snmp_disable_until": "0", "snmp_available": "0", "maintenanceid": "0", "maintenance_status": "0", "maintenance_type": "0", "maintenance_from": "0", "ipmi_errors_from": "0", "snmp_errors_from": "0", "ipmi_error": "", "snmp_error": "", "jmx_disable_until": "0", "jmx_available": "0", "jmx_errors_from": "0", "jmx_error": "", "name": "Linux server", "description": "", "tls_connect": "1", "tls_accept": "1", "tls_issuer": "", "tls_subject": "", "tls_psk_identity": "", "tls_psk": "" } ], "id": 1 }