PowerShell script exchange
Post Reply
alin
Novice
Posts: 3
Liked: never
Joined: Aug 30, 2018 3:11 pm
Full Name: Alin Grecea
Contact:

Find the errors veeam throws on failed backups assuming they already are provisioned for.

Post by alin »

I was looking into creating a Powershell task where based on the error type throng by the backlup job the script would decide to restart the VM that could not be backed up.

How can I find the errors that veeambackusp and replication has provisioned for. For example sometimes the VSS has issues and so far a restart would fix it. sometimes the admin account would pose a problem and the restart would not fix it. How can I find all these exceptions in powershell code, or that is not possible.

For example I already found how to have the script find the failed backups:
powershell-f26/list-failed-servers-t15735.html

But I was trying not to blindly restart VMs without understanding the error, So I was thinking that maybe based on the error thrown I could have the script avoid restarting certain VMs. How can I find the errors that veeam already has provisioned for?

Thank you.
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Find the errors veeam throws on failed backups assuming they already are provisioned for.

Post by veremin »

You need to parse log entities of failed task sessions. Based on the results (whether or not the predefined error is present inside the log), you will (or will not) restart VM. Just an example how you can check task session log (writing from memory, few modifications might be needed):

Code: Select all

$Job = Get-VBRJob -name "Name of your backup job"
$Session = $Job.FindLastSession()
$FailedSessions = $Session.GetTaskSessionsByStatus("Failed")
$FailedSessions.logger.GetLog().updatedrecords | where {$_.Status -eq "EFailed"} | select title
Thanks!
alin
Novice
Posts: 3
Liked: never
Joined: Aug 30, 2018 3:11 pm
Full Name: Alin Grecea
Contact:

Re: Find the errors veeam throws on failed backups assuming they already are provisioned for.

Post by alin »

Thank you for the response. This seems a good direction.
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Find the errors veeam throws on failed backups assuming they already are provisioned for.

Post by veremin »

You're welcome. Let us know, if further assistance is needed. Thanks!
Post Reply

Who is online

Users browsing this forum: masahide.k and 8 guests