Sar
System Activity Report
Enable sar logs
Step 1: install sysstat if there is no sar
# apt-get install sysstatStep 2: Open “/etc/default/sysstat” using your favorite file editor and change ENABLED=”false” to ENABLED=”true”
vi /etc/default/sysstat
vi /etc/default/sysstat
----
# Should sadc collect system activity informations? Valid values
# are "true" and "false". Please do not put other values, they
# will be overwritten by debconf!
ENABLED="true"
----Step 3: change the collection interval from every 10 minutes to every 2 minutes
vim /etc/cron.d/sysstat
# The first element of the path is a directory where the debian-sa1
# script is located
PATH=/usr/lib/sysstat:/usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin
# Activity reports every 10 minutes everyday
5-55/10 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1
# Additional run at 23:59 to rotate the statistics file
59 23 * * * root command -v debian-sa1 > /dev/null && debian-sa1 60Step 4. Restart the service.
Check swap
sar -S
check memory log
sar -r
Check Disk
Check cpu
sar -u 2 5
To Print Overall I/O Activities.
sar -b 3 3
To Print network statistics.
sar -n keyworks like dev /ip
Last updated
Was this helpful?