In this recipe, we are going to show how to use the
sar command in combination with various switches to analyze historical CPU load during some time in the past.
The commands used in this recipe have been performed on a CentOS Linux machine. The command output may vary in other Linux and Unix-based operating systems.
The sar command when used with the
-u switch is used to display CPU statistics. When used this way, the sar command will report on the current day's activities.
If we are looking to analyze the CPU statistic over some time period in the past we would need to use the -f switch in conjunction with the
-u switch of the
sar command. The
-f option is followed by the files that