Jared
Jared

Reputation: 31

How to log the Ram and CPU usage for Linux Processes

How would I track the CPU and Ram usage for a process that may run, stop, and then re-run with a different PID?

I am looking to track this information for all processes on a Linux server but the problem is when the process stops and restarts, it will have a different PID and I am not sure how to identify it as the same process.

Upvotes: 3

Views: 5264

Answers (3)

jsist
jsist

Reputation: 5253

You can setup a crontab to record output of commands like

  1. top -b -n1 | grep
  2. ps ux | grep

Alternatively, you can use sealion service. By simply installing agent and configuring it according to your needs in simple steps, you can see output of the executed commands online.

Hope it helps...

Upvotes: 0

user149341
user149341

Reputation:

What you're looking for here is called "process accounting".

http://tldp.org/HOWTO/Process-Accounting/

Upvotes: 2

Bjoern
Bjoern

Reputation: 16314

If you know the command of the process, just pipe it to a grep like this:

ps ux | grep yourcommandgoeshere

Upvotes: 0

Related Questions