NetXMS Support Forum

English Support => General Support => Topic started by: kghammond on February 08, 2008, 05:31:16 PM

Title: Process.UserTime, Process.KernelTime
Post by: kghammond on February 08, 2008, 05:31:16 PM
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
Title: Re: Process.UserTime, Process.KernelTime
Post by: Victor Kirhenshtein on February 08, 2008, 05:59:01 PM
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 (https://www.netxms.org/forum/index.php/topic,88.msg381.html#msg381)
Title: Re: Process.UserTime, Process.KernelTime
Post by: kghammond on February 08, 2008, 06:20:47 PM
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.
Title: Re: Process.UserTime, Process.KernelTime
Post by: kghammond on February 08, 2008, 07:12:06 PM
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
Title: Re: Process.UserTime, Process.KernelTime
Post by: Victor Kirhenshtein on February 12, 2008, 11:48:18 PM
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