< Back

Set-ZabbixTemplate

Sun Jan 19, 2020 6:15 pm

NAME Set-ZabbixTemplate



SYNOPSIS

Update template





SYNTAX

Set-ZabbixTemplate [[-TemplateHostName] <String>] [[-TemplateVisibleName] <String>] [[-TemplateDescription]

<String>] [[-TemplateID] <String>] [[-GroupsID] <Array>] [[-TemplatesID] <Array>] [[-HostsID] <Array>] [[-groups]

<Array>] [[-templates] <Array>] [[-hosts] <Array>] [[-jsonrpc] <String>] [[-session] <String>] [[-id] <String>]

[[-URL] <String>] [<CommonParameters>]





DESCRIPTION

Update template





PARAMETERS

-TemplateHostName <String>

TemplateHostName: Technical name of the template



Required? false

Position? 1

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-TemplateVisibleName <String>

TemplateVisibleName: Visible name of the template



Required? false

Position? 2

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-TemplateDescription <String>

TemplateDescription: Description of the template



Required? false

Position? 3

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-TemplateID <String>

Template ID



Required? false

Position? 4

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-GroupsID <Array>



Required? false

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



-TemplatesID <Array>



Required? false

Position? 6

Default value

Accept pipeline input? false

Accept wildcard characters? false



-HostsID <Array>



Required? false

Position? 7

Default value

Accept pipeline input? false

Accept wildcard characters? false



-groups <Array>



Required? false

Position? 8

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-templates <Array>



Required? false

Position? 9

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-hosts <Array>



Required? false

Position? 10

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-jsonrpc <String>



Required? false

Position? 11

Default value ($global:zabSessionParams.jsonrpc)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-session <String>



Required? false

Position? 12

Default value ($global:zabSessionParams.session)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-id <String>



Required? false

Position? 13

Default value ($global:zabSessionParams.id)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-URL <String>



Required? false

Position? 14

Default value ($global:zabSessionParams.url)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-ZabbixTemplate | ? host -match oldTemplateName | Set-ZabbixTemplate -TemplateHostName "newTemplateName"



Update template host name









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-ZabbixTemplate | ? name -match oldTemplateName | Set-ZabbixTemplate -TemplateVisibleName

"newTemplateName"



Update template visible name









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Set-ZabbixTemplate -TemplateVisibleName newTemplateName -TemplateID 10404



Update template visible name









-------------------------- EXAMPLE 4 --------------------------



PS C:\\>Get-ZabbixTemplate | ? name -eq templateName | Set-ZabbixTemplate -TemplateVisibleName VisibleTemplateName

-groups 24,25 -hosts (Get-ZabbixHost | ? name -match host).hostid -Verbose -templates (Get-ZabbixTemplate | ?

name -eq "Template App HTTP Service" ).templateid



Replace values in the template









-------------------------- EXAMPLE 5 --------------------------



PS C:\\>$addTempID=(Get-ZabbixTemplate | ? host -eq currentTemplate).parenttemplates.templateid



$addTempID+=((Get-ZabbixTemplate | ? name -match FTP).templateid)

$addGrpID=(Get-ZabbixTemplate | ? host -eq currentTemplate).groups.groupid

$addGrpID+=(Get-ZabbixHostGroup | ? name -match hostGroup).groupid

Get-ZabbixTemplate | ? name -eq currentTemplate | Set-ZabbixTemplate -GroupsID $addTempID -TemplatesID $addGrpID

-TemplateDescription "TemplateDescription"

This will add new values to already existing ones, i.e add, and not replace











RELATED LINKS