PowerShell script exchange
Post Reply
ThierryF
Expert
Posts: 129
Liked: 33 times
Joined: Mar 31, 2018 10:20 am
Contact:

Solaris agent 2.0.0.0126-sparc : Collect backup status thru powershell from vbr ?

Post by ThierryF »

Hello,

Me again :-D ... last one for today :-D lol

Any way to grab backup status of Solaris agent backups from VBR thru powershell ?
This, to achieve automated backup control, other than jumping to each Solaris server ?

Thanks and have a nice week-end !
Take care of you and your loved ones.

Cheers from Brussels,

Th
PTide
Product Manager
Posts: 6431
Liked: 729 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Solaris agent 2.0.0.0126-sparc : Collect backup status thru powershell from vbr ?

Post by PTide »

Hi : )

I moved your post to the forum that fits better.

@oleg.feoktistov,

Any ideas?

Thanks!
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Solaris agent 2.0.0.0126-sparc : Collect backup status thru powershell from vbr ?

Post by oleg.feoktistov »

Hi @ThierryF,

There is no native way to do that through Powershell, but you can try .NET methods.

For backup sessions and job result overall:

Code: Select all

$jobs = [Veeam.Backup.Core.CBackupJob]::GetAll() | where {$_.TypeToString -eq 'Solaris x86 Agent Backup'}
$sessionsSum = @()
foreach ($job in $jobs) {
    $sessions = [Veeam.Backup.Core.CBackupSession]::GetByJob($job.Id) 
    $sessionsSum += $sessions
}

$sessionsSum | select Name, JobId, Result
For task sessions and status of each backup taken:

Code: Select all

$jobs = [Veeam.Backup.Core.CBackupJob]::GetAll() | where {$_.TypeToString -eq 'Solaris x86 Agent Backup'}
$sessionsSum = @()
foreach ($job in $jobs) {
    $sessions = [Veeam.Backup.Core.CBackupSession]::GetByJob($job.Id) 
    foreach($session in $sessions) {
       $taskSessions = [Veeam.Backup.Core.CBackupTaskSession]::GetByJobSession($session.Id)
       $sessionsSum += $taskSessions
    }

}

$sessionsSum | select ObjectName, SessionId, Status 

Note, though, that an implementation of .NET methods may differ from release to release. Thus, they are not officially supported.

Thanks,
Oleg
ThierryF
Expert
Posts: 129
Liked: 33 times
Joined: Mar 31, 2018 10:20 am
Contact:

Re: Solaris agent 2.0.0.0126-sparc : Collect backup status thru powershell from vbr ?

Post by ThierryF »

Hello Oleg,

Gave a try to your suggestion but Solaris agent backups are not retrieved ... :-(

Thanks anyway

Th
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Solaris agent 2.0.0.0126-sparc : Collect backup status thru powershell from vbr ?

Post by oleg.feoktistov »

Hi,

Just to clarify - are your solaris jobs reflected in VBR console? Does their type read 'Solaris x86 Agent Backup' ?

Thanks,
Oleg
ThierryF
Expert
Posts: 129
Liked: 33 times
Joined: Mar 31, 2018 10:20 am
Contact:

Re: Solaris agent 2.0.0.0126-sparc : Collect backup status thru powershell from vbr ?

Post by ThierryF »

No, they are as 'Solaris SPARC Agent Backup'.

I did not retrieve them at first test. I am trying to script a ssh-based collect...

Thanks,

TH
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Solaris agent 2.0.0.0126-sparc : Collect backup status thru powershell from vbr ?

Post by oleg.feoktistov »

@ThierryF, try replacing first line of the code I shared with the line below:

Code: Select all

$jobs = [Veeam.Backup.Core.CBackupJob]::GetAll() | where {$_.TypeToString -eq 'Solaris SPARC Agent Backup'}
Thanks!
ThierryF
Expert
Posts: 129
Liked: 33 times
Joined: Mar 31, 2018 10:20 am
Contact:

Re: Solaris agent 2.0.0.0126-sparc : Collect backup status thru powershell from vbr ?

Post by ThierryF »

Had a try but just realized I put 2 consecutive spaces in sting, resulting in failing matching ... :-D
Thanks!

TH
ThierryF
Expert
Posts: 129
Liked: 33 times
Joined: Mar 31, 2018 10:20 am
Contact:

Re: Solaris agent 2.0.0.0126-sparc : Collect backup status thru powershell from vbr ?

Post by ThierryF »

Another workaround is to filter on [Veeam.Backup.Core.CBackupJob]::GetAll() | {$_.jobtype -eq 'EndpointBackup'} ....
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Solaris agent 2.0.0.0126-sparc : Collect backup status thru powershell from vbr ?

Post by oleg.feoktistov »

Well, Solaris agent shares job type with many other platforms like Linux, Windows, IBM AIX etc.
So, it makes sense if you have Solaris agent jobs solely. That's why I use TypeToString property. Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests