Saturday, October 20, 2007

Monitoring disk I/O and CPU utilization

Red Hat Linux has a tool that collects data installed, to view the data you can use the sar command from the command line.

To find out how many processes were running and the one minute, five minute and fifteen minute load averages you can type 'sar -r' (without the quotes).

To find out RAM and swap disk memory usage you can type 'sar -q' (without the quotes). To look at I/O statistics you can type 'sar -b' (without the quotes).

sar by default will only show the last day's activity. How far back you can go depends on how you set up the log rotation schedule. Older sar activity files are found in the /var/log/sa directory listed by date.

For instance, today is the 20th, if you want to look at the sar logs for yesterday you can type 'sar -r -f /var/log/sa/sa19' (without the quotes).

If you need additional information you can get a monitoring script set up that can capture a process list. This can get automated by use of a cron entry.

sar has many other options, you can do a 'man sar' (without the quotes) to read up on them.

Labels: