Zabbix Documentation 1.8

3.04.04.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


Sidebar

api:template:massadd

Table of Contents

massAdd()

Available since version: 1.8
Mass add template linkage, host linkage, macros, host groups

Parameters

multidimensional array with data

ParameterTypeOptionalDescriptionDetails
templatesarray Template objects to update
templates_linkarray Yes Template objects which should be linked to templates.
hostsarray Yes Host objects which should be linked to templates.
groupsarray Yes Host group objects where templates should be added.
macrosarray Yes Macros objects which should be added to templates.

Returns

ParameterDescription
resultOperation successful. Result will contain array of updated Template IDs.
errorIn case of any errors

Example

Link two Hosts to template with ID “100100000010001”, and add this template to group with ID “100100000000041”

{
"jsonrpc":"2.0",
"method":"template.massAdd",
"params":{
   "templates": [{"templateid": "100100000010001"}],
   "groups": [{"groupid": "100100000000041"}],
   "hosts": [{"hostid": "100100000010092"},{"hostid": "100100000011197"}]
},
"auth":"f223adf833b2bf2ff38574a67bba6372",
"id":2
}

Templates updated successfully:

{
"jsonrpc":"2.0",
"result":{
   "templateids":["100100000010001"]
},
"id":2
}