2022 Zabbix中国峰会
2022 Zabbix中国峰会

> Host object 主机对象

The following objects are directly related to the host API.以下是主机API的使用方法。

Host 主机

The host object has the following properties.主机对象拥有以下属性。

属性 类 说明
hostid string (readonly) ID of the host. (只读)主机的ID。
host
(required)
string Technical name of the host. 主机的正式名称。
available integer (readonly) Availability of Zabbix agent. (只读)Zabbix agent的可用性。

Possible values are:可能的值为:
0 - (default) unknown;(默认)未知;
1 - available; 可用;
2 - unavailable.失效
description text Description of the host.主机说明。
disable_until timestamp (readonly) The next polling time of an unavailable Zabbix agent.只读)对失效Zabbix agent下一次的轮询时间。
error string (readonly) Error text if Zabbix agent is unavailable.(只读)Zabbix agent失效的错误文本。
errors_from timestamp (readonly) Time when Zabbix agent became unavailable.(只读)当Zabbix agent失效时的时间。
flags integer (readonly) Origin of the host. (只读)主机的来源。

Possible values: 可能的值为:
0 - a plain host; 普通主机;
4 - a discovered host.自动发现的主机。
inventory_mode integer Host inventory population mode.主机资产清单群体模式。

Possible values are: 可能的值:
-1 - disabled; 已禁用;
0 - (default) manual;(默认)手动;
1 - automatic. 自动。
ipmi_authtype integer IPMI authentication algorithm.IPMI认证算法。

Possible values are:可能的值为:
-1 - (default) default; (默认)默认;
0 - none;无;
1 - MD2;
2 - MD5
4 - straight; 直连;
5 - OEM;原厂;
6 - RMCP+. 远程管理控制协议。
ipmi_available integer (readonly) Availability of IPMI agent. (只读)IPMI agent的可用性。

Possible values are:可能的值为:
0 - (default) unknown;(默认)未知;
1 - available;可用;
2 - unavailable. 失效。
ipmi_disable_until timestamp (readonly) The next polling time of an unavailable IPMI agent. (只读)对失效IPMI agent下一次的轮询时间。
ipmi_error string (readonly) Error text if IPMI agent is unavailable. (只读)IPMI agent失效的错误文本。
ipmi_errors_from timestamp (readonly) Time when IPMI agent became unavailable.(只读)当IPMI agent失效时的时间。
ipmi_password string IPMI password.IPMI密码。
ipmi_privilege integer IPMI privilege level. IPMI特权级别。

Possible values are:可能的值为:
1 - callback;回调;
2 - (default) user;(默认)用户;
3 - operator;操作员;
4 - admin;管理员;
5 - OEM. 原厂。
ipmi_username string IPMI username. IPMI用户名。
jmx_available integer (readonly) Availability of JMX agent. (只读)JMX agent的可用性。

Possible values are:可能的值为:
0 - (default) unknown;(默认)未知;
1 - available;可用;
2 - unavailable.失效。
jmx_disable_until timestamp (readonly) The next polling time of an unavailable JMX agent.(只读)对失效JMX agent下一次的轮询时间。
jmx_error string (readonly) Error text if JMX agent is unavailable. (只读)JMX失效的错误文本。
jmx_errors_from timestamp (readonly) Time when JMX agent became unavailable. (只读)当JMX agent失效时的时间。
maintenance_from timestamp (readonly) Starting time of the effective maintenance. (只读)开始有效管理的时间。
maintenance_status integer (readonly) Effective maintenance status.(只读)有效管理的状态。

Possible values are:可能的值为:
0 - (default) no maintenance;(默认)管理断开;
1 - maintenance in effect.管理有效。
maintenance_type integer (readonly) Effective maintenance type. (只读)有效管理的类型。

Possible values are:可能的值为:
0 - (default) maintenance with data collection;(默认)有数据收集的管理;
1 - maintenance without data collection. 没有数据收集的管理。
maintenanceid string (readonly) ID of the maintenance that is currently in effect on the host.(只读)当前对主机起效的管理ID。
name string Visible name of the host. 主机显示名称。

Default: host property value. 默认:host属性值。
proxy_hostid string ID of the proxy that is used to monitor the host. 用于监控主机的代理服务器 ID。
snmp_available integer (readonly) Availability of SNMP agent. (只读)SNMP agent的可用性。

Possible values are:可能的值为:
0 - (default) unknown;(默认)未知;
1 - available;可用;
2 - unavailable. 失效。
snmp_disable_until timestamp (readonly) The next polling time of an unavailable SNMP agent.(只读)对失效SNMP agent下一次的轮询时间。
snmp_error string (readonly) Error text if SNMP agent is unavailable.(只读)SNMP agent失效的错误文本。
snmp_errors_from timestamp (readonly) Time when SNMP agent became unavailable. (只读)当SNMP agent失效时的时间。
status integer Status and function of the host. 主机的状态和功能。

Possible values are:可能的值为:
0 - (default) monitored host;(默认)已监控主机;
1 - unmonitored host.未监控主机
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。

Host inventory 主机资产清单

The host inventory object has the following properties. 主机资产清单对象有以下属性。

Each property has it's own unique ID number, which is used to associate host inventory fields with items.每一个属性拥有自己唯一的ID编号,用于将主机资产清单字段和事项关联在一起。

ID 属性 类 说明
4 alias string Alias.别名
11 asset_tag string Asset tag.资产编号。
28 chassis string Chassis. 机架。
23 contact string Contact person.联系人。
32 contract_number string Contract number.联系号码。
47 date_hw_decomm string HW decommissioning date. 硬件淘汰时间。
46 date_hw_expiry string HW maintenance expiry date. 硬件维保过期时间。
45 date_hw_install string HW installation date. 硬件安装时间。
44 date_hw_purchase string HW purchase date.硬件购买时间。
34 deployment_status string Deployment status. 部署状态。
14 hardware string Hardware. 硬件设备。
15 hardware_full string Detailed hardware.硬件设备详情。
39 host_netmask string Host subnet mask. 主机子网掩码。
38 host_networks string Host networks.主机网络。
40 host_router string Host router.主机路由。
30 hw_arch string HW architecture.硬件架构。
33 installer_name string Installer name. 安装人员姓名。
24 location string Location. 地点。
25 location_lat string Location latitude. 纬度位置。
26 location_lon string Location longitude.经度位置。
12 macaddress_a string MAC address A. MAC地址一。
13 macaddress_b string MAC address B. MAC地址二。
29 model string Model. 型号。
3 name string Name. 名称。
27 notes string Notes. 注释。
41 oob_ip string OOB IP address. 带外IP地址。
42 oob_netmask string OOB host subnet mask.带外主机子网掩码。
43 oob_router string OOB router. 带外路由。
5 os string OS name.操作系统名称。
6 os_full string Detailed OS name. 详尽操作系统名称。
7 os_short string Short OS name. 简短操作系统名称。
61 poc_1_cell string Primary POC mobile number.主POC移动号码。
58 poc_1_email string Primary email. 主POC邮箱。
57 poc_1_name string Primary POC name. 主POC名称。
63 poc_1_notes string Primary POC notes. 主POC注释。
59 poc_1_phone_a string Primary POC phone A.主POC电话一。
60 poc_1_phone_b string Primary POC phone B. 主POC电话二。
62 poc_1_screen string Primary POC screen name. 主POC显示名。
68 poc_2_cell string Secondary POC mobile number. 次POC移动号码。
65 poc_2_email string Secondary POC email. 次POC邮箱。
64 poc_2_name string Secondary POC name. 次POC名称。
70 poc_2_notes string Secondary POC notes. 次POC注释。
66 poc_2_phone_a string Secondary POC phone A.次POC电话一。
67 poc_2_phone_b string Secondary POC phone B. 次POC电话二。
69 poc_2_screen string Secondary POC screen name. 次POC显示名。
8 serialno_a string Serial number A. 序列号一。
9 serialno_b string Serial number B. 序列号二。
48 site_address_a string Site address A. 所在地址一。
49 site_address_b string Site address B. 所在地址二。
50 site_address_c string Site address C. 所在地址三。
51 site_city string Site city.所在城市。
53 site_country string Site country. 所在国家。
56 site_notes string Site notes. 所在地注解。
55 site_rack string Site rack location. 所在地机柜位置
52 site_state string Site state.所在地说明。
54 site_zip string Site ZIP/postal code. 所在地邮政编码。
16 software string Software.软件。
18 software_app_a string Software application A. 应用软件一。
19 software_app_b string Software application B. 应用软件二。
20 software_app_c string Software application C. 应用软件三。
21 software_app_d string Software application D. 应用软件四。
22 software_app_e string Software application E. 应用软件五。
17 software_full string Software details. 软件详情。
10 tag string Tag. 标签。
1 type string Type. 类型。
2 type_full string Type details. 具体类型。
35 url_a string URL A.网址一。
36 url_b string URL B. 网址二。
37 url_c string URL C.网址三。
31 vendor string Vendor. 供应商。