Macro (Host)
define_host_macro
Define a host macro.
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: ✅
define_template_macro
Define a template macro.
Examples
Create a macro named {$SNMP_COMMUNITY} with the value 'public' for a template
Create a macro named {$SITE_URL} with an URL value for a template (automatic name conversion)
Arguments
TEMPLATE_NAME
Name of template 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_host_macros
Show all macros defined for a host.
Arguments
HOSTNAME_OR_ID
Hostname or ID to show macros for
Type: text
Required: ✅
show_macro_hosts
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_macro_templates
Find all templates with a 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
show_template_macros
Show all macros defined for a template.
Arguments
TEMPLATE_NAME_OR_ID
Template name or ID to show macros for
Type: text
Required: ✅