PowerShell script exchange
Post Reply
kpolsana
Service Provider
Posts: 56
Liked: 2 times
Joined: Dec 10, 2021 6:35 pm
Full Name: Koushik Polsana
Contact:

Powershell Commands to get job summary

Post by kpolsana »

How can we get a job summary details as listed in the picture through powershell


https://ibb.co/60Q9JXB
Mildur
Product Manager
Posts: 10278
Liked: 2746 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Powershell Commands to get job summary

Post by Mildur » 1 person likes this post

Hi Koushik

Last Session Details can be queried with this method:

Code: Select all

(Get-VBRJob).FindLastSession()
A sample script to get some of this values:

Code: Select all

(Get-VBRJob).FindLastSession() | select-object OrigJobName,
    @{Label="Result";Expression={(($_.Result).toString())}},
    @{Label="State";Expression={(($_.State).toString())}},
    @{Label="ProcessedObjects";Expression={(($_.sessioninfo.Progress.ProcessedObjects))}},
    @{Label="ProcessedSize";Expression={(($_.sessioninfo.Progress.ProcessedSize))}},
    @{Label="ReadSize";Expression={(($_.sessioninfo.Progress.ReadSize))}},
    @{Label="TransferedSize";Expression={(($_.sessioninfo.Progress.TransferedSize))}},
    @{Label="Duration";Expression={(($_.sessioninfo.Progress.Duration).toString())}},
    @{Label="BottleneckInfo.Source";Expression={(($_.sessioninfo.Progress.BottleneckInfo.Source))}},
    @{Label="BottleneckInfo.Proxy";Expression={(($_.sessioninfo.Progress.BottleneckInfo.Proxy))}},
    @{Label="BottleneckInfo.Network";Expression={(($_.sessioninfo.Progress.BottleneckInfo.Network))}},
    @{Label="BottleneckInfo.Target";Expression={(($_.sessioninfo.Progress.BottleneckInfo.Target))}} | ConvertTo-json
Best,
Fabian
Product Management Analyst @ Veeam Software
kpolsana
Service Provider
Posts: 56
Liked: 2 times
Joined: Dec 10, 2021 6:35 pm
Full Name: Koushik Polsana
Contact:

Re: Powershell Commands to get job summary

Post by kpolsana »

Thanks Fabian, appreciate the help here is the output I got from the above command

Code: Select all

{
        "OrigJobName":  "AGT-001",
        "Result":  "Success",
        "State":  "Stopped",
        "ProcessedObjects":  1,
        "ProcessedSize":  161059176448,
        "ReadSize":  4358930432,
        "TransferedSize":  1137639619,
        "Duration":  "00:02:45",
        "BottleneckInfo.Source":  0,
        "BottleneckInfo.Proxy":  85,
        "BottleneckInfo.Network":  0,
        "BottleneckInfo.Target":  6
    },


How can I get the Processed size, readsize, transferedsize to meaning numbers in TB or GB, also what does 85 for bottleneck stands for
david.domask
Veeam Software
Posts: 2590
Liked: 606 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Powershell Commands to get job summary

Post by david.domask » 1 person likes this post

Hey @kpolsana,

The sizes are in Bytes, and PS has byte math included, so you can just do something like

@{Label="ProcessedSize";Expression={(($_.sessioninfo.Progress.ProcessedSize)/1GB)}}

Or /1TB for Terabyte.

For the bottlenecks, this is a support specific value; the actual numerical value doesn't matter typically, just focus on the highest value. Loosely this will represent the "slowest" part of the backup infrastructure, but keep in mind that there will always be something "slowest". That is to say, a high Bottleneck value doesn't mean there is an issue necessarily, it just means that's where our datamover agents took the longest.

If you want to parse the output and action on it, probably it's best to just collect the bottleneck stats and track if the bottleneck shifts and alert if there is a difference in bottleneck from the usual result, but again, keep in mind that bottleneck is not indicative of a problem necessarily, it's just what component took longest in the backup process.
David Domask | Product Management: Principal Analyst
kpolsana
Service Provider
Posts: 56
Liked: 2 times
Joined: Dec 10, 2021 6:35 pm
Full Name: Koushik Polsana
Contact:

Re: Powershell Commands to get job summary

Post by kpolsana »

also I think I'm missing what is the bottle neck from the script how can I get to know what is the bottleneck ?
david.domask
Veeam Software
Posts: 2590
Liked: 606 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Powershell Commands to get job summary

Post by david.domask » 2 people like this post

Whichever of those properties is highest is the "bottleneck"

Source = Reading from the source of the data (Proxy reading from VMware/HyperV, source repository, etc)
Proxy = Proxy processing (compression/dedupe)
Network = Transfer between source datamover agent and target datamover agent
Target = Writing to the target for the data.
David Domask | Product Management: Principal Analyst
kpolsana
Service Provider
Posts: 56
Liked: 2 times
Joined: Dec 10, 2021 6:35 pm
Full Name: Koushik Polsana
Contact:

Re: Powershell Commands to get job summary

Post by kpolsana » 1 person likes this post

I steer query I can write or any call which would display it instead of me calculating the values ?

also on one of the server getting below error

Code: Select all

{
        "Expression":  {
                           "Attributes":  "",
                           "File":  "kpi.ps1",
                           "IsFilter":  false,
                           "IsConfiguration":  false,
                           "Module":  null,
                           "StartPosition":  "System.Management.Automation.PSToken",
                           "DebuggerHidden":  false,
                           "Id":  "3b747553-6ab4-4751-99bf-5e236546b915",
                           "Ast":  "{(($_.sessioninfo.Progress.Duration).toString())}"
                       },
        "Label":  "Duration"
david.domask
Veeam Software
Posts: 2590
Liked: 606 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Powershell Commands to get job summary

Post by david.domask »

@kpolsana, sorry, I'm not sure I understand your first request. You mean how to sort which is the highest bottleneck? If so, two approaches; sort it on your PS response before converting to JSON, or have whatever you feed the JSON into do the sorting based on the Bottleneck* nodes. I'm afraid I don't know where this JSON is going, so I cannot comment on whether the target has the ability to sort it or not.

For your second item, please add some context.

In Powershell what is the error in full? This looks like the resulting expression, and as I get it, the error Object from Powershell got passed to your JSON, so likely you need to run the command without passing it to ConvertTo-JSON and we can hopefully see what the shell is not happy about.
David Domask | Product Management: Principal Analyst
albertwt
Veteran
Posts: 954
Liked: 53 times
Joined: Nov 05, 2009 12:24 pm
Location: Sydney, NSW
Contact:

Re: Powershell Commands to get job summary

Post by albertwt » 1 person likes this post

david.domask wrote: Jan 13, 2023 3:33 pm Whichever of those properties is highest is the "bottleneck"

Source = Reading from the source of the data (Proxy reading from VMware/HyperV, source repository, etc)
Proxy = Proxy processing (compression/dedupe)
Network = Transfer between source datamover agent and target datamover agent
Target = Writing to the target for the data.
Thank you, David, for the detailed explanation:-)
--
/* Veeam software enthusiast user & supporter ! */
david.domask
Veeam Software
Posts: 2590
Liked: 606 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Powershell Commands to get job summary

Post by david.domask » 1 person likes this post

Happy to help!

We have these in the User Guide also with more descriptions: https://helpcenter.veeam.com/docs/backu ... ml?ver=110

I didn't include the other items like WAN Accelerators just because I think it's fairly clear what that represents, but the above is the best reference for your purposes (remember, bottlenecks don't necessarily mean there is a problem!)
David Domask | Product Management: Principal Analyst
albertwt
Veteran
Posts: 954
Liked: 53 times
Joined: Nov 05, 2009 12:24 pm
Location: Sydney, NSW
Contact:

Re: Powershell Commands to get job summary

Post by albertwt »

Sure, no worries David,
yes, Bottleneck is expected as the systems interact with other systems.
--
/* Veeam software enthusiast user & supporter ! */
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests