创建
这个方法可以用来创建主机。
这个方法仅允许 管理员 和 超级管理员 用户类型。可以在用户角色中撤销调用方法的权限设置。参考 获取详情
参数
(对象/数组)
要创建的主机。
另外,对于,该方法接受下列参数。
示例
创建一个主机
创建一个具有IP接口和标签的“Linux Server”主机,将其添加到主机组中,链接一个模板并且把MAC地址设置到主机资产清单里。
请求:
响应:
{
"jsonrpc": "2.0",
"result": {
"hostids": [
},
"id": 1
}
创建一个具有SNMP接口的主机
创建一个名为“SNMP host”的主机,并创建SNMPv3接口。
响应:
{
"jsonrpc": "2.0",
"result": {
"hostids": [
"10658"
]
},
}
Creating a host with PSK encryption configured
Create a host called “PSK host” with PSK encryption configured only for connections from Zabbix server to host. Note that the Zabbix agent that is installed on the host has to be configured to .
Response:
"jsonrpc": "2.0",
"result": {
"hostids": [
"10590"
]
},
"id": 1
}