< Back

Get-ZabbixHttpTest

Sun Jan 19, 2020 6:11 pm

NAME Get-ZabbixHttpTest



SYNOPSIS

Get web/http test





SYNTAX

Get-ZabbixHttpTest [[-HttpTestID] <Array>] [[-HttpTestName] <Object>] [[-HostID] <Array>] [[-TemplateID] <Array>]

[[-jsonrpc] <String>] [[-session] <String>] [[-id] <String>] [[-URL] <String>] [<CommonParameters>]





DESCRIPTION

Get web/http test





PARAMETERS

-HttpTestID <Array>



Required? false

Position? 1

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-HttpTestName <Object>

To filter by name of the http test



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-HostID <Array>



Required? false

Position? 3

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-TemplateID <Array>



Required? false

Position? 4

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-jsonrpc <String>



Required? false

Position? 5

Default value ($global:zabSessionParams.jsonrpc)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-session <String>



Required? false

Position? 6

Default value ($global:zabSessionParams.session)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-id <String>



Required? false

Position? 7

Default value ($global:zabSessionParams.id)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-URL <String>



Required? false

Position? 8

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-ZabbixHttpTest



Get web/http tests









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



PS C:\\>Get-ZabbixHttpTest | select name -Unique



Get web/http tests









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



PS C:\\>Get-ZabbixHttpTest | ? name -match httpTest | select httptestid,name



Get web/http test by name match (case insensitive)









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



PS C:\\>Get-ZabbixHttpTest | ? name -match httpTest | select steps | select -first 1 | fl *



Get web/http test by name match, first occurrence









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



PS C:\\>Get-ZabbixHttpTest | ? name -like "test*Name" | ? {$_.hosts.host -match "Template name"}) | select

name,@{e={$_.steps.url}},@{n='host';e={$_.hosts.host}} -Unique | sort host



Get web/http test by name (case insensitive)









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



PS C:\\>Get-ZabbixHttpTest -HttpTestID 96



Get web/http test by ID









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



PS C:\\>(Get-ZabbixHttpTest -HttpTestName HttpTestName).hosts.host



Get hosts with web/http test by name match (case sensitive)









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



PS C:\\>Get-ZabbixHttpTest -HostID (Get-ZabbixHost | ? name -match host).hostid | select host -ExpandProperty steps

| ft -a



Get web/http tests by hostname match (case insensitive)









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



PS C:\\>Get-ZabbixTemplate | ? name -eq "Template Name" | get-ZabbixHttpTest | select -ExpandProperty steps | ft -a



Get web/http tests by template name









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



PS C:\\>Get-ZabbixHost | ? name -match host | Get-ZabbixHttpTest | select -ExpandProperty steps



Get web/http tests for hostname match









-------------------------- EXAMPLE 11 --------------------------



PS C:\\>Get-ZabbixHost | ? name -match host -pv hsts | Get-ZabbixHttpTest | select -ExpandProperty steps | select

@{n='Server';e={$hsts.host}},name,httpstepid,httptestid,no,url,timeout,required,status_codes,follow_redirects | ft

-a



Get web/http tests for hostname match









-------------------------- EXAMPLE 12 --------------------------



PS C:\\>Get-ZabbixHttpTest -HostID (Get-ZabbixHost | ? name -eq hostname).hostid | ? name -match "httpTest" | fl

httptestid,name,steps



Get web/http test for host by name (case insensitive), and filter web/http test by test name match (case

insensitive)









-------------------------- EXAMPLE 13 --------------------------



PS C:\\>Get-ZabbixHttpTest -HostID (Get-ZabbixHost | ? name -eq hostname).hostid | ? name -match "httpTest" |

select -ExpandProperty steps



Get web/http test for host by name (case insensitive), and filter web/http test by test name match (case

insensitive)









-------------------------- EXAMPLE 14 --------------------------



PS C:\\>Get-ZabbixHttpTest -HttpTestName SomeHTTPTest | select -Unique



Get web/http test by name (case sensitive)









-------------------------- EXAMPLE 15 --------------------------



PS C:\\>Get-ZabbixHttpTest -HttpTestName HTTPTestName | select name,@{n="host";e={$_.hosts.host}}



Get web/http test by name (case sensitive) and hosts it is assigned to









-------------------------- EXAMPLE 16 --------------------------



PS C:\\>(Get-ZabbixHttpTest | ? name -eq "HTTPTestName").hosts.host | sort



Get hosts by web/http test's name (case insensitive)









-------------------------- EXAMPLE 17 --------------------------



PS C:\\>(Get-ZabbixHttpTest | ? name -eq "httpTestName").hosts.host | ? {$_ -notmatch "template"} | sort



Get only hosts by web/http test name, sorted (templates (not hosts) are sorted out)









-------------------------- EXAMPLE 18 --------------------------



PS C:\\>Get-ZabbixHttpTest | ? name -match httpTestName | select name, @{n="required";e={$_.steps.required}} -Unique



Get web/http test name and field required









-------------------------- EXAMPLE 19 --------------------------



PS C:\\>Get-ZabbixHttpTest | ? name -match httpTestName | select name, @{n="url";e={$_.steps.url}} -Unique



Get web/http test name and field url











RELATED LINKS