< Back

Get-ZabbixHost

Sun Jan 19, 2020 6:10 pm

NAME Get-ZabbixHost



SYNOPSIS

Get hosts





SYNTAX

Get-ZabbixHost [[-HostName] <Object>] [[-HostID] <Array>] [[-GroupID] <Array>] [[-HttpTestID] <Array>] [[-SortBy]

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

[<CommonParameters>]





DESCRIPTION

Get hosts





PARAMETERS

-HostName <Object>

To filter by HostName of the host (case sensitive)



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-HostID <Array>

To filter by HostID of the host



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-GroupID <Array>



Required? false

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-HttpTestID <Array>



Required? false

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SortBy <String>



Required? false

Position? 5

Default value name

Accept pipeline input? false

Accept wildcard characters? false



-status <String>



Required? false

Position? 6

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-jsonrpc <String>



Required? false

Position? 7

Default value ($global:zabSessionParams.jsonrpc)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-session <String>



Required? false

Position? 8

Default value ($global:zabSessionParams.session)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-id <String>



Required? false

Position? 9

Default value ($global:zabSessionParams.id)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-URL <String>



Required? false

Position? 10

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



Get all hosts









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



PS C:\\>Get-ZabbixHost -HostName SomeHost



Get host by name (case sensitive)









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



PS C:\\>Get-ZabbixHost | ? name -match host | select hostid,host,status,available,httptests



Get host(s) by name match (case insensitive)









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



PS C:\\>Get-ZabbixHost | ? name -match host | select -ExpandProperty interfaces -Property name | sort name



Get hosts' interfaces by host name match (case insensitive)









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



PS C:\\>Get-ZabbixHost | ? name -match host | Get-ZabbixTemplate | select templateid,name -Unique



Get templates by name match (case insensitive)









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



PS C:\\>Get-ZabbixHost | ? status -eq 1 | select hostid,name



Get only disabled hosts









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



PS C:\\>Get-ZabbixHost -sortby name | ? name -match host | select hostid,host,status -ExpandProperty httptests



Get host(s) by name match (case insensitive), sort by name. Possible values are: hostid, host, name (default),

status









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



PS C:\\>Get-ZabbixHost | ? name -match HostName | select name,*error* | ft -a



Get all errors for hosts









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



PS C:\\>Get-ZabbixHost | ? name -match HostName | select name,*jmx* | ft -a



Get info regarding JMX connections for hosts









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



PS C:\\>Get-ZabbixHost | ? name -match "" | ? jmx_available -match 1 | select hostid,name,jmx_available



Get host(s) with JMX interface(s) active









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



PS C:\\>Get-ZabbixHost | ? parentTemplates -match "jmx" | select hostid,name,available,jmx_available



Get host(s) with JMX Templates and get their connection status









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



PS C:\\>Get-ZabbixHost | ? status -eq 0 | ? available -eq 0 | select hostid,name,status,available,jmx_available |

ft -a



Get hosts, which are enabled, but unreachable









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



PS C:\\>Get-ZabbixHost -GroupID (Get-ZabbixGroup -GroupName "groupName").groupid | ? httpTests | select

hostid,host,status,available,httptests | sort host | ft -a



Get host(s) by host group, match name "GroupName" (case sensitive)









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



PS C:\\>Get-ZabbixHost -hostname HostName | Get-ZabbixItem -WebItems -ItemKey web.test.error -ea silent | select

name,key_,lastclock



Get web tests items for the host (HostName is case sensitive)









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



PS C:\\>(Get-ZabbixHost | ? name -match host).parentTemplates.name



Get templates, linked to the host by hostname match (case insensitive)









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



PS C:\\>Get-ZabbixHost | ? name -match hostName | select host -ExpandProperty parentTemplates



Get templates, linked to the host(s)









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



PS C:\\>Get-ZabbixHost | ? parentTemplates -match "jmx" | select name -Unique



Get hosts with templates, by template name match









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



PS C:\\>Get-ZabbixHost -HostName HostName | Get-ZabbixItem -WebItems -ItemKey web.test.error -ea silent | select

name,key_,@{n='lastclock';e={convertFrom-epoch $_.lastclock}}



Get Items for the host. Item lastclock (last time it happened in UTC)









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



PS C:\\>Get-ZabbixHost -hostname HostName | Get-ZabbixHttpTest -ea silent | select httptestid,name,steps



Get host (case sensitive) and it's HttpTests









-------------------------- EXAMPLE 20 --------------------------



PS C:\\>Get-ZabbixHost -hostname HostName | Get-ZabbixHttpTest -ea silent | select -ExpandProperty steps | ft -a



Get host (case sensitive) and it's HttpTests









-------------------------- EXAMPLE 21 --------------------------



PS C:\\>Get-ZabbixHost | ? name -match hostName | select host -ExpandProperty interfaces | ? port -match 10050



Get interfaces for the host(s)









-------------------------- EXAMPLE 22 --------------------------



PS C:\\>Get-ZabbixHost | ? name -match hostname | Get-ZabbixHostInterface | ? port -match 10050 | ft -a



Get interfaces for the host(s)









-------------------------- EXAMPLE 23 --------------------------



PS C:\\>Get-ZabbixHost | ? name -match hostsName | %{$n=$_.name; Get-ZabbixHostInterface -HostID $_.hostid} |

select @{n="name";e={$n}},hostid,interfaceid,ip,port | sort name | ft -a



Get interface(s) for the host(s)











RELATED LINKS