Windows System MetricsΒΆ

To send Windows Performance Counters from Windows to Hosted Graphite, Graphite PowerShell Functions can be used.

  • Download the latest version of Graphite PowerShell Functions from GitHub by clicking Download ZIP
  • Extract Graphite-PowerShell.ps1 and StatsToGraphiteConfig.xml to C:GraphitePowerShell on your machine
  • Open C:GraphitePowerShellStatsToGraphiteConfig.xml in a text editor. This is where you can configure the settings the script will use. For now, we are only going to look at the <Graphite> section of the configuration:
<Graphite>
    <CarbonServer>carbon.hostedgraphite.com</CarbonServer>
    <CarbonServerPort>2003</CarbonServerPort>
    <MetricPath>YOUR-API-KEY.foo.bar</MetricPath>
    <MetricSendIntervalSeconds>30</MetricSendIntervalSeconds>
    <TimeZoneOfGraphiteServer>UTC</TimeZoneOfGraphiteServer>
</Graphite>
  • Save the C:\GraphitePowerShellStatsToGraphiteConfig.xml file
  • Open an administrative PowerShell console using Run As Administrator
  • Set your Execution Policy to allow scripts be executed by entering Set-ExecutionPolicy RemoteSigned
  • Run the following PowerShell commands to start sending metrics into Hosted Graphite
cd C:\GraphitePowerShell
. .\Graphite-PowerShell.ps1
Start-StatsToGraphite -Verbose

Your output should look something like the following:

VERBOSE: Metric Received: YOUR-API-KEY.foo.bar.servername.physicaldisk.total.diskreadqueuelength 0.000393834171592958 1408416870
VERBOSE: Metric Received: YOUR-API-KEY.foo.bar.servername.memory.pagesinput-sec 0.996814761294544 1408416870
PerfMon Job Execution Time: 5.4987477 seconds

You can read more details about the configuration options and how to run the functions as a service over on the Graphite PowerShell Functions GitHub Page.