Script to Detect if Veam Backup Running Email Notification

box_backup_vmware[1]We use Veam to backup our servers. Veam uses snapshots to copy the whole machine which can then get copied to disk to be backed up to tape. Sometimes due to changes on the servers through the night the Veam backup job overruns. When a backup is initialy created removed it can put strain on the disks and also take it offline. So when a job overruns it can take the server down during production.

Here is a powershell script which is run first thing in the morning so we know via email if we need to warn the business or cancel a backup of any issues!

Run this script on the machine with Veam installed, recommend you install PowerShell Version 3. Replace %xxx% values with your correct one!

asnp VeeamPSSnapin -ErrorAction SilentlyContinue
$PSEmailServer = "%ExchangeServer%"
$Activejobs = Get-VBRJob | ?{$_.GetLastState() -eq "Working"}
foreach($jobs in $Activejobs)
{
Send-MailMessage -From "%[email protected]%" -to %emailto@domain.com% -Subject "Veam Job Still Running" -Body $jobs.name
}

 

To turn a powershell .ps1 script into a sheduled task do the following :

Run this program for the task: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe and Add the location of the ps1 script as the argument of the scheduled task

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...