Results 1 to 4 of 4
Hi,
I need the equivalent of `prstat -Z -n 1 1 1` command in Linux.
My script is something like this:
$prstat_out=`prstat -Z -n 1 1 1`;
lines = split ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 07-10-2012 #1Just Joined!
- Join Date
- Jul 2012
- Posts
- 2
Solaris to Linux porting (prstat -Z -n 1 1 1 ----command help)
Hi,
I need the equivalent of `prstat -Z -n 1 1 1` command in Linux.
My script is something like this:
$prstat_out=`prstat -Z -n 1 1 1`;
lines = split (/\n/, $prstat_out);
foreach $line (lines){
if ($line =~ /(\s+)(\d+)(\s+)(\d+)(\s+)(\d+.*)(\s+)(\d+.*)(\s+)( \d+)%(\s+)(.*).*).*)(\s+)(.*)% global/){
$proc_usage=$16;
print "The CPU usage is $proc_usage ";
This will print the CPU usage in percentage in Solaris.
Can anybody help me in knowing the equivalent in Linux.
Thanks,
Henry
- 07-10-2012 #2Just Joined!
- Join Date
- Dec 2010
- Posts
- 1
Solaris to Linux porting (prstat -Z -n 1 1 1 ----command help)
Try 'top -n 1' - and rearrange your parsing logic...
- 07-11-2012 #3Just Joined!
- Join Date
- Jul 2012
- Posts
- 2
Thanks
The issue is solved...
- 07-11-2012 #4Just Joined!
- Join Date
- May 2006
- Posts
- 36
Although the topic is solved, this might add some info for others that are looking for something similar:
DTrace Troubleshooting


Reply With Quote
