Intro
You know the stories: Sometimes an incorrect keyboard layout can lead to incorrect entries. Or while coding, , you must make sure that you use the correct special characters such as ' or ", etc. But let's focus on the main topic - Veeam ONE Alerts
Veeam ONE Alert - Suspicious incremental backup size
You probably know this Veeam ONE Alert: Veeam ONE Alert - Suspicious incremental backup size. What many may not know is that you can configure Veeam ONE to perform remediation actions when alerts are triggered. These actions can be performed automatically or after manual approval.
Veeam ONE offers the following types of remediation for alarms:
- Predefined actions that are configured for the most commonly used out-of-the-box alarms.
- Custom scripts that you can specify in the settings of any alarm. For each severity level, Veeam ONE can run one or more custom scripts.
For the Suspicious incremental backup size alert we do have a predefined action available: Predefined Remediation
A SureBackup Job and therefore an Application Group with the corresponding Virtual Lab must be preconfigured and assigned to the remediation action.
The alert has 2 severity levels (Warning/Error). In the figure above, the same Remediation Action has been configured for each severity level. So far this is ok, but the Application Group cannot be empty, which means that at least one VM must be configured within the application group.
Bringing dynamics into play
But what if you want to check only this one VM in a SureBackup job that triggered a warning? A script can be useful here. No sooner said than done.... The following sample script can help you with this requirement: vone-remediate-surebackup.ps1
It’s based on the new Veeam Backup & Replication V12 Powershell cmdlets. Starting from V12 SureBackup jobs and Application Groups are no longer platform-specific and can include a mix of VMware, Hyper-V and Agent Backups.
The script creates a temporary Application Group as well as a SureBackup Job.
Important: Prerequisite is a preconfigured Virtual Lab
Please change/adjust the following lines in the script:
#Line 9 - $virtualLab - Add the name of your Virtual Lab
#Line 13 - $VBRserver - Add the name of your VBR Server
#Line 58 Change the parameter KeepApplicationGroupRunning to $true if you want to keep the Application Group running.
Don't forget to end the SureBackup session if you keep the application group running so that the script can clean up the temporary environment it created.
Configure a Powershell script as remediation action in Veeam ONE
Do you remember my first lines from this post? Now all ' and " come back into play . Let's add the script to the Alert. Edit the "Suspicious incremental backup size" alert and add a "Run script" action for the severity levels Warning and Error. The "Path to the script" must contain these values:
powershell.exe "D:\Scripts\vone-remediate-surebackup.ps1" '%5'
Match the path "D:\scripts" to the path you use. And don't forget to update the Knowledge Base for the Alert, so everybody knows what the action will do.
What’s next?
Keep the feedback coming so that I can extend the script with additional functions.
Happy Monitoring!