Update-RedgateMonitorAlertNotificationSettings
Published 18 April 2024
Customizes the alert notification configuration for a specific monitored object and alert type.
Syntax
Update-RedgateMonitorAlertNotificationSettings [-MonitoredObject] <TraversableObject> [-AlertType] <int> [-Settings] <psobject> [<CommonParameters>]
Description
Customizes the alert notification configuration for a specific monitored object and alert type.
Parameters
-MonitoredObject
<TraversableObject>
The object to be configured (e.g. cluster, disk, database etc).
| Aliases | None |
| Required? | true |
| Position? | 1 |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-AlertType
<Int32>
The id of the alert type. Predefined ids are accessible through global alert type variables, $AlertType, $AgAlertTypes, $AzureSqlDatabaseAlertTypes, $AzureSqlServerAlertTypes, $ClusterAlertTypes, $ClusterMachineAlertTypes, $DatabaseAlertTypes, $DiskAlertTypes, $ElasticPoolAlertTypes, $InstanceAlertTypes, $JobAlertTypes and $StandaloneMachineAlertTypes.
| Aliases | None |
| Required? | true |
| Position? | 2 |
| Default Value | 0 |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
-Settings
<PSObject>
The configuration to apply.
| Aliases | None |
| Required? | true |
| Position? | 3 |
| Default Value | None |
| Accept Pipeline Input | False |
| Accept Wildcard Characters | false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable, and -ProgressAction. For more information, see http://technet.microsoft.com/en-us/library/hh847884.aspx.
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
-
None.
You cannot pipe input to this cmdlet.
Examples
-------------------------- EXAMPLE 1 --------------------------
$notificationsettings = @{
EmailNotificationOption = [EmailNotificationOption]::SendToCustom
EmailAddresses = 'foo.bar@companymail.com', 'monkey.banana@companymail.com'
SlackEnabled = $true
SnmpEnabled = null # to leave a setting unchanged, simply leave as null
WebhookEnabled = null # to leave a setting unchanged, simply leave as null
ScriptEnabled = null # to leave a setting unchanged, simply leave as null
}
Update-RedgateMonitorAlertNotificationSettings -MonitoredObject $database -AlertType $DatabaseAlertTypes.DatabaseFileUsage -Settings $notificationsettings