Macro
define_global_macro
Create a global macro.
Arguments
NAME
Name of the macro
Type: text
Required: ✅
VALUE
Value of the macro
Type: text
Required: ✅
define_host_usermacro
Create or update a host usermacro.
Examples
Create a macro named {$SNMP_COMMUNITY} for a host
Create a macro named {$SITE_URL} for a host (automatic name conversion)
Arguments
HOSTNAME
Host to define macro for.
Type: text
Required: ✅
MACRO_NAME
Name of macro. Names will be converted to the Zabbix format, i.e. site_url
becomes {$SITE_URL}
.
Type: text
Required: ✅
MACRO_VALUE
Default value of macro.
Type: text
Required: ✅
show_global_macros
Show all global macros.
show_host_usermacros
Show all macros defined for a host.
Arguments
HOSTNAME_OR_ID
Hostname or ID to show macros for
Type: text
Required: ✅
show_usermacro_host_list
Find all hosts with a user macro of the given name.
Renders a list of the complete macro object and its hosts in JSON mode.
Arguments
USERMACRO
Name of macro to find hosts with. Macro names are automatically formatted, e.g. site_url
becomes {$SITE_URL}
.
Type: text
Required: ✅
Options
--limit
, -n
<LIMIT>
Limit the number of results. 0 to show all.
Type: integer
Default: 0
show_usermacro_template_list
Find all templates with a user macro of the given name.
Examples
Show all templates with a user macro named {$SNMP_COMMUNITY}
Arguments
MACRO_NAME
Name of the macro to find templates with. Automatically formatted.
Type: text
Required: ✅
Options
--limit
, -n
<LIMIT>
Limit the number of results. 0 to show all.
Type: integer
Default: 0