Process.UserTime, Process.KernelTime

Started by kghammond, February 08, 2008, 05:31:16 PM

Previous topic - Next topic

kghammond

I was looking at trying to collect the CPU time for individual processes via the agent.  The supported agent paramaters are Process.UserTime and Proccess.KernerlTime.

Perfmon lists three different Process counters:
Process.% Priveleged Time
Process.% Processor Time
Process.% User Time

It appears that Process.% Processor Time = Process.% Privelaged Time + Process.% User Time.

Do you know if my understanding is correct and is there a reason the agent does not collect the Process.% Processor Time value?  Also the doucmenation states that the Process.UserTime and Proccess.KernerlTime are both listed in miliseconds instead of a percentage.

Is there a way to graph the Process total CPU time as a percentage?  Would you be able to add in support to have a 1/5/15 minute average for process CPU time as well?

Thank you,
Kevin

Victor Kirhenshtein

#1
Process.UserTime and Proccess.KernerlTime is a total amount of time spent by process in appropriate mode. It's a always-increasing counters. You can collect perfmon counters via either PDH.CounterValue parameter or by defining new parameters via Counter in *WinPerf section of agent's configuration file.

Best regards,
Victor

P.S. Look at this message for some more information about creating agent parameters from PDH counters:
https://www.netxms.org/forum/index.php/topic,88.msg381.html#msg381

kghammond

I must have missed this in the documentation, but I didn't realize the agent was customizable.  That is really cool!!

I keep getting more and more impressed with NetXMS every day.

kghammond

Cool this looked like it worked.  Here is my nxagentd.conf:

MasterServers = srvnetxms01.nrscorporation.com
LogFile = {syslog}
FileStore = C:\NetXMS\var
SubAgent = ping.nsm
SubAgent = portcheck.nsm
SubAgent = winperf.nsm

*WinPerf
Counter = SQLServerCPU:"\Process(sqlservr)\% Processor Time":60:A:INT:Average % CPU Time for sqlservr.exe over past minute


One general question.  What will happen on the agent when sqlservr process is not running.  Say it is restarting or it crashed or something like that?  How does the agent handle perfmon counters when they don't exist?

Thank You,
Kevin

Victor Kirhenshtein

For process counters in question, if process does not exist, counter will return 0. But in general, if you try to add non-existing performance counter, it may fail on agent startup, or may return error to data collection requests - depending on what PDH returns to agent.

Best regards,
Victor