{"id":6979,"date":"2023-01-11T11:16:05","date_gmt":"2023-01-11T11:16:05","guid":{"rendered":"https:\/\/davelevy.info\/wiki\/?p=6979"},"modified":"2023-01-11T11:38:23","modified_gmt":"2023-01-11T11:38:23","slug":"installing-sar-on-raspbian-buster-and-ubuntu-22-04-using-systemd","status":"publish","type":"post","link":"https:\/\/davelevy.info\/wiki\/installing-sar-on-raspbian-buster-and-ubuntu-22-04-using-systemd\/","title":{"rendered":"Installing &#8216;sar&#8217; on Raspbian buster and Ubuntu 22.04 using systemd"},"content":{"rendered":"<p>The utility sar is part of the sysstat package. \u00a0Note the double \u2018s\u2019. Most articles\/documentation state that the jobs should be run using cron. On Raspbian buster and Ubuntu 22.04 this no longer works, the utilities work, but the historical database is not collected nor stored. These systems require that systemd run the collector.<\/p>\n<p><!--more--><\/p>\n<p>Here\u2019s how I now install sar on Raspbian buster &amp; Ubuntu 22.04<\/p>\n<pre>apt-get install sysstat<\/pre>\n<p>then configure the package to collect &amp; store the metrics<\/p>\n<pre>dpkg-reconfigure sysstat; # answer Yes to the question<\/pre>\n<p>then enable and start the service<\/p>\n<pre>systemctl enable sysstat; systemctl start sysstat;\r\nsystemctl enable sysstat-collect.timer; systemctl start sysstat-collect.timer;\r\nsystemctl enable sysstat-summary.timer; systemctl start sysstat-summary.timer;\r\n<\/pre>\n<p>TBH I am not sure if the timers need to be started, but it doesn&#8217;t seem to do any harm.<\/p>\n<p>Now, sar will collect the stats and record them in its database. This is held in \/var\/log\/sysstat, which is different from other documentation sources and the collector configuration parameters are held \/etc\/sysstat\/sysstat.<\/p>\n<p>I got all this from <a href=\"https:\/\/askubuntu.com\/questions\/839795\/cannot-open-var-log-sysstat-sa20-no-such-file-or-directory\">one answer<\/a> at AskUbuntu written by <a href=\"https:\/\/askubuntu.com\/users\/720219\/yvan\">Yvan<\/a>. Thank you for this.<\/p>\n<p>This has a short link of <a href=\"https:\/\/wp.me\/pauVx4-1Oz\">https:\/\/wp.me\/pauVx4-1Oz<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The utility sar is part of the sysstat package. \u00a0Note the double \u2018s\u2019. Most articles\/documentation state that the jobs should be run using cron. On Raspbian buster and Ubuntu 22.04 this no longer works, the utilities work, but the historical database is not collected nor stored. These systems require that systemd run the collector.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","_share_on_mastodon":"0"},"categories":[8,3],"tags":[1883,54,916,1286,1881,1882,1056,911,1884],"class_list":["post-6979","post","type-post","status-publish","format-standard","hentry","category-linux","category-technology","tag-buster","tag-howto","tag-linux","tag-raspbian","tag-sar","tag-sysstat","tag-systemd","tag-technology","tag-ubuntu-22-04"],"share_on_mastodon":{"url":"","error":""},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/6979","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/comments?post=6979"}],"version-history":[{"count":0,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/6979\/revisions"}],"wp:attachment":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/media?parent=6979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/categories?post=6979"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/tags?post=6979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}