< Back

Get-DDMonitor

Sat Jan 18, 2020 8:12 pm

NAME Get-DDMonitor



SYNOPSIS

Retrieves a list of all existing Datadog monitors with -All or a specific one with -MonitorID.





SYNTAX

Get-DDMonitor [-All] [-GroupStates <String[]>] [-Tags <String[]>] [<CommonParameters>]



Get-DDMonitor [-MonitorId] <UInt32> [-GroupStates <String[]>] [<CommonParameters>]





DESCRIPTION





PARAMETERS

-All [<SwitchParameter>]

Retrieves all monitors. Incompatible with -MonitorID.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-MonitorId <UInt32>

A Datadog Monitor ID. Incompatible with -All.



Required? true

Position? 1

Default value 0

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-GroupStates <String[]>

A string or array of strings indicating what, if any, group states to include. Choose from one or more from

'all', 'alert', 'warn', or 'no data'.

The argument `group_states` will in fact not render all the monitors that have an alert / warning state.

Rather, they give more details on different groups within a monitor that has the multi-alert feature activated.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Tags <String[]>

A string or array of strings indicating what tags, if any, should be used to filter the list of monitors by

scope.

Incompatible with -MonitorID



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



OUTPUTS



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



PS C:\\># Get a list of all monitors



Get-DDMonitor -All









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



PS C:\\># Get a list of all monitors and filter with a tags



Get-DDMonitor -All -Tags host:myhostname









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



PS C:\\># Get a list of all monitors and request the alert and warn group states



Get-DDMonitor -All -GroupStates @('alert', 'warn')









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



PS C:\\># Get a specific monitor



Get-DDMonitor -MonitorID 123456











RELATED LINKS