PowerShell script exchange
Post Reply
derSchweiger
Novice
Posts: 3
Liked: 1 time
Joined: Dec 21, 2021 7:08 am
Full Name: Kevin Schweiger
Contact:

Job Status on Veeam Proxy Server

Post by derSchweiger »

Hello,

we have multiple Veeam Proxies around the world and we want to automate the Windows Update process. Therefore, we need a handy method to monitor, if the Veeam Proxy is currently doing any Veeam Backup tasks and if not, it's safe to restart the host. Our Windows Update process is based on Powershell - is there any module we can install on a Veeam Proxy host to get this kind of information? We don't want to connect via Remote Powershell to the Veeam Backup server - best-case-scenario: we are able to get this information right on the Veeam Proxy server.

Thanks in advance!
Andreas Neufert
VP, Product Management
Posts: 6752
Liked: 1409 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Job Status on Veeam Proxy Server

Post by Andreas Neufert » 1 person likes this post

I think there are many ways to monitor this.

For example you could check if the Veeam Agent process is running ... it is our datamover service that will be started on demand when you transport data.
As well you could check port usage TCP2500-3300 with netstat or similar. The agents use these ports to transport data.
Andreas Neufert
VP, Product Management
Posts: 6752
Liked: 1409 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Job Status on Veeam Proxy Server

Post by Andreas Neufert »

Code: Select all

$ProcessActive = Get-Process <processname> -ErrorAction SilentlyContinue
if($ProcessActive -eq $null)
{
 Write-host "Do X"
}
else
{
 Write-host "Do Y"
}
derSchweiger
Novice
Posts: 3
Liked: 1 time
Joined: Dec 21, 2021 7:08 am
Full Name: Kevin Schweiger
Contact:

Re: Job Status on Veeam Proxy Server

Post by derSchweiger »

OK great, so the process "VeeamAgent" is an indicator if the Veeam Proxy is processing any backup task and if no "VeeamAgent" process is running, it's safe to restart the host?
If so, that would solve our problems.
soncscy
Veteran
Posts: 643
Liked: 312 times
Joined: Aug 04, 2019 2:57 pm
Full Name: Harvey
Contact:

Re: Job Status on Veeam Proxy Server

Post by soncscy » 1 person likes this post

The only caution I'd have with this is that in the time the script detects it's time to initiate the updates and the time that the restart/lock actually begins, it's possible that a task might be assigned to the proxy from the Backup Server, which would end up with a failure on the job potentially.

Since you're needing to check this in the first place I'm guessing you don't have enough of a window in the backups to really ensure that nothing would be running.

If the update times are "regular" for each of your infrastructure items, you might consider also just adding a scheduled script that disables a given proxy at a certain time period to ensure no new tasks are assigned.

But, if you can state with confidence you'll start the updates outside of the backup window, then the above is just over-engineering, as all you potentially need to worry about would be restore activity which Andreas' script should catch fine.
derSchweiger
Novice
Posts: 3
Liked: 1 time
Joined: Dec 21, 2021 7:08 am
Full Name: Kevin Schweiger
Contact:

Re: Job Status on Veeam Proxy Server

Post by derSchweiger » 1 person likes this post

Due to our maintenance policy this does not apply to us - there is no backup job starting in the given maintenance window. The only thing we have to ensure is, that we do not restart the proxy while a backup job is already running - e.g. if a job has already been started hours ago and needs longer than expected.
We've to test the proposal but it seems to be a very solid solution.

Thanks to both of you!
Andreas Neufert
VP, Product Management
Posts: 6752
Liked: 1409 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: Job Status on Veeam Proxy Server

Post by Andreas Neufert »

In the end I think this is a risk that you can live with. It should just take some seconds.
For the worst case scenario I would make sure that all jobs have retries configured.
As well I would run the update/reboot task outside of backup window.

You can as well check for the Agent and then shutdown all Veeam services. Update the system, reboot.
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests