< Back

Get-ZabbixHistory

Sun Jan 19, 2020 6:10 pm

NAME Get-ZabbixHistory



SYNOPSIS

Get History





SYNTAX

Get-ZabbixHistory [[-HostID] <Array>] [[-ItemID] <Array>] [[-TimeFrom] <Object>] [[-TimeTill] <Object>] [[-Limit]

<Object>] [[-SortBy] <Array>] [[-History] <Object>] [[-jsonrpc] <String>] [[-session] <String>] [[-id] <String>]

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





DESCRIPTION

Get History





PARAMETERS

-HostID <Array>



Required? false

Position? 1

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-ItemID <Array>



Required? false

Position? 2

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-TimeFrom <Object>

epoch time

TimeFrom to display the history. Default: -48, form 48 hours ago. Time is in UTC/GMT+0



Required? false

Position? 3

Default value (convertTo-epoch ((get-date).addhours(-48)).ToUniversalTime())

Accept pipeline input? false

Accept wildcard characters? false



-TimeTill <Object>

epoch time

TimeTil to display the history. Default: till now. Time is in UTC/GMT+0



Required? false

Position? 4

Default value (convertTo-epoch ((get-date).addhours(0)).ToUniversalTime())

Accept pipeline input? false

Accept wildcard characters? false



-Limit <Object>

Limit output to #lines. Default: 50



Required? false

Position? 5

Default value 50

Accept pipeline input? false

Accept wildcard characters? false



-SortBy <Array>

can sort by: itemid and clock. Default: by clock.



Required? false

Position? 6

Default value clock

Accept pipeline input? false

Accept wildcard characters? false



-History <Object>

History object type to return: 0 - float; 1 - string; 2 - log; 3 - integer; 4 - text. Default: 1



Required? false

Position? 7

Default value 1

Accept pipeline input? false

Accept wildcard characters? false



-jsonrpc <String>



Required? false

Position? 8

Default value ($global:zabSessionParams.jsonrpc)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-session <String>



Required? false

Position? 9

Default value ($global:zabSessionParams.session)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-id <String>



Required? false

Position? 10

Default value ($global:zabSessionParams.id)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-URL <String>



Required? false

Position? 11

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-ZabbixHistory -ItemID (get-zabbixhost | ? name -match "server" | Get-ZabbixItem | ? name -match "system

information").itemid



Get history for item "system information", for server "server" for last 48 hours (default) present time in UTC/GMT

(default)









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



PS C:\\>Get-ZabbixHistory -ItemID (get-zabbixhost | ? name -match "server" | Get-ZabbixItem | ? name -match "system

information").itemid | select itemid,@{n="clock(UTC-5)";e={(convertfrom-epoch $_.clock).addhours(-5)}},value



Get history for item "system information", for server "server" for last 48 hours (default) present time in

UTC/GMT-5









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



PS C:\\>Get-ZabbixHistory -ItemID (get-zabbixhost -hostname "server" | Get-ZabbixItem -webitems -ItemKey

web.test.error -ea silent).itemid -TimeFrom (convertTo-epoch (get-date).adddays(-10)) | select

itemid,@{n="clock(UTC-5)";e={(convertfrom-epoch $_.clock).addhours(-5)}},value



Get history for web/http test errors for host "server" for last 10 days. present time in UTC/GMT-5











RELATED LINKS