Reputation: 4529
Is there a way to get the CPU usages of several jboss nodes in linx?
I stared the nodes according to the following syntax
home/xxx/jboss-4.0.3SP1/bin/run.sh -c node1 -b localhost
home/xxx/jboss-4.0.3SP1/bin/run.sh -c node2 -b localhost
But the problem is the process name is "java" for both of the processes above.(But have difference PID s) Is there a way to differentiate above two process ?
If I use top | grep 'java' It showing all but not individually. E.g: I want to get the CPU usage of node1 only , node2 only , both node1 and node2. I play with some grep parameter changes but no luck.
And also I don't need to watch like "top" command I want the CPU usage of that java process (e.g: node1) at that time.
thanks.
Upvotes: 1
Views: 622
Reputation: 14619
Try this ps
command instead of top
:
ps -C java -o pid,tid,pcpu,cmd
For more details on ps
, see ps(1)
If you want to filter the results, the popular tool is grep
:
ps -C java -o pid,tid,pcpu,cmd | grep 'home/xxx/jboss-4.0.3SP1/bin/run.sh'
Upvotes: 1