LinuxQuestions.org
Visit Jeremy's Blog.
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 09-03-2018, 08:14 AM   #1
niculelu
LQ Newbie
 
Registered: Aug 2018
Posts: 24

Rep: Reputation: Disabled
sar


hi,
i like to collect cpu,memory statistics using sar.
from sa1 or sa2 man
5 19 * * 1-5 /usr/lib/sa/sa2 -A &
5 19 * * 1-5 /usr/lib/sa/sa1 1200 5 &
the above to be written in root crontab.
my question is if the above script will collect information about memory and disk beside cpu.
tnx
 
Old 09-03-2018, 09:00 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,637

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by niculelu View Post
hi,
i like to collect cpu,memory statistics using sar.
from sa1 or sa2 man
5 19 * * 1-5 /usr/lib/sa/sa2 -A &
5 19 * * 1-5 /usr/lib/sa/sa1 1200 5 &
the above to be written in root crontab.
my question is if the above script will collect information about memory and disk beside cpu.
tnx
You have been asked several times to STOP using text-speak. It is "thanks", not "tnx"...read the LQ Rules.

And again, as you've been told before, reading the man pages should be something you do. it will tell you what those commands will capture.
 
Old 09-03-2018, 10:50 PM   #3
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by niculelu View Post
hi,
my question is if the above script will collect information about memory and disk beside cpu.
The sa1 script generates a binary file named /var/log/sa/saXX (where XX is the date in the month), and at the end if the day sa2 converts that to an ASCII file /var/log/sa/sarXX.

From the sar man page:

Quote:
-A
This is equivalent to specifying -bBdqrRSuvwWy -I SUM -I XALL -n ALL -u ALL -P ALL
sa2 has the same parameters as sar, so your invocation collects everything. If you don't want everything, replace -A with the appropriate parameters to just get the metrics you want.
 
  


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
LXer: SAR – Linux System Performance Monitoring (Check Server Activity Logs Using SAR Command) LXer Syndicated Linux News 0 01-23-2017 04:27 PM
SAR subratkprusty Linux - Software 2 08-11-2013 02:54 PM
About sar satimis Linux - Software 2 06-14-2006 04:35 AM
Sar -b DotHQ Linux - General 0 05-04-2006 07:44 AM
Sar sathish80 Linux - Newbie 1 01-16-2006 06:57 AM

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

All times are GMT -5. The time now is 01:09 AM.

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