LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-21-2009, 07:34 AM   #1
soltanloo
Member
 
Registered: Jun 2009
Posts: 39

Rep: Reputation: 15
mpstat command


Hi
i have linux-fedora10. the mpstat or iostat or sar command doesn't work on my linux.

Code:
[soltanloo@localhost 88-2-21]$ mpstat
bash: mpstat: command not found
how can i fix it ? do i need to install a package ? i'm beginer with linux. in fact i want to read cpu usage. for example with top command. i want to read it in a C program.
in fact i want to write the output of mpstat in a text file and then extract my information from it.
can anyone help me ?

and i have a another problem : how can i write output of mpstat to a tezt file ? i know this :

Code:
mpstat >> test.txt
but it doesn't work good for top command.

i'll thank u for helping me.
 
Old 07-21-2009, 07:36 AM   #2
soltanloo
Member
 
Registered: Jun 2009
Posts: 39

Original Poster
Rep: Reputation: 15
my linux version

Code:
[soltanloo@localhost 88-2-21]$ cat /proc/version
Linux version 2.6.27.5-117.fc10.i686 (mockbuild@x86-7.fedora.phx.redhat.com) (gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) ) #1 SMP Tue Nov 18 12:19:59 EST 2008
 
Old 07-21-2009, 07:41 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
"man top"
You need to run it in batch mode - then you can redirect the output. Best done with "-n 1" as well.

mpstat is part of the sysstat package - install that.
 
Old 07-21-2009, 07:43 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You either don't have the sysstat package installed or you don't have /usr/bin/ in your PATH variable.

Mpstat writes it's output to stdout, so you can use indirection to append to a file.

Last edited by jschiwal; 07-21-2009 at 07:47 AM.
 
Old 07-23-2009, 07:46 AM   #5
soltanloo
Member
 
Registered: Jun 2009
Posts: 39

Original Poster
Rep: Reputation: 15
thank u my friends.
i installed sysstat and now mpstat is working good.
i used this code:
Code:
yum install sysstat
thanks
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
sar iostat sadf mpstat ? vmstat ? for Cent OS 4.2 rafiqul Linux - Newbie 6 07-16-2013 02:29 PM
can't install iostat, mpstat on fedora core 1 sneakyimp Linux - Software 4 09-10-2007 11:02 PM
how to install iostat, mpstat, vmstat commands in RHEL 3.0 kgvs_prasad Linux - Enterprise 2 02-08-2005 12:02 PM
Monitoring Script (using mpstat) tip ganninu Programming 0 05-12-2004 05:31 AM
Cannot find sar, mpstat, iostat etc. on RedHat 8 rlinuxr Linux - Software 1 08-05-2003 06:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration