Custom Agent counters not working

Started by kghammond, February 12, 2008, 05:45:59 PM

Previous topic - Next topic

kghammond

Below is a list of custom counters I have created.  When I copy the updated nxagentd.conf to a node, the first four counters are availble, but none of the rest show up in the NetXMS Console Data Collection List.

*WinPerf
Counter = UserProcess.SQLServer.CPU:"\Process(sqlservr)\% Processor Time":60:A:INT:Average % CPU Time for sqlservr.exe over past minute
Counter = UserProcess.SQLServer.IO.ReadBytes:"\Process(sqlservr)\IO Read Bytes/sec":60:A:INT:Average I/O Read Bytes for sqlservr.exe over past minute
Counter = UserProcess.SQLServer.IO.WriteBytes:"\Process(sqlservr)\IO Write Bytes/sec":60:A:INT:Average I/O Write Bytes for sqlservr.exe over past minute
Counter = UserProcess.SQLServer.IO.OtherBytes:"\Process(sqlservr)\IO Other Bytes/sec":60:A:INT:Average I/O Other Bytes for sqlservr.exe over past minute
Counter = UserProcess.SQLServer.Memory:"Process(sqlservr)\Working Set":60:A:INT:Average Memory usage for sqlservr.exe over past minute
Counter = System.IO.DiskReadTime:"LogicalDisk(C:)\%Disk Read Time":60:A:INT:Average Disk Read Time C:
Counter = System.IO.DiskWriteTime:"LogicalDisk(C:)\%Disk Write Time":60:A:INT:Average Disk Write Time C:
Counter = System.IO.DiskReadBytes:"LogicalDisk(C:)\Disk Read Bytes/sec":60:A:INT:Average Disk Read Bytes Per Sec C:
Counter = System.IO.DiskWriteBytes:"LogicalDisk(C:)\Disk Write Bytes/sec":60:A:INT:Average Disk Write Bytes Per Sec C:
Counter = System.IO.DiskReadTime:"LogicalDisk(D:)\%Disk Read Time":60:A:INT:Average Disk Read Time D:
Counter = System.IO.DiskWriteTime:"LogicalDisk(D:)\%Disk Write Time":60:A:INT:Average Disk Write Time D:
Counter = System.IO.DiskReadBytes:"LogicalDisk(D:)\Disk Read Bytes/sec":60:A:INT:Average Disk Read Bytes Per Sec D:
Counter = System.IO.DiskWriteBytes:"LogicalDisk(D:)\Disk Write Bytes/sec":60:A:INT:Average Disk Write Bytes Per Sec D:


I suspect the colon behind the drive letters are creating the problems.  I have gone over this a few tims, but I can't seemt to find any other misspellings or syntax errors.  Can you find anything wrong with this list?  I am getting two errors in the event log.  One is:

CheckCounter: PDH Error C0000BC0 in call to PdhAddCounter (Unable to parse the counter path. Check the format and syntax of the specified path.)

The other is:

Unable to add counter from configuration file. Original configuration record: System.IO.DiskReadTime:"LogicalDisk(C:)\%Disk Read Time":60:A:INT:Average Disk Read Time C:


Thank you for any help,
Kevin
Thank you,
Kevin

Victor Kirhenshtein

#1
Hello!

There are various errors. First, in many counters you miss leading backslash. Also, there should be a white space between % sign and "Disk Read Time" or "Disk Write Time". And finally, you should enclose description in double quotes if you are using colon. Correct section should looks like this:


*WinPerf
Counter = UserProcess.SQLServer.CPU:"\Process(sqlservr)\% Processor Time":60:A:INT:Average % CPU Time for sqlservr.exe over past minute
Counter = UserProcess.SQLServer.IO.ReadBytes:"\Process(sqlservr)\IO Read Bytes/sec":60:A:INT:Average I/O Read Bytes for sqlservr.exe over past minute
Counter = UserProcess.SQLServer.IO.WriteBytes:"\Process(sqlservr)\IO Write Bytes/sec":60:A:INT:Average I/O Write Bytes for sqlservr.exe over past minute
Counter = UserProcess.SQLServer.IO.OtherBytes:"\Process(sqlservr)\IO Other Bytes/sec":60:A:INT:Average I/O Other Bytes for sqlservr.exe over past minute
Counter = UserProcess.SQLServer.Memory:"\Process(sqlservr)\Working Set":60:A:INT:Average Memory usage for sqlservr.exe over past minute
Counter = System.IO.DiskReadTime:"\LogicalDisk(C:)\% Disk Read Time":60:A:INT:"Average Disk Read Time C:"
Counter = System.IO.DiskWriteTime:"\LogicalDisk(C:)\% Disk Write Time":60:A:INT:"Average Disk Write Time C:"
Counter = System.IO.DiskReadBytes:"\LogicalDisk(C:)\Disk Read Bytes/sec":60:A:INT:"Average Disk Read Bytes Per Sec C:"
Counter = System.IO.DiskWriteBytes:"\LogicalDisk(C:)\Disk Write Bytes/sec":60:A:INT:"Average Disk Write Bytes Per Sec C:"
Counter = System.IO.DiskReadTime:"\LogicalDisk(D:)\% Disk Read Time":60:A:INT:"Average Disk Read Time D:"
Counter = System.IO.DiskWriteTime:"\LogicalDisk(D:)\% Disk Write Time":60:A:INT:"Average Disk Write Time D:"
Counter = System.IO.DiskReadBytes:"\LogicalDisk(D:)\Disk Read Bytes/sec":60:A:INT:"Average Disk Read Bytes Per Sec D:"
Counter = System.IO.DiskWriteBytes:"\LogicalDisk(D:)\Disk Write Bytes/sec":60:A:INT:"Average Disk Write Bytes Per Sec D:"


Also, you may find useful built-in parameters Process.WkSet and Process.IO.xxx. You can find short description of built-in parameters here:
https://www.netxms.org/documentation/common_parameters.html

However there are difference between your custom parameters and built-in Process.IO.xxx - you define average value for last minute, while built-in parameters is a totals since process start - but you can calculate an average value using delta transformation for DCI on server side.

Best regards,
Victor


kghammond

I was just going to ask that question.  I assume then that process.io.xxx with a transformation will actually be more accurate.

At the same time, my working set counter will be more accurate than process.wkset because it will be averaged over 60 seconds.  Is that correct?

A future request would be to document the built-in counters with the details of how the data is obtained, 60 sec avearged, total, etc.

Thank you,
Kevin

Victor Kirhenshtein

Quote from: kghammond on February 13, 2008, 10:39:25 PM
I was just going to ask that question.  I assume then that process.io.xxx with a transformation will actually be more accurate.

They should be the same - in both cases you get average value for 60 second, the only difference is that for built-in counters you have calculation on server side (so using fewer cpu cycles on machine with agent) and that you can easily use them in templates without any changes in appropriate agent configs.

Quote from: kghammond on February 13, 2008, 10:39:25 PM
At the same time, my working set counter will be more accurate than process.wkset because it will be averaged over 60 seconds.  Is that correct?

Yes, that's correct.

Best regards,
Victor

kghammond

I just experimented with using process.io.xxx with a transformation of "Average delta per second", and I compared it to the:
Counter = UserProcess.SQLServer.IO.xxx:"\Process(sqlservr)\IO xxx Bytes/sec":60:A:INT:"Average I/O xxx Bytes for sqlservr.exe over past minute"

Both graphs are virtually identical.

I thought this might be helpful if anyone is reading this thread.

Kevin