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?
-
- Veteran
- Posts: 315
- Liked: 38 times
- Joined: Sep 29, 2010 3:37 pm
- Contact:
-
- VeeaMVP
- Posts: 6165
- Liked: 1971 times
- Joined: Jul 26, 2009 3:39 pm
- Full Name: Luca Dell'Oca
- Location: Varese, Italy
- Contact:
Re: Monitor/Notification for Replication Jobs
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.
Luca Dell'Oca
Principal EMEA Cloud Architect @ Veeam Software
@dellock6
https://www.virtualtothecore.com/
vExpert 2011 -> 2022
Veeam VMCE #1
Principal EMEA Cloud Architect @ Veeam Software
@dellock6
https://www.virtualtothecore.com/
vExpert 2011 -> 2022
Veeam VMCE #1
-
- VP, Product Management
- Posts: 6035
- Liked: 2860 times
- Joined: Jun 05, 2009 12:57 pm
- Full Name: Tom Sightler
- Contact:
Re: Monitor/Notification for Replication Jobs
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:
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.
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)}
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.
Who is online
Users browsing this forum: Baidu [Spider], Google [Bot], Semrush [Bot] and 118 guests