PowerShell script exchange
Post Reply
rbbch
Influencer
Posts: 18
Liked: never
Joined: Mar 16, 2022 12:44 pm
Full Name: Ben Curtis-Haigh
Contact:

Monitor Long Running Replication Jobs

Post by rbbch »

Hello all,

I am new here but am currently looking to monitor long running replication jobs in our environment, potentially with an end goal to send an alert or alert through out monitoring software. Our first idea is to use PowerShell and do some sort of script which will look at the average running times for a replication job, then compare that to the current running time of the job. If its 20% higher than the average, then alert as something could potentially be up. I was wondering if someone else may have had a similar idea or created something similar to this, which could help.

Appreciate any help in advance!

Kind Regards
Ben
wishr
Veteran
Posts: 3077
Liked: 455 times
Joined: Aug 07, 2018 3:11 pm
Full Name: Fedor Maslov
Contact:

Re: Monitor Long Running Replication Jobs

Post by wishr »

Hi Ben,

Welcome to Veeam R&D forums!

Why not simply use Veeam ONE that provides this functionality out-of-the-box?

Thanks
rbbch
Influencer
Posts: 18
Liked: never
Joined: Mar 16, 2022 12:44 pm
Full Name: Ben Curtis-Haigh
Contact:

Re: Monitor Long Running Replication Jobs

Post by rbbch »

Hello,

Cost primarily. Its something we would love to have, but would like to do it via PowerShell if possible.

Kind Regards
Ben
wishr
Veteran
Posts: 3077
Liked: 455 times
Joined: Aug 07, 2018 3:11 pm
Full Name: Fedor Maslov
Contact:

Re: Monitor Long Running Replication Jobs

Post by wishr »

Got it. Just wanted to remind that you may use Community Edition which is free of charge.
david.domask
Veeam Software
Posts: 2123
Liked: 513 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Monitor Long Running Replication Jobs

Post by david.domask » 1 person likes this post

Hey Ben,

VeeamOne free is definitely ideal for this as this is gonna be a bit of code honestly speaking.

If you don't want to go that route, design it like this:

1. Make a general pre-job script that connects to some local "DB", think SQLLite or even just a CSV file
2. Use the magic here to figure out which job is running: post436975.html#p436975
3. Script should check if the JobID is in your DB or not; if not, make a new entry and run some logic to calculate average time and record it as some average. If it is, continue
4. Start a monitoring loop that just sleeps the duration of the average time
5. After the sleep, check the status of the job session and start a counter
6. If the counter exceeds whatever threshold you set, send an alert

I don't have any code examples for you since this will all be bespoke, but I think it's an ideal approach. See what you can crank out, and if you hit snags, post and maybe we can help.
David Domask | Product Management: Principal Analyst
rbbch
Influencer
Posts: 18
Liked: never
Joined: Mar 16, 2022 12:44 pm
Full Name: Ben Curtis-Haigh
Contact:

Re: Monitor Long Running Replication Jobs

Post by rbbch »

Can you run Veeam One Community edition though along side Veeam Enterprise or standard David?

Thanks also for the idea.
wishr
Veteran
Posts: 3077
Liked: 455 times
Joined: Aug 07, 2018 3:11 pm
Full Name: Fedor Maslov
Contact:

Re: Monitor Long Running Replication Jobs

Post by wishr »

Yes, this is possible.
rbbch
Influencer
Posts: 18
Liked: never
Joined: Mar 16, 2022 12:44 pm
Full Name: Ben Curtis-Haigh
Contact:

Re: Monitor Long Running Replication Jobs

Post by rbbch »

Hey,

Just an update on this. I tried using Veeam One but it would not display which job was over running in the email alert... only that a job somewhere was over running. I found the alerts very much spamming me.
wishr
Veteran
Posts: 3077
Liked: 455 times
Joined: Aug 07, 2018 3:11 pm
Full Name: Fedor Maslov
Contact:

Re: Monitor Long Running Replication Jobs

Post by wishr »

Hi Ben,

Thank you for the feedback.

Do you have an example of that email notification? You can certainly get that information from the Unusual job duration and/or Maximum allowed job duration alarms.

Veeam ONE provides a lot of alarms and all of them are useful even with the default settings. However, if you would like to decrease the amount of alerts you are getting, you can do this easily. You may disable the alarms that you are not interested in getting and/or tune their settings so that the alerts will arrive in the conditions you need them to arrive. Moreover, you may change the alarm notification settings so that you'll be only getting email notifications on specific alarms.

Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests