< Back

Get-ZabbixTrigger

Sun Jan 19, 2020 6:11 pm

NAME Get-ZabbixTrigger



SYNOPSIS

Get trigger





SYNTAX

Get-ZabbixTrigger [-ExpandDescription] [-ExpandExpression] [[-TriggerID] <Array>] [[-HostID] <Array>]

[[-TemplateID] <Array>] [[-jsonrpc] <String>] [[-session] <String>] [[-id] <String>] [[-URL] <String>]

[<CommonParameters>]





DESCRIPTION

Get trigger





PARAMETERS

-ExpandDescription [<SwitchParameter>]



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-ExpandExpression [<SwitchParameter>]



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-TriggerID <Array>

To filter by ID of the trigger



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-HostID <Array>



Required? false

Position? 2

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-TemplateID <Array>



Required? false

Position? 3

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-jsonrpc <String>



Required? false

Position? 4

Default value ($global:zabSessionParams.jsonrpc)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-session <String>



Required? false

Position? 5

Default value ($global:zabSessionParams.session)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-id <String>



Required? false

Position? 6

Default value ($global:zabSessionParams.id)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-URL <String>



Required? false

Position? 7

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-ZabbixTrigger -HostID (Get-ZabbixHost | ? name -match host).hostid | select

status,description,expression



Get triggers from host









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



PS C:\\>Get-ZabbixTrigger -HostID (Get-ZabbixHost | ? name -match host).hostid | ? expression -match system |

select triggerid,status,state,value,expression



Get triggers from host, matches "system" in expression line









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



PS C:\\>Get-ZabbixTrigger -HostID (Get-ZabbixHost | ? name -match host).hostid | ? value -eq 1 | select

@{n='lastchange(UTC)';e={convertFrom-epoch $_.lastchange}},triggerid,status,state,value,expression | ft -a



Get failed triggers from host: values: 0 is OK, 1 is problem









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



PS C:\\>Get-ZabbixTemplate | ? name -match "TemplateName" | Get-ZabbixTrigger | select status,description,expression



Get triggers from template









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



PS C:\\>Get-ZabbixTemplate | ? name -match "Template OS Linux" | Get-ZabbixTrigger | ? status -eq 0 | ? expression

-match system | select status,description,expression



Get triggers from template









-------------------------- EXAMPLE 6 --------------------------



PS C:\\>Get-ZabbixTrigger -TemplateID (Get-ZabbixTemplate | ? name -match Template).templateid -ExpandDescription

-ExpandExpression | ft -a status,description,expression



Get triggers by templateid (-ExpandDescription and -ExpandExpression will show full text instead of ID only)









-------------------------- EXAMPLE 7 --------------------------



PS C:\\>Get-ZabbixTrigger -TemplateID (Get-ZabbixTemplate | ? name -eq "Template OS Linux").templateid | select

status,description,expression



Get list of triggers from templates









-------------------------- EXAMPLE 8 --------------------------



PS C:\\>Get-ZabbixTrigger -ExpandDescription -ExpandExpression | ? description -match "Template" | select

description,expression



Get triggers where description match the string (-ExpandDescription and -ExpandExpression will show full text

instead of ID only)









-------------------------- EXAMPLE 9 --------------------------



PS C:\\>Get-ZabbixHost -HostName HostName | Get-ZabbixTrigger -ea silent | ? status -match 0 | ft -a

status,templateid,description,expression



Get triggers for host (status 0 == enabled, templateid 0 == assigned directly to host, not from template)









-------------------------- EXAMPLE 10 --------------------------



PS C:\\>Get-ZabbixHost | ? name -match host | Get-ZabbixTrigger | select description,expression | ft -a -Wrap



Get triggers for host











RELATED LINKS