Zabbix Documentation 1.8

3.04.04.45.0 (current)| In development:5.2 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


Sidebar

api:host:massupdate

massUpdate()

Available since version: 1.8

Parameters

multidimensional array with Hosts data

Parameter Type OptionalDescriptionDetails
hosts array Host objects to update
host string Host name.
groupids array Host group IDs to add host to.
port int Yes Port.
status int Yes Host Status.
useip int Yes Use IP.
dns string Yes DNS.
ip string Yes IP.
proxy_hostid int Yes Proxy Host ID.
useipmi int Yes Use IPMI.
ipmi_ip string Yes IPMI IP.
ipmi_port int Yes IPMI port.
ipmi_authtype int Yes IPMI authentication type.
ipmi_privilegeint Yes IPMI privilege.
ipmi_username string Yes IPMI username.
ipmi_password string Yes IPMI password.

Returns

Parameter Description
resultOperation successful. Result will contain array of updated host IDs.
error In case of any errors

Example

Enable two hosts and switch to monitoring by IP addresses:

{
"jsonrpc":"2.0",
"method":"host.massUpdate",
"params":{
    "hosts":[
         {
            "hostid": "69665"
         },
         {
            "hostid": "69666"
         }
      ],
      "status":0,
      "useip":1
},
"auth":"f223adf833b2bf2ff38574a67bba6372",
"id":2
}
Hosts updated successfully:

{
"jsonrpc":"2.0",
"result":{
   "hostids":["69665","69666"]
},
"id":2
}