Skip to content

Template

link_template_to_host <TEMPLATE_NAMES_OR_IDS> <HOSTNAMES_OR_IDS> [OPTIONS]

Link templates to hosts.

Examples

Link one template to one host

link_template_to_host 'Apache by HTTP' foo.example.com

Link many templates to many hosts

link_template_to_host 'Apache by HTTP,HAProxy by Zabbix agent' foo.example.com,bar.example.com

Link one template to all hosts

link_template_to_host 'Apache by HTTP' '*'

Link many templates to all hosts

link_template_to_host 'Apache by HTTP,HAProxy by Zabbix agent' '*'

Link all templates to all hosts (use with caution!)

link_template_to_host '*' '*'

Arguments

TEMPLATE_NAMES_OR_IDS
Template names or IDs. Comma-separated. Supports wildcards.
Type: text
Required:

HOSTNAMES_OR_IDS
Hostnames or IDs. Comma-separated. Supports wildcards.
Type: text
Required:

Options

--strict
Fail if any hosts or templates aren't found. Should not be used in conjunction with wildcards.
Type: boolean
Default: False

--dryrun
Preview changes.
Type: boolean
Default: False


link_template_to_template <SOURCE> <DEST> [OPTIONS]

Link templates to templates.

NOTE: Destination templates are the ones that are ultimately modified. Source templates remain unchanged.

Examples

Link one template to one template

link_template_to_template 'Apache by HTTP' foo_template

Link many templates to many templates

link_template_to_template 'Apache by HTTP,HAProxy by Zabbix agent' foo_template,bar_template

Link all templates starting with 'Apache' to a template

link_template_to_template 'Apache*' foo_template

Link all templates containing 'HTTP' to a subset of templates

link_template_to_template '*HTTP*' 'Webserver-*'

Arguments

SOURCE
Template names or IDs. Comma-separated. Supports wildcards.
Type: text
Required:

DEST
Template names or IDs. Comma-separated. Supports wildcards.
Type: text
Required:

Options

--strict
Fail if any templates aren't found. Should not be used in conjunction with wildcards.
Type: boolean
Default: False

--dryrun
Do not actually link templates, just show what would be done.
Type: boolean
Default: False


show_items

show_items <TEMPLATE_NAME>

Show a template's items.

Examples

Show items for a template

show_items 'Apache by HTTP'

Arguments

TEMPLATE_NAME
Template name or ID. Supports wildcards.
Type: text
Required:


show_template

show_template <TEMPLATE_NAME>

Show a template.

Arguments

TEMPLATE_NAME
Template name or ID. Names support wildcards.
Type: text
Required:


show_templates

show_templates <TEMPLATES>

Show all templates.

Shows all templates by default. The template name can be a pattern containing wildcards. Names and IDs cannot be mixed.

Arguments

TEMPLATES
Template name(s) or ID(s). Comma-separated. Supports wildcards.
Type: text


unlink_template_from_host <TEMPLATE_NAMES_OR_IDS> <HOSTNAMES_OR_IDS> [OPTIONS]

Unlink templates from hosts.

Unlinks and clears by default. Use --no-clear to unlink without clearing.

Examples

Unlink a template from a host

unlink_template_from_host 'Apache by HTTP' foo.example.com

Unlink many templates from many hosts

unlink_template_from_host 'Apache by HTTP,HAProxy by Zabbix agent' foo.example.com,bar.example.com

Unlink one template from all hosts

unlink_template_from_host 'Apache by HTTP' '*'

Unlink templates starting with 'Apache' from hosts starting with 'Web'

unlink_template_from_host 'Apache*' 'Web-*'

Unlink template from host without clearing items and triggers

unlink_template_from_host --no-clear 'Apache by HTTP' foo.example.com

Arguments

TEMPLATE_NAMES_OR_IDS
Template names or IDs. Comma-separated. Supports wildcards.
Type: text
Required:

HOSTNAMES_OR_IDS
Hostnames or IDs. Comma-separated. Supports wildcards.
Type: text
Required:

Options

--strict
Fail if any hosts or templates aren't found. Should not be used in conjunction with wildcards.
Type: boolean
Default: False

--dryrun
Preview changes.
Type: boolean
Default: False

--clear/--no-clear
Unlink and clear templates.
Type: boolean
Default: True


unlink_template_from_template <SOURCE> <DEST> [OPTIONS]

Unlink templates from templates.

Unlinks and clears by default. Use --no-clear to unlink without clearing. NOTE: Destination templates are the ones that are ultimately modified. Source templates remain unchanged.

Examples

Unlink one template from one template

unlink_template_from_template 'Apache by HTTP' foo_template

Unlink many templates from many templates

unlink_template_from_template 'Apache by HTTP,HAProxy by Zabbix agent' foo_template,bar_template

Unlink all templates starting with 'Apache' from a template

unlink_template_from_template 'Apache*' foo_template

Unlink all templates containing 'HTTP' from a subset of templates

unlink_template_from_template '*HTTP*' 'Web-*'

Unlink a template without clearing items and triggers

unlink_template_from_template --no-clear foo_template bar_template

Arguments

SOURCE
Template names or IDs. Comma-separated. Supports wildcards.
Type: text
Required:

DEST
Template names or IDs. Comma-separated. Supports wildcards.
Type: text
Required:

Options

--strict
Fail if any templates aren't found. Should not be used in conjunction with wildcards.
Type: boolean
Default: False

--clear/--no-clear
Unlink and clear templates.
Type: boolean
Default: True

--dryrun
Preview changes.
Type: boolean
Default: False