Someone help me


 
Thread Tools Search this Thread
Special Forums UNIX Desktop Questions & Answers Someone help me
# 1  
Old 05-03-2004
Someone help me

hi,
im doing an awk script to display some information of the current state of the system, and i can't find how to display general information of the CPU (average use, sleeps process, etc..)

if somebody can help me, I really appreciate it
Thanks
# 2  
Old 05-04-2004
You'll need to use other commands to find your CPU info, and then use tools like grep or awk to get the parts you want out of there.

The commands you need will depend on exactly what information you are looking for, and also which version of Unix you are on. I usually work on Sun Solaris, and the commands I'd look at for something like this are prtdiag, ps, psrinfo, or maybe some of the proc tools like ptree. Maybe do a man on those (or the equivalent for your OS) and see if they can tell you what you need.
# 3  
Old 05-05-2004
I am currently working on a Perl/Java solution that will gather and display various system information and statistics.

http://www.zazzybob.com/zsysinfo.html

is the project page. You can view a sample page of it's output here:

http://www.zazzybob.com/info_outfile.html

You'll need the Java plug-in for your browser if you want to see the graphical percentage displays.

Bear in mind that I've only been working on this project for a couple of days, so it's still in it's infancy! At present this is a Linux only project.

Cheers
ZB
http://www.zazzybob.com
# 4  
Old 05-27-2004
Just thinking about this one again....

If you want to get current CPU info (CPU states, processes, etc) you could run top in non-interactive batch mode (in Linux at least).

Code:
top -b -n 1 > top.out

This runs 1 iteration of top and saves the output in plain text format to top.out.

Cheers
ZB
# 5  
Old 05-27-2004
Re: Someone help me

Quote:
Originally posted by grillonegro
hi,
im doing an awk script to display some information of the current state of the system, and i can't find how to display general information of the CPU (average use, sleeps process, etc..)

if somebody can help me, I really appreciate it
Thanks
'

Hey bro, it really helps if you specify your flavor of UNIX... to pull cpu info... some versions like mine, HPUX have specific commands that can be used to do this.
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question