Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Number References of Windows Performance Counter #37

Open
kkzinger opened this issue Feb 28, 2017 · 0 comments
Open

Number References of Windows Performance Counter #37

kkzinger opened this issue Feb 28, 2017 · 0 comments

Comments

@kkzinger
Copy link

Hi,

I would like to use the number references of Performance Counters over their Names which are language dependend. The goal is to do monitoring in an multilanguage Server Environment without worrying about the installed system language of the Server.

I tried this the following way


<!--- This file is managed by Puppet. DO NOT EDIT. -->

<WindowsPerformanceCounter>
  <RefreshInstancesConfiguration Enable="true" Interval="900" />
  <Counters>
    <Counter Category="238" Name="% Processor Time" Instance="_Total" CollectdPlugin="cpu" CollectdPluginInstance="" CollectdType="percent" CollectdTypeInstance="processor"/>
  </Counters>
</WindowsPerformanceCounter>

This generates the following exception

2017-02-28 13:14:58.3912|ERROR|BloombergFLP.CollectdWin.PerformanceCounterGenerator: Got exception : System.InvalidOperationException: Category does not exist.
   at System.Diagnostics.PerformanceCounterLib.CounterExists(String machine, String category, String counter)
   at System.Diagnostics.PerformanceCounter.InitializeImpl()
   at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName, Boolean readOnly)
   at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName)
   at BloombergFLP.CollectdWin.PerformanceCounterMetricGenerator.GetMetricRetriever(String category, String names, String instance), while adding performance counter: Category:238 - Instance:_Total - counter:% Processor Time

After this i tried to retrieve Values via Powershell cmdlet


C:\Users\Administrator> Get-Counter "\238(_Total)\% Processor Time" -SampleInterval 1

Timestamp                 CounterSamples
---------                 --------------
28.02.2017 13:28:04       \\pup-win2008r2\238(_total)\% processor time :
                          0,76876596952451

This worked fine.
Could someone give insight why this is not working?

greets,
Gerold

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant