A
Alice Stamp
Hi
(Tried to post this last night, but Google seems to have swallowed it.)
I have a script which makes use of the cpu data which I can read from
/proc/stat on Linux. I need to know the number of jiffies the cpu has
spent in user, system, and idle modes since boot up - easy enough to
do on Linux :
====
open (DATA, "/proc/stat");
my $rd;
do{
$rd = <DATA>;
} until ($rd =~ /^cpu/);
close PSF;
my @cline = split (/ /, $rd);
my $u = $cline[2];
my $s = $cline[4];
my $i = $cline[5];
====
I now need to write a similar perl script which does the same on
solaris (i.e. end up with the amount of time the cpu has spent in each
mode in three variables.
I know that /proc doesn't have these kernel 'summary' files that Linux
has, and the output from iostat doesn't really help. Is there another
utility I can call to pull out this data, or can someone recommend a
module which supplies the data I need (amount of time SINCE BOOT)
spent in each mode.
Thank you for any help that you can offer.
BR
AS
(Tried to post this last night, but Google seems to have swallowed it.)
I have a script which makes use of the cpu data which I can read from
/proc/stat on Linux. I need to know the number of jiffies the cpu has
spent in user, system, and idle modes since boot up - easy enough to
do on Linux :
====
open (DATA, "/proc/stat");
my $rd;
do{
$rd = <DATA>;
} until ($rd =~ /^cpu/);
close PSF;
my @cline = split (/ /, $rd);
my $u = $cline[2];
my $s = $cline[4];
my $i = $cline[5];
====
I now need to write a similar perl script which does the same on
solaris (i.e. end up with the amount of time the cpu has spent in each
mode in three variables.
I know that /proc doesn't have these kernel 'summary' files that Linux
has, and the output from iostat doesn't really help. Is there another
utility I can call to pull out this data, or can someone recommend a
module which supplies the data I need (amount of time SINCE BOOT)
spent in each mode.
Thank you for any help that you can offer.
BR
AS