Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Load information in Solaris (Perl Script.)

Reply
Thread Tools

Load information in Solaris (Perl Script.)

 
 
Alice Stamp
Guest
Posts: n/a
 
      11-05-2004
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
 
Reply With Quote
 
 
 
 
Tad McClellan
Guest
Posts: n/a
 
      11-05-2004
Alice Stamp <(E-Mail Removed)> wrote:


> open (DATA, "/proc/stat");


> close PSF;



One of those things is not like the other, one of those things
just doesn't belong...



> Is there another
> utility I can call to pull out this data,


comp.unix.solaris is over that-a-way ---->




--
Tad McClellan SGML consulting
http://www.velocityreviews.com/forums/(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
 
 
 
Peter Michael
Guest
Posts: n/a
 
      11-05-2004
Alice,

"Alice Stamp" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed) om...

> 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 :


[snip]

> 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.


Have a look at the Solaris::Kstat module.

HTH,

Peter

 
Reply With Quote
 
Michele Dondi
Guest
Posts: n/a
 
      11-05-2004
On 4 Nov 2004 17:09:50 -0800, (E-Mail Removed) (Alice Stamp) wrote:

>open (DATA, "/proc/stat");


As a side note to what has already been said, that is an unfortunate
choice as the name for your fh. Why not using a lexical fh anyway?


Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Information technology is incomplete without information security alannis.albert@googlemail.com Computer Support 0 04-14-2008 06:42 AM
perl to parse out iostat information on solaris 9 inetquestion Perl Misc 4 08-09-2007 10:51 AM
More Information than just IIS Log Information subrato ASP .Net 8 03-14-2006 09:59 PM
signer information does not match signer information of other classes in the same package clercmedia Java 2 12-09-2005 03:14 PM
strange information from asp.net trace / getting performance information using WebRequest and StreamReader z. f. ASP .Net 0 02-03-2005 11:23 AM



Advertisments