Monitoring Process Cpu and memory usage

Started by jhonnyvey, March 21, 2016, 03:06:54 AM

Previous topic - Next topic

jhonnyvey

Hi all,

I would like to monitor the consumption of CPU and Memory from windows server process.
I saw that it is possible to list all the processes of a host via agent.
What I need is when you have for cpu consumption for exemple in 90% that I can list which this process consuming.
Is there any way?

Tks all

tomaskir

Per-process memory usage is really easy, simply use NetXMS Agent's parameter

Process.WkSet("some_process.exe")


If you only have SNMP access, you can use this:
https://wiki.netxms.org/wiki/OS_process_monitoring_using_SNMP

As for monitoring CPU usage of individual processes - I personally dont know any way how to do that.

dmna007

Hi, I am trying to achieve the same as the first poster, basically when an alarm occurs  for cpu \ memory of a certain percentage (95%) , I want the alarm action to also generate a list of the running processes detailing their cpu and memory usage so I can identify the faulty application, I know how to do this in powershell and cmd, but I cannot workout how to trigger this via netxms, any help will be appreciated, thanks

Victor Kirhenshtein

Hi,

you can use Process.CPUTime to monitor CPU usage by specific process. Process.CPUTime returns cumulative counter in milliseconds of processor time spent by given process. You can use transformation as following to convert it to percentage:

1. Select delta calculation type "average delta per second".
2. Use the following transformation script:

return $1 / 10;

Best regards,
Victor

dmna007

Hi Victor thank you for your reply.  Process.CPUTime appears you have to specify the application instance that you wish to monitor "Total execution time for process", so you have to specific the process, in our scenario we have hundreds of processes.

The issue we have relates mostly to out of hours alerts for server high cpu usage, we cannot see which application has taken 99% of the CPU unless we login to the server and review windows task manager.

If we could on an alarm event occurring generate a list of all the running processes on the windows server detailing their CPU and memory usage I can then identify the application causing the alarm.

I note that one of the actions can be 'execute command on remote node via agent' - do these commands support powershell?  If so I could call a powershell script using this feature to dump process information to a text file for review the next day?

Thanks, Damien

Victor Kirhenshtein

Yes, you can execute any command including powershell. There are some examples on forum.

Best regards,
Victor