PowerShell script exchange
Post Reply
matteu
Veeam Legend
Posts: 845
Liked: 133 times
Joined: May 11, 2018 8:42 am
Contact:

Get servers status

Post by matteu »

Hello,

I would like to check the status of my differents components like repositories, proxies, NAS, ...

On the GUI, I can see allof these :
Nothing mentioned = OK
disabled
unavailable
Out of date.

Let's take proxy as sample :

Code: Select all

$Proxies = Get-VBRViProxy
foreach ($proxy in $proxies)
{
    [PSCustomObject]@{
        Name = $Proxy.Name
        Server = $Proxy.Host.Name
        IsAvailable = -not ($Proxy.Host.IsUnavailable)
        IsEnabled = -not $Proxy.IsDisabled
    }
}
I think here I have the Disabled + Unavailable check but how can I check for the "nothing mentioned" or Out of date ?
david.domask
Veeam Software
Posts: 2607
Liked: 610 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Get servers status

Post by david.domask »

Hi matteu,

I'm not quite sure all the properties you want, but I'm guessing most of those will be under the Host property on proxies.

I think for the updates you're looking for, you will need to go into unsupported methods.

CHost objects have a method GetPhysicalHost() which returns a CPhysicalHost object -- physicalhosts table in the configuration database contains information about the actual server information (physical/virtual, network info, etc), and also links to HostComponents, which are the different Veeam components installed on a given managed server.

CPhysicalHost objects have a method GetHostComponents() which returns the installed Veeam components (as known in the configuration database) as well as their up to date status.

So I would check CHost and CPhysicalHost objects under the CViProxy object returned from Get-VBRViProxy and see if you can find the info you're looking for.
David Domask | Product Management: Principal Analyst
mjr.epicfail
Veeam Legend
Posts: 488
Liked: 131 times
Joined: Apr 22, 2022 12:14 pm
Full Name: Danny de Heer
Contact:

Re: Get servers status

Post by mjr.epicfail » 1 person likes this post

I would love that this will also be integrated in the API ;-)
VMCE / Veeam Legend 2*
david.domask
Veeam Software
Posts: 2607
Liked: 610 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Get servers status

Post by david.domask »

Hi Danny!

Just to be clear, what kind of endpoint are you hoping for? The unsupported methods recommended above I think would be too much when going through REST (just the data comes from quite a few different sources in Powershell), so it kind of sounds like you're looking for a more general endpoint that returns information on infrastructure items? (Proxies, repos, etc)

What specifically would you want as a result when polling here? It's not a bad idea, but I think instead of building the data from separate cmdlets/endpoints, it might make more sense to just have some general endpoint with the availability, last contact time, available/missing upgrades, etc.
David Domask | Product Management: Principal Analyst
mjr.epicfail
Veeam Legend
Posts: 488
Liked: 131 times
Joined: Apr 22, 2022 12:14 pm
Full Name: Danny de Heer
Contact:

Re: Get servers status

Post by mjr.epicfail » 1 person likes this post

Yeah, just an endpoint to check all components and the state of them.
I guess the equivalent of VMware VCSA appliance and all service, they are pollable via API to check service states.
VMCE / Veeam Legend 2*
matteu
Veeam Legend
Posts: 845
Liked: 133 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Get servers status

Post by matteu »

Hello and thanks for your answer.

I can now see if it's up to date with this cmdlet with your help

$proxy = Get-VBRViProxy
$proxy.Host.GetPhysicalHost().IsComponentsUpdateRequired()


So , can you confirm me I check all the states I can have with this :
If disable -> $Proxy.Host.IsDisabled will be true
If not reacheable -> $Proxy.IsUnavailable will be true
If component update needed -> $proxy.Host.GetPhysicalHost().IsComponentsUpdateRequired() will be true
david.domask
Veeam Software
Posts: 2607
Liked: 610 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Get servers status

Post by david.domask »

Hi matteu,

Looks correct -- I haven't used IsComponentsUpdateRequired() but I'm guessing it does exactly as it's named, and I have the same understanding for the properties/values.
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: yusuke and 30 guests