MattHodge / Graphite-PowerShell-Functions

A group of PowerShell functions that allow you to send Windows Performance counters to a Graphite Server, all configurable from a simple XML file.
https://hodgkins.io/using-powershell-to-send-metrics-graphite
GNU General Public License v3.0
218 stars 71 forks source link

How to get % Physical used Memory with Graphite-PowerShell ? #53

Closed toni-moreno closed 8 years ago

toni-moreno commented 8 years ago

Hi @MattHodge . I'm working with this wonderful tool and we are getting these memory counters.

        <Counter Name="\Memory\Available MBytes" /> 
        <Counter Name="\Memory\Pages/sec" />
        <Counter Name="\Memory\Pages Input/sec" /> 

But we also need the % physical used memory . In this case we can compute the value if either of those values could be obtained.

There is any counter matching these values? There any workaround to get these values from other scripts like perhaps this other( https://github.com/pdxcat/PowerShell-Graphite/blob/master/Get-MemStats.ps1)

kkzinger commented 8 years ago

Hi, you can lookup all counters with (Get-Counter -ListSet *).paths And to get some Value from it to evaluate use this get-counter "\Memory\% Committed Bytes In Use" -SampleInterval 2

Link to more usefull stuff regarding perfcounters and powershell http://www.powershellmagazine.com/2013/07/19/querying-performance-counters-from-powershell/