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:usermacro

Usermacro

Methods

Class containing methods for operations with Usermacros.

MethodsDescription
get() Get usermacro details
createGlobal() Create global usermacros
updateGlobal() Update global usermacros details
deleteGlobal() Delete global usermacros
deleteHostMacro() Delete host usermacros
massAdd() Add usermacros to hosts or templates
massUpdate() Update usermacros for hosts or templates
massRemove() Remove usermacros from hosts or templates

Object details

Host Macro

The table contains complete list of Usermacro attributes.

ParameterTypeDescriptionDetails
hostmacroidintegerHost macro ID
hostidintegerHost ID
macrostringName Name is unique per single host
valuestringValue

Global Macro

The table contains complete list of Global Usermacro attributes.

ParameterTypeDescriptionDetails
hostmacroidintegerHost macro ID
macrostringMacro Name is unique for global usermacros
valuestringValue

Common tasks

The table contains list of common usermacro-related tasks and possible implementation using Zabbix API

TaskHOWTO
Add a usermacro Use method usermacro.massAdd, set hostids and macro objects
Add a global usermacro Use method usermacro.createGlobal
Retrieve usermacro details by Usermacro IDs Use method usermacro.get with parameter usermacroids
Retrieve usermacro details by Usermacro name Use method usermacro.get with parameter filter, specify “macro”:“<your usermacro>“