Using System Activity Report (SAR) in Linux For Present & Past System Performance Monitoring

Using System Activity Report (SAR) in Linux For Present & Past System Performance Monitoring

HomeOther ContentUsing System Activity Report (SAR) in Linux For Present & Past System Performance Monitoring
ChannelPublish DateThumbnail & View CountActions
Channel Avatar Nehra Classes2020-10-12 13:19:53 Thumbnail
18,249 Views
Using System Activity Report (SAR) in Linux For Present & Past System Performance Monitoring:
====
System Activity Report (sar) is a Unix System V-derived system monitor command used to report on various system loads, including CPU activity, memory/paging, interrupts, device load, network and swap space utilization. Sar uses /proc filesystem for gathering information.

# dnf repolist

# dnf install sysstat -y

# systemctl start sysstat

# systemctl enable sysstat

It collects the data every 10 minutes and generate its report daily. Below crontab file is responsible for collecting and generating reports.

# vim /etc/cron.d/sysstat
# Run the tool at every 10 minutes automatically.
*/10 * * * * root /usr/lib64/sa/sa1 1 1
# Generate a daily summary of process accounting at 23:55
55 23 * * * root /usr/lib64/sa/sa2 -A

Below is the Config File of SysStat ( sar command ).
# cat /etc/sysconfig/sysstat

Example:1 Generating CPU Report on the Fly 6 times at every 3 seconds.
# sar 3 6

If the %I/O wait is more than zero for a longer period of time then we can consider there is some bottleneck in I/O system (Hard disk or Network).

Example:2 Saving sar output to a file using -o
# sar 2 5 -o /tmp/data

use “sar -f filename” to display the reports.
# sar -f /tmp/data

Example:3 Generating Memory Usage report using -r option in the sar command which is used to generate memory usage report.
# sar -r 3 6
kbcommit & %commit is the overall memory used including RAM & Swap

Example:4 Generating Paging Statistics Report using -B
-B option in the sar command is used to display paging statistics.
# sar -B 3 6
In the report majflts/s shows the major faults per second means number of pages loaded into the memory from disk (swap), if its value is higher then we can say that system is running of RAM.

%vmeff indicates the number of pages scanned per second, if it’s vaule is 100 % its is consider OK and when it is below 30 % then there is some issue with virtual memory. Zero value indicates that there is no page scanned during that time.

Example:5 Generating block device statistics report using -d
-d option in the sar command is used to display the block device statistics report. Using option -p (pretty-print) along with -d make the dev column more readable, example is shown below :
# sar -d -p 2 4

Example:6 Generating Network statistic report using -n
-n option in the sar command is used to generate network statistic report. Below is the synatx :
# sar -n {keyword} or {ALL}

To generate all network statistic report use below command :
# sar -n ALL

Example:7 Reading SAR log file using -f
As we have discuss that sar logs files are kept under /var/log/sa/saDD, using -f option in sar command we can read the log files.
# sar -r -f /var/log/sa/sa12
*****
Thanks for watching the video. If it helped you then, please do like & share it with others as well. Feel free to post your queries & suggestions, we will be glad to answer your queries.
If you like our hard work then do subscribe to our channel & turn on the bell notification for latest updates.
*****
Join this channel to get access to perks:
https://www.youtube.com/channel/UCvk2Fst1h1a0StSnUcvGfBQ/join
*****
My PC: https://amzn.to/30amhRt
My DSLR Camera: https://amzn.to/36954Ml
My Boya Microphone: https://amzn.to/3mZavTS
My Mobile: https://amzn.to/2HCdilL
My Router: https://amzn.to/3mXC0x7
My TV Entertainment System: https://amzn.to/345150F
My Head-Phone: https://amzn.to/3ie4rDB
My Smart Watch: https://amzn.to/3cRbPUt
******
Contact Us:
WhatsApp: https://bit.ly/2Kpqp5z
Telegram Channel: https://t.me/NehraClasses
Email: [email protected]
Registration Form: http://bit.ly/NehraClassesRegForm
******
Follow Us On Social Media Platforms:
Twitter: http://bit.ly/NehraClassesTwiiterHandle
Facebook Page: www.facebook.com/nehraclasses
Instagram: https://www.instagram.com/nehraclasses/
Website: http://bit.ly/NehraClassesWebpage
=======
©COPYRIGHT. ALL RIGHTS RESERVED.

Please take the opportunity to connect and share this video with your friends and family if you find it useful.