Sample Header Ad - 728x90

sysstat sar only collects cpu usage

1 vote
1 answer
1055 views
I'm running into a problem when using sar to collect live system statistics. When I run a sar command such as the following, I get the right output: $ sar -r 1 -o /tmp/memory_usage Linux 4.15.0-70-generic () 29/12/20 _x86_64_ (60 CPU) 18:26:55 kbmemfree kbavail kbmemused %memused kbbuffers kbcached kbcommit %commit kbactive kbinact kbdirty 18:26:56 30855140 78554416 51599624 62.58 321400 48906356 3491612 4.18 25558204 23859156 36 18:26:57 30855124 78554456 51599640 62.58 321400 48906392 3491612 4.18 25558204 23859212 72 18:26:58 30855204 78554536 51599560 62.58 321400 48906424 3491612 4.18 25558204 23859212 104 18:26:59 30855188 78554576 51599576 62.58 321400 48906456 3491612 4.18 25558204 23859268 136 18:27:00 30855204 78554648 51599560 62.58 321400 48906492 3491612 4.18 25558204 23859324 172 18:27:01 30855048 78554492 51599716 62.58 321400 48906524 3491612 4.18 25558228 23859324 0 ^C Average: 30855151 78554521 51599613 62.58 321400 48906441 3491612 4.18 25558208 23859249 87 However, when I load the output file, it seems to have only recorded the cpu usage? $ sar -f /tmp/memory_usage Linux 4.15.0-70-generic () 29/12/20 _x86_64_ (60 CPU) 18:26:55 CPU %user %nice %system %iowait %steal %idle 18:26:56 all 0.00 0.00 0.02 0.00 0.02 99.97 18:26:57 all 0.00 0.00 0.02 0.00 0.02 99.97 18:26:58 all 0.00 0.00 0.02 0.00 0.02 99.97 18:26:59 all 0.00 0.00 0.02 0.00 0.02 99.97 18:27:00 all 0.00 0.00 0.00 0.00 0.00 100.00 18:27:01 all 0.02 0.00 0.02 0.00 0.02 99.95 Average: all 0.00 0.00 0.01 0.00 0.01 99.97 This is my system's info: $ uname -a Linux 4.15.0-70-generic #79-Ubuntu SMP Tue Nov 12 10:36:11 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux I'm running sar 11.6.1, which was installed through apt, and I did not configure any cron data collection (if that matters), although I did enable the sysstat service: $ systemctl status sysstat ● sysstat.service - Resets System Activity Data Collector Loaded: loaded (/lib/systemd/system/sysstat.service; enabled; vendor preset: enabled) Active: active (exited) since Tue 2020-12-29 16:56:29 GMT; 1h 34min ago Docs: man:sa1(8) man:sadc(8) man:sar(1) Process: 52376 ExecStart=/usr/lib/sysstat/debian-sa1 --boot (code=exited, status=0/SUCCESS) Main PID: 52376 (code=exited, status=0/SUCCESS) Dec 29 16:56:29 systemd: Starting Resets System Activity Data Collector... Dec 29 16:56:29 systemd: Started Resets System Activity Data Collector. Any idea what I'm doing wrong? Why is the memory usage not being recorded in the file? Did I misconfigure something, or is this not possible to achieve with sar? Any and all help would be greatly appreciated.
Asked by Dash83 (183 rep)
Dec 29, 2020, 06:34 PM
Last activity: Dec 29, 2020, 07:57 PM