← All guides

Guide · Backup

Monitor a Veeam backup job

Veeam emails you when a job fails. It can't email you when the whole job silently stops running. A check-in from a post-job script closes that gap: no check-in, you get paged.

1. Create a check

Create a check in Mortemain with your backup's schedule and grace, and copy its ping URL.

2. Add a post-job script

In the job: Storage → Advanced → Scripts, tick Run the following script after the job and point it at a wrapper that runs PowerShell:

 post-job command
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\scripts\veeam-ping.ps1"

The simplest script just pings on completion, that alone proves the job ran to the end:

 veeam-ping.ps1
Invoke-RestMethod "https://ping.mortemain.com/your-check-uuid" -TimeoutSec 10

3. Gate on the actual result (recommended)

Read the last session's result via Veeam PowerShell and ping /fail on anything but success:

 veeam-ping.ps1
Import-Module Veeam.Backup.PowerShell
$Url = "https://ping.mortemain.com/your-check-uuid"
$s = Get-VBRBackupSession |
      Where-Object { $_.JobName -eq "Nightly Backup" } |
      Sort-Object EndTime -Descending | Select-Object -First 1

if ($s.Result -eq "Success") {
    Invoke-RestMethod $Url -TimeoutSec 10
} else {
    Invoke-RestMethod "$Url/fail" -TimeoutSec 10
}

Test it

Run the backup once, the check flips to up. Then disable the job and confirm the down alert lands after the window: exactly what Veeam's own emails can't tell you.

No shell on the box at all? Many appliances can only email, point them at the email check-in address instead.