Skip to content

Get GrafanaAlert

Stephen Valdinger edited this page Apr 3, 2019 · 1 revision

external help file: PSGrafana-help.xml Module Name: PSGrafana online version: schema: 2.0.0

Get-GrafanaAlert

SYNOPSIS

Query Grafana API for alert information

SYNTAX

Get-GrafanaAlert [[-DashboardId] <Int32[]>] [[-DashboardName] <String>] [[-DashboardTag] <String[]>]
 [[-AlertName] <String>] [[-State] <String[]>] [<CommonParameters>]

EXAMPLES

Example 1

PS C:\> Get-GrafanaAlert

Get all current alerts

Example 2

PS C:\> Get-GranaAlert -DashboardId 1

Get alerts by dashboard id

Example 3

PS C:\> Get-GranaAlert -DashboardName "PeterRabbit"

Get alerts by dashboard name

Example 4

PS C:\> Get-GranaAlert -DashboardTag "prod"

Get alerts by dashboard tag

Example 5

PS C:\> Get-GrafanaAlert -AlertName 'Perrywinkle'

Get alerts by alert name

Example 6

PS C:\> Get-GrafanaAlert -State 'paused'

Get alerts by alert state

PARAMETERS

-AlertName

Query for all alerts matching the alert name

Type: String
Parameter Sets: (All)
Aliases: Query

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DashboardId

The ID of the dashboard to query

Type: Int32[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DashboardName

The friendly name of the dashboard to query

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DashboardTag

Search for alerts belong to a dashboard with a specific tag

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-State

Query for all alerts in the state of 'ALL','no_data','paused', 'alerting','ok','pending'

Type: String[]
Parameter Sets: (All)
Aliases:
Accepted values: ALL, no_data, paused, alerting, ok, pending

Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

System.Object

NOTES

RELATED LINKS

Clone this wiki locally