Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Performance monitor

$
0
0

Hello there

busy day today(got a lot of ideas)

I want to collect performance data from a couple of servers

sounds easy so I started by:

$servers="server1","server2","server3"

$counters = @("\Memory\Available MBytes","\Memory\Pages/sec","\Processor(_Total)\% Privileged Time","\Processor(_Total)\% Processor Time","\System\Processor Queue Length")

$collections= Foreach ($server in $servers) {Get-Counter -ComputerName $server -Counter $counters -SampleInterval 10 -MaxSamples 2}

good, I got my data

now I want to see only what I want to see so I do:

$collections.countersamples |select $server,path,cookedvalue |Sort-Object -Property CookedValue -Descending | Format-Table -Auto

but for some reason I get nothing:)

what's weird is the data is there when I check:

$collection

so I dig further into:

$collections.countersamples  and I see it is empty

I noticed that before when I ran it on one server at a time

one this the:

$collections.countersamples |select $server,path,cookedvalue |Sort-Object -Property CookedValue -Descending | Format-Table -Auto

worked(showd data) and one tme it didn't(on same server when ran again to get fresh data)

what can be causing this?

(also the data is always in $collections , that's weird)

Thanks


Viewing all articles
Browse latest Browse all 6937

Trending Articles