Comprehensive data protection for all workloads
Post Reply
Posts: 304
Liked: 37 times
Joined: Sep 29, 2010 3:37 pm

Monitor/Notification for Replication Jobs

Post by lobo519 » Sep 14, 2012 7:45 pm 1 person likes this post

I am looking for a notification if my replication jobs are taking longer than expected. Basiclly if a job is running longer than 15 minutes I would like to be notified via Email or SNMP would work also.

Anyone have any idea how to accomplish this?

Veeam Software
Posts: 5893
Liked: 1715 times
Joined: Jul 26, 2009 3:39 pm
Full Name: Luca Dell'Oca
Location: Varese, Italy

Re: Monitor/Notification for Replication Jobs

Post by dellock6 » Sep 14, 2012 8:03 pm

I think you would need a powershell script using cmdlet "Get-VBRReplica" and use it to check for the status of the job itself. I do not have a script ready to be run...

Luca Dell'Oca
Principal EMEA Cloud Architect @ Veeam Software

vExpert 2011 -> 2020
Veeam VMCE #1

VP, Product Management
Posts: 5617
Liked: 2429 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: Monitor/Notification for Replication Jobs

Post by tsightler » Sep 14, 2012 9:58 pm 2 people like this post

There are several scripts around that show how to start a job via Powershell and then wait for it's completion. I suppose you could write some wrapper scripts around all your jobs and use Task Scheduler to start all of them, and monitor if they complete ontime, but that's a little ugly.

I'd probably try to write a single "monitor" script to do it, something that could be run from Task Manager every few minutes and monitor if any job (or even a session within a job) has been running longer than a specified period of time. It's pretty easy to get a list of all jobs that have been running longer that 15 minutes:

Code: Select all

$sessions = Get-VBRBackupSession | Where-Object {$_.State -eq "Working" -and $_.CreationTime -lt (Get-Date).addminutes(-15)}
The $sessions variable would then contain any job that had started more than 15 minutes ago and was still running (i.e. "Working") and you could easily loop through that variable and send appropriate alerts.

If your jobs contain multiple VMs, and you only want to alert if any single VM within that job takes longer than 15 minutes you have to dig a little deeper and loop through the $sessions with GetTasksSessions(). I could probably cook up some examples if you are interested.

Post Reply

Who is online

Users browsing this forum: Google [Bot], ksimon and 55 guests