Comprehensive data protection for all workloads
Post Reply
lobo519
Veteran
Posts: 315
Liked: 38 times
Joined: Sep 29, 2010 3:37 pm
Contact:

Monitor/Notification for Replication Jobs

Post by lobo519 » 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?
dellock6
Veeam Software
Posts: 6137
Liked: 1928 times
Joined: Jul 26, 2009 3:39 pm
Full Name: Luca Dell'Oca
Location: Varese, Italy
Contact:

Re: Monitor/Notification for Replication Jobs

Post by dellock6 »

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.
Luca Dell'Oca
Principal EMEA Cloud Architect @ Veeam Software

@dellock6
https://www.virtualtothecore.com/
vExpert 2011 -> 2022
Veeam VMCE #1
tsightler
VP, Product Management
Posts: 6009
Liked: 2843 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Monitor/Notification for Replication Jobs

Post by tsightler » 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: No registered users and 284 guests