-
Notifications
You must be signed in to change notification settings - Fork 0
Backup Monitoring Azure VM Alert Rule
This is a piece of work that I did nearly 5 years for a setting up backup monitroing and alert using powershell.
-
Start powershell by searching for 'ise'.
-
Login to Azure
PS C:\WINDOWS\system32> Login-AzureRmAccount
- Set you subscription
Get-AzureRmSubscription -SubscriptionName "123 - Amit Test" | Set-AzureRmContext
- Add backup failed alert rule
PS C:> Add-AlertRule -Operator GreaterThanOrEqual -Threshold 1 -ResourceId '/subscriptions/123456-123c-123-123-123456751d/resourceGroups/RecoveryServices-1234567890-Australia-East/providers/microsoft.backup/BackupVault/Amit-Backups' -EventName Backup -EventSource Administrative -Level Informational -OperationName 'Microsoft.Backup/backupVault/Backup' -ResourceProvider Microsoft.Backup -Status Failed -SubStatus Failed -RuleType Event -Location "Australia East" -ResourceGroup RecoveryServices-123456789075A-Australia-East -Name Backup-Failed -Description 'Backup Failed for one of the VMs in vault Amit-Backups' -CustomEmails 'test.support@xyz.com.au'
===== OUTPUT =============
WARNING: This cmdlet is being modified to enable better experience and may contain breaking changes in a future release.
RequestId StatusCode