Sar
Jump to navigation
Jump to search
Monitoring server resources is a crucial part of identifying any bottlenecks and possible issues on your server. The sar
command allows you to capture the utilization of your resources like RAM, CPU, Disk I/O and etc
on Ubuntu, sar can be installed by
$sudo apt install sysstat
sar system service
sar can be run as system service
- sudo systemctl start sysstat
- sudo systemctl enable sysstat
- This will add the required cron jobs so that the system data is collected accordingly. The cron jobs will be added at cat /etc/cron.d/sysstat
Command and options
sar has a lot of arguments and options,
Options | Description |
---|---|
sar -u 2 30
|
-u for all CPU,
|
sar -r 2 30
|
-r for memory |
sar -n DEV 4 | -n for network interfaces,
4 means that the sar command should run every 2 seconds |