techworm
techworm

Reputation: 51

Linux / CentOS - Need to monitor a specific process

Please help. So, I'm given a task to monitor a particular process in CentOS.

There are certain requirements.

  1. Can't monitor using PID, because once process is killed or dead, solution is of no use.
  2. It'll be great if I could know how much is the consumption of each thread of a process.

I've researched enough but with no success.

Thanks in advance.

Upvotes: 0

Views: 569

Answers (1)

YoshiMbele
YoshiMbele

Reputation: 999

I am uncertain what exactly you are trying to achieve, but this is how I would proceed:

Suggested Approaches

Multiple Process IDs per process name

top -H -p $(pgrep <process_name> | paste -s -d, -)

Single Process ID per process name

top -H -p $(pgrep <process_name>)

Further reading

Suggestion

Maybe think about implementing a solution like Prometheus with Node Exporter or Zabbix or Nagios.

Upvotes: 1

Related Questions