PRTG Custom WMI Query Regarding Disk Performance Status

I am trying to figure out a way to pull disk perfmon status from windows 2008 and 2012 (will be accessing remote systems), I am particularly interested in Disk Read/Write Bytes per second.  I am intending to put this into PRTG but need to create a good powershell script, this will need to impersonate another user (service account).  Any help is greatly appreciated.


Thanks
LVL 1
smyers051972Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gary PattersonVP Technology / Senior Consultant Commented:
You can use the PS cmdlet "Get-counter", and pipe the output to Export-counter

C:\Users\mallen>Get-counter "\\servername\PhysicalDisk(*)\% Disk Time" -SampleInterval 2 -MaxSamples 100 | Export-counter -Path somepath\export.blg

Basic article:  https://technet.microsoft.com/en-us/magazine/ee872428.aspx
Get-Counter documentation: https://technet.microsoft.com/en-us/library/hh849685.aspx (lots of examples here)

This article explains how to use Get-Counter -ListSet to retrieve a dynamic list of counters (for example, if you want the counters for each physical drive on each target system, but you don't want to hardcode drive letters):

http://blogs.technet.com/b/heyscriptingguy/archive/2011/07/28/use-performance-counter-sets-and-powershell-to-ease-baselining.aspx

Note that you can specify multiple remote computers, and multiple counters in a single command.
0
smyers051972Author Commented:
Hello, I tested this recommendation and in part worked, I have found out they want to monitor more, there are 4 items and I am attaching the screen shot, they are highlighted in grey.
perf.png
0
Gary PattersonVP Technology / Senior Consultant Commented:
No problem, just create an array containing the counters you want

$counters = @()
$counters += '\Memory\Available Bytes'
$counters += '\Paging File(*)\% Usage'
$counters += '\PhysicalDisk(*)\Disk Reads/sec'
$counters += '\PhysicalDisk(*)\Disk Writes/sec'
$counters += '\PhysicalDisk(*)\Avg. Disk sec/Read'
$counters += '\PhysicalDisk(*)\Avg. Disk sec/Write'
$counters += '\Processor(*)\% Processor Time'
$counters += '\System\Processor Queue Length'
Get-counter $counters -SampleInterval 2 -MaxSamples 5
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
smyers051972Author Commented:
Thanks for the assist!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2012

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.