Template Group
add_template_to_group
Add templates to groups.
NOTE: Group arguments are interpreted as template groups in >= 6.2, otherwise as host groups.
Arguments
TEMPLATE_NAMES_OR_IDS
Template names or IDs. Comma-separated. Supports wildcards.
Type: text
Required: ✅
GROUP_NAMES_OR_IDS
Host/template group names or IDs. Comma-separated. Supports wildcards.
Type: text
Required: ✅
Options
--strict
Fail if any host groups or templates aren't found. Should not be used in conjunction with wildcards.
Type: boolean
Default: False
create_templategroup
Create a new template group.
Assigns default user group permissions by default.
--rw-groups
defaults to config optionapp.default_admin_usergroups
.--ro-groups
defaults to config optionapp.default_create_user_usergroups
.- Use
--no-usergroup-permissions
to create a group without any user group permissions.
NOTE: Calls create_hostgroup
for Zabbix versions < 6.2.0.
Examples
Create a template group with default user group permissions
Create a template group with specific RO and RW groups
Create a template group with no user group permissions
Arguments
TEMPLATEGROUP
Name of the group.
Type: text
Required: ✅
Options
--rw-groups
<RW_GROUPS>
User group(s) to give read/write permissions. Comma-separated.
Type: text
--ro-groups
<RO_GROUPS>
User group(s) to give read-only permissions. Comma-separated.
Type: text
--no-usergroup-permissions
Do not assign user group permissions.
Type: boolean
Default: False
extend_templategroup
Add all templates from a group to other groups.
Interprets the source group as a template group in >= 6.2, otherwise as a host group.
Does not modify the source group or its templates.
To remove the templates from the source group, use the move_templates
command instead.
Arguments
SRC_GROUP
Group to get templates from.
Type: text
Required: ✅
DEST_GROUP
Group(s) to add templates to. Comma-separated. Supports wildcards.
Type: text
Required: ✅
Options
--dryrun
Show groups and templates without copying.
Type: boolean
Default: False
move_templates
Move all templates from one group to another.
Arguments
SRC_GROUP
Group to move templates from.
Type: text
Required: ✅
DEST_GROUP
Group to move templates to.
Type: text
Required: ✅
Options
--rollback
/--no-rollback
Rollback changes if templates cannot be removed from source group afterwards.
Type: boolean
Default: True
--dryrun
Show templates and groups without making changes.
Type: boolean
Default: False
remove_template_from_group
Remove templates from groups.
Examples
Remove one template from one group
Remove many templates from many groups
Remove all templates starting with 'Apache' from a group
Remove all templates containing 'HTTP' from all groups
Arguments
TEMPLATE_NAMES_OR_IDS
Template names or IDs. Comma-separated. Supports wildcards.
Type: text
Required: ✅
GROUP_NAMES_OR_IDS
Host/template group names or IDs. Comma-separated. Supports wildcards.
Type: text
Required: ✅
Options
--strict
Fail if any host groups or templates aren't found. Should not be used in conjunction with wildcards.
Type: boolean
Default: False
--dryrun
Preview changes.
Type: boolean
Default: False
remove_templategroup
Delete a template group.
NOTE: Calls remove_hostgroup
for Zabbix <6.2.
Arguments
TEMPLATEGROUP
Name of the group to delete.
Type: text
Required: ✅
show_templategroup
Show details for a template group.
Arguments
TEMPLATEGROUP
Name of the group to show. Supports wildcards.
Type: text
Required: ✅
Options
--templates
/--no-templates
Show/hide templates associated with the group.
Type: boolean
Default: True
show_templategroups
Show template groups.
Fetches all groups by default, but can be filtered by name.
Examples
Show all template groups
Show all template groups starting with 'Web-'
Show template groups with 'web' in the name
Arguments
NAME
Name of template group(s). Comma-separated. Supports wildcards.
Type: text
Options
--templates
/--no-templates
Show/hide templates associated with each group.
Type: boolean
Default: True