On Thursday, May 30, 2002, at 10:42 , Kipp, James wrote:
as for why I do old dog flag tricks - to be honest - they make me feel safer.... I know that i will not even look at anything, and I get the 'freebie' of not needing to deal with a RegEx resolution - which I think is more expensive - and I could do a benchmark - or you could if you wished. [..] > funny you should say this. Do my Temple Locks give me away or what? You think I just fell off the boat looking like this???? > little background: the captured data will be > insterted into a few oracle DB tables for later querying. as of now i am > opening 2 pipes and will love to emlinate one of them. so your idea here > may > be the solution. > -snip-- > $ps = '/usr/bin/ps -eo user,pcpu,pmem,vsz,comm'; > $pr = '/usr/bin/prstat -t'; > open (PIPE, "$ps|") or die "could not pipe command: $!"; > open (PIPE2, "$pr|") or die "could not pipe command: $!"; > > while (<PIPE>) { > next if $_ =~ /USER/; # # why not clean the front first and not need a $null # s/^\s+//; my($user,$cpu,$mem,$vmem,$cmd) = split(/\s+/); print ":$user:$cpu:$mem:$vmem:$cmd:\n"; #Try it - you'll like it.... > my($null,$user,$cpu,$mem,$vmem,$cmd) = split(/\s+/); > } > > while (<PIPE2>) { > next if $_ =~ /NPROC/; > my($tuser,$tcpu,$tmem) = (split(/\s+/)) [2,5,7]; > last if $_ =~ /^Total/i; > } > .. > .. > close PIPE; > close PIPE2; > -snip-- as you just noticed - you have one poll of data with ps through /proc and another with /prstat -t ..... why not whack one set of them.... Ein popen! Ein DataTree! Ein InsertionPointForUpdate!!! one way of doing this would be to modify my basic psTree grovellor to take in what you are looking for.... http://www.wetware.com/drieux/pbl/Sys/psTree.txt or maybe you modify your $ps cmd a little, and git rid of this meshugenna prstat such like it is portable with what and will not run into the gnu printer status code by the same name??? I still say it wouldn't hurt you to open it up and find out how simple grovelling the process table really is, or maybe better yet, you finally just get silly and pull down say http://search.cpan.org/search?module=Solaris::Procfs and see what you can do to upgrade it some.... Trust me - it's only a solaris box - it's not like you have to get howard's multi-cpu variant for Crays - now that was mensch molly wonking code to grovellate through.... ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]