All HowTo's Linux Redhat, Fedora and CentOS Linux

View past performance of a RHEL or CentOS system

You can easily see how hard (or not) a Redhat or CentOS system was running on any given day within the past month.

For example, if you want to know how hard a system was working three days ago, you can. Here’s how.

The “sar” command shows “todays” performance. It gets this information from “/var/log/sa/”. There are two sets of files in this directory. One set is binary and the other is text. For this, we’ll focus on text.

ls -l /var/log/sa/sar*

You will get a list of text files. You can view these with “less” or “more” and you can even do a little “bash” work to get something more meaningful such as CSV output.

egrep -v '^$|Linux|CPU' /var/log/sa/sar26 | awk '{print $1,$2,$12}' | sed 's/ /,/g' > /tmp/sar26.csv

The above will go through the “sar” log for the 26th of this month and output it to “/tmp/sar26.csv” with a comma between fields. Ok, you can do better with quotes but this is a simple “how to”.

Leave a Reply

Your email address will not be published. Required fields are marked *