SAR (System Activity Monitor) command, frequently used monitoring command in Linux and Unix flavors. sar utility provided by the sysstat package in Linux.
In top we can view the real time analysis (CPU, Memory, load) when we logged into the server. But sar can be used to log the historical events in the server to analyze the bottlenecks with respect to CPU, Memory and load averages in the past.
sysstat package also installs other packages like iostst,pidstat,mpstat,sar etc..
sar utility also installs cron job function to record the historical events.
# vim /etc/cron.d/sysstat
The first cron job used to record the system events for every 10 minutes. Depends on requirement we can change it.
The second cron job runs at midnight to save the daily summary report.
# sar 2 5
Displays 5 values of cpu usages with 2 sec interval.
# sar -r 1 3
In top we can view the real time analysis (CPU, Memory, load) when we logged into the server. But sar can be used to log the historical events in the server to analyze the bottlenecks with respect to CPU, Memory and load averages in the past.
sysstat package also installs other packages like iostst,pidstat,mpstat,sar etc..
sar utility also installs cron job function to record the historical events.
# vim /etc/cron.d/sysstat
The first cron job used to record the system events for every 10 minutes. Depends on requirement we can change it.
The second cron job runs at midnight to save the daily summary report.
We can also edit the sysstat configuration from the below file.
# vim /etc/sysconfig/sysstat
The HISTORY and COMPRESSAFTER parameters used to store the sar log files for a specified period of time.# vim /etc/sysconfig/sysstat
To view the CPU usage of a system.
# sar 2 5
Displays 5 values of cpu usages with 2 sec interval.
To view the memory usage of a system
# sar -r 1 3
Displays 3 values of memory usage with 1 sec interval.
# uptime
The uptime command used to view
1. how long the server is running(uptime)
2.The no of users logged into the server
3.Load average of the server with interval 01,05,15 minutes.
To view the server uptime
# uptime
The uptime command used to view
1. how long the server is running(uptime)
2.The no of users logged into the server
3.Load average of the server with interval 01,05,15 minutes.