Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

multiple processes...cpu load....madness



I've got multiple sessions of Tomcat installed; what's the best way to check if each is running (and CPU load, if possible).

Right now I'm using a derivation of something another kind AS user gave me, in addition to some other fun stuff:

do shell script "ps -ax | grep java| grep -v grep"

which returns:
"  196  ??  S      0:10.89 /Library/Java/Home/bin/java -Djava.util.logging.manag
15865  p1  S      0:07.17 /Library/Java/Home/bin/java -Djava.util.logging.manag"

This is great, as it shows two separate (running) instances, although I'd like the full text, not the abbreviated one that cuts off after so many characters, like so:

/Library/Java/Home/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/Library/Tomcat/apache-tomcat-5.5.20/conf/logging.properties -Djava.endorsed.dirs=/Library/Tomcat/apache-tomcat-5.5.20/ (something goes here which I can't see...)


and then I can use this to get CPU load on the first process:

do shell script "ps -axwwo %cpu,command | awk '/org\\.apache\\.catalina/{ print $1; exit } /org\\.apache\\.tomcat/{ print $1; exit }'"


Any ideas on the best way to 1) return a value to check if multiple instances are running, and 2) return a CPU load value for each?


Thanks,
j
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.