Forum Discussion

Stephen_C's avatar
Stephen_C
Icon for Neophyte rankNeophyte
8 months ago

Monitoring Top 10 processes on Windows and Linux platforms

I'm exploring monitoring the top 10 processes by resource usage on Linux and Windows systems.

I'm aware there are modules available to monitor specific processes - but was curious as to whether anyone has had the same requirement and created a module.

My thinking is to create instances for each process of the top 10 - but right now I am still busy brainstorming...

  • Anonymous's avatar
    Anonymous

    https://github.com/sweenig/lm/tree/main/ProcessMonitoring

  • Thanks Stuart - but if I am not mistaken this would not limit what is returned to the top 10 based on resource usage (cpu or mem) but rather return metrics for either the processes specified, or all processes?

    • Anonymous's avatar
      Anonymous

      Correct, but since the top 10 can change from minute to minute, you can't just track the top 10. You have to track all of them and do the top 10 based on the data you gather, judging which will be the top 10 on more than just what are the top 10 at the moment.

  • FYI I'm working right now on a DataSource which will use SNMP for collecting process memory, CPU, etc. from Linux hosts, instead of calling "ps" via SSH which is what Stuart's does. 

    I am hoping to make a viable version which will indeed create Instances for only the "Top X" based on memory usage, which I'm hoping is consistent enough that if "X" is at least 15 or 20 (number of Instances to be created) then with AD running every 15 minutes there won't be so much turnover on the Instances as to be useless. (I'm starting off with the PID as the Wildvalue.) 

    If that doesn't work I might try making the Wildvalue out of the process name in the hopes that there will be some consistency there instead. 

    In general trying to capture the "Top X" utilization for dynamic things like processes is a balancing act between collecting metrics for everything vs. not enough.

    I'm hoping that the SNMP Collect (batch script) won't be too hard-hitting on the device or Collector, because it ought to be just 3 SNMP walks total per collect - similar to the LM Core DS "LinuxNewProcesses" locator PMEZLA (except that one is Script not Batchscript)