< Back

New-HealthCheck

Sun Jan 19, 2020 5:53 pm

NAME New-HealthCheck



SYNOPSIS

New-HealthCheck will create a new health check.





SYNTAX

New-HealthCheck [[-Name] <String[]>] [[-Tag] <String>] [[-Timeout] <UInt32>] [[-Grace] <UInt32>] [[-Channel]

<String>] [-Force] [[-ApiKey] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

New-HealthCheck will create a new health check.



An API key is required to use this cmdlet.





PARAMETERS

-Name <String[]>

The name of the new check, maximum of 99 characters.



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Tag <String>

Tag(s) for the check, maximum of 499 characters.



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Timeout <UInt32>

Timeout period for the check, maximum 604800 seconds (1 week).



Required? false

Position? 3

Default value 86400

Accept pipeline input? false

Accept wildcard characters? false



-Grace <UInt32>

Grace period for the check, maximum 604800 seconds (1 week).



Required? false

Position? 4

Default value 3600

Accept pipeline input? false

Accept wildcard characters? false



-Channel <String>

Alert channel to send notifications on, maximum of 49 characters.



Required? false

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Force [<SwitchParameter>]

Used to bypass confirmation prompts.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-ApiKey <String>

The Api key for your account.



Required? false

Position? 6

Default value $script:SavedHealthCheckApi

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

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

System.String



This cmdlet takes the check name, tags, channel, and API key as strings.



System.UInt32



This cmdlets takes the grace and timout periods as unsigned, 32 bit integers.





OUTPUTS

Check



This cmdlet returns a check object for new check created.





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



PS C:\\>New-HealthCheck -Name stoic-barbarian-lemur -Tag "prod db-dump"



Grace : 3600

LastPing :

PingCount : 0

Name : stoic-barbarian-lemur

NextPing :

PingURL : https://hchk.io/25c55e7c-8092-4d21-ad06-7dacfbb6fc10

Tags : prod db-dump

Timeout : 86400



The cmdlet above will create a new check with the name of stoic-barbarian-lemur and tags of "prod db-dump".



All other options are set to default and are not required to be specified.









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



PS C:\\>New-HealthCheck



Grace : 3600

LastPing :

PingCount : 0

Name :

NextPing :

PingURL : https://hchk.io/25c55e7c-8092-4d21-ad06-7dacfbb6fc10

Tags :

Timeout : 86400



The cmdlet above will create a new check with all default properties.









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



PS C:\\>New-HealthCheck -Grace 60 -Timeout 60



Grace : 60

LastPing :

PingCount : 0

Name :

NextPing :

PingURL : https://hchk.io/25c55e7c-8092-4d21-ad06-7dacfbb6fc10

Tags :

Timeout : 60



The cmdlet above will create a new check with grace and timeout set to the smallest value of 60 seconds.









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



PS C:\\>New-HealthCheck -Grace 604800 -Timeout 604800



Grace : 604800

LastPing :

PingCount : 0

Name :

NextPing :

PingURL : https://hchk.io/25c55e7c-8092-4d21-ad06-7dacfbb6fc10

Tags :

Timeout : 604800



The cmdlet above will create a new check with grace and timeout set to the largest value of 604800 seconds (1

week).









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



PS C:\\>New-HealthCheck -Channel "*"



Grace : 3600

LastPing :

PingCount : 0

Name :

NextPing :

PingURL : https://hchk.io/25c55e7c-8092-4d21-ad06-7dacfbb6fc10

Tags :

Timeout : 86400



The cmdlet above will create a new check set to alarm on all integration channels.



See more https://healthchecks.io/integrations/











RELATED LINKS

https://healthchecks.io/docs/