{"id":6972,"date":"2023-01-08T10:55:48","date_gmt":"2023-01-08T10:55:48","guid":{"rendered":"https:\/\/davelevy.info\/wiki\/?p=6972"},"modified":"2025-11-02T12:39:57","modified_gmt":"2025-11-02T12:39:57","slug":"linux-performance-monitoring","status":"publish","type":"post","link":"https:\/\/davelevy.info\/wiki\/linux-performance-monitoring\/","title":{"rendered":"Linux Performance Monitoring"},"content":{"rendered":"\n<p>Today, <code>sar<\/code>, it seems is not part of the Debian distros, one needs to install the package <code>sysstat<\/code>.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>Actually Raspbian has it installed and the CLI commands work, the question is how to set up the collector. <strong>NB<\/strong> the Debian file locations have been hard to find and the documentation suggests it runs through <code>cron<\/code> and not a specific daemon, so no <code>systemd<\/code>. Later reading suggests that <code>systemd<\/code> is used on <em>Ubuntu 22.04<\/em> and that <code>cron<\/code> silent fails, which is what I discovered. For more about cron see <a href=\"https:\/\/pimylifeup.com\/cron-jobs-and-crontab\/\">cron jobs and crontab<\/a><\/p>\n\n\n\n<p>The Raspbian and Ubuntu implementations may be different.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">SAR &amp; sysstat<\/h3>\n\n\n\n<p>Until sometime in 2022, the advice was to install the package, enable by editing its conf file, upload the crontab to the cron daemon. However at some point in 2022, it became&nbsp; <a href=\"https:\/\/askubuntu.com\/questions\/839795\/cannot-open-var-log-sysstat-sa20-no-such-file-or-directory\">necessary to use dpkg-reconfigure<\/a> and <code>systemd<\/code> and not the cron files, which don&#8217;t fucking work on <strong>Ubuntu<\/strong>. Here is <a href=\"https:\/\/www.server-world.info\/en\/note?os=Ubuntu_22.04&amp;p=sysstat&amp;f=1\">the Ubuntu documentation<\/a> page from serverworld, and here is <a href=\"https:\/\/manpages.ubuntu.com\/manpages\/jammy\/man8\/sadc.8.html\">ubuntu&#8217;s man sadc<\/a> and <a href=\"https:\/\/manpages.ubuntu.com\/manpages\/jammy\/man1\/sar.sysstat.1.html\">man sar<\/a>. The database is held in <code>\/var\/log\/sysstat<\/code>. <span data-offset-key=\"cq0ms-0-0\">I wrote a blog snip with step-by-step instructions on installing `<\/span><span data-offset-key=\"cq0ms-1-0\">#sar<\/span><span data-offset-key=\"cq0ms-2-0\">` on <\/span><span data-offset-key=\"cq0ms-3-0\">#Raspbian<\/span><span data-offset-key=\"cq0ms-4-0\"> buster &amp; <\/span><span data-offset-key=\"cq0ms-5-0\">#Ubuntu22<\/span><span data-offset-key=\"cq0ms-6-0\">.04 LTS to run with `<\/span><span data-offset-key=\"cq0ms-7-0\">#systemd<\/span><span data-offset-key=\"cq0ms-8-0\">`. <\/span><a href=\"https:\/\/wp.me\/pauVx4-1Oz\"><span data-offset-key=\"cq0ms-11-0\">https:\/\/wp.me\/pauVx4-1Oz<\/span><\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Graphing &amp; Charting<\/h3>\n\n\n\n<p>In 2025, I found, <a href=\"https:\/\/uptrace.dev\/blog\/open-source-log-management\">https:\/\/uptrace.dev\/blog\/open-source-log-management<\/a> by uptrace, which is missing the venerable <a href=\"https:\/\/www.nagios.org\/downloads\/\">Nagios<\/a>, I found this <a href=\"https:\/\/opensource.com\/article\/19\/4\/log-analysis-tools\">https:\/\/opensource.com\/article\/19\/4\/log-analysis-tools<\/a>, which includes it. One problem is that these are enterprise tools and I don&#8217;t need that complexity or bloat. See also <a href=\"https:\/\/davelevy.info\/wiki\/event-monitoring\/\">https:\/\/davelevy.info\/wiki\/event-monitoring\/<\/a> which talks about some tools including <a href=\"https:\/\/www.zabbix.com\/\">Zabbix<\/a> which has the advantage that I have been trained in, and the disadvantage that it needs a database.<\/p>\n\n\n\n<p>In late 2022, I found <a href=\"https:\/\/alexandre-vazquez.com\/sysstat-metrics-graphics-tools\/\">two web charting solutions.<\/a>\u00a0 Check out <a href=\"https:\/\/github.com\/vlsi\/ksar\">Ksar<\/a>, a Java charting app, which I now have working, it&#8217;s rather cool,\u00a0need to remember we are looking for bad events. For ksar, you need Java, I found this, Installing <a href=\"https:\/\/ubuntu.com\/tutorials\/install-jre#2-installing-openjdk-jre\">Java on Ubuntu<\/a>. KSAR requires write access to its log directory and is likely to be run as non-root. It is best invoked via its command line request. I <a href=\"https:\/\/github.com\/dfl1955\/ubuntu-tools\/blob\/master\/local-bin\/ksar\">wrote a script for Raspbian<\/a> as I had a problem chasing down the value of the DISPLAY variable. In 2025, I found <a href=\"https:\/\/www.linux.com\/news\/visualize-sar-data-ksar\/\">https:\/\/www.linux.com\/news\/visualize-sar-data-ksar\/<\/a><\/p>\n\n\n\n<p>I am also exploring an alternative chart writer, see <a href=\"https:\/\/davelevy.info\/wiki\/gnuplot\/\">GNUplot<\/a> on this wiki.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">On Cron<\/h3>\n\n\n\n<p>While checking all this out, I came across this,<a href=\"https:\/\/betterstack.com\/community\/questions\/how-to-view-and-read-cron-logs-on-ubuntu-debian-and-centos\/\">how to view and read cron logs on ubuntu, debian and centos<\/a> at betterstack. Cron <a href=\"https:\/\/askubuntu.com\/questions\/56683\/where-is-the-cron-crontab-log\">logs itself<\/a> in the syslog.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, sar, it seems is not part of the Debian distros, one needs to install the package sysstat.<\/p>\n","protected":false},"author":1,"featured_media":6820,"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":[1287,1886,916,1286,1882,1879,911,343],"class_list":["post-6972","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-technology","tag-debian","tag-ksar","tag-linux","tag-raspbian","tag-sysstat","tag-system-monitoring","tag-technology","tag-ubuntu"],"share_on_mastodon":{"url":"","error":""},"jetpack_featured_media_url":"https:\/\/davelevy.info\/wiki\/wp-content\/uploads\/2021\/05\/dashboard-unsplash-LaundeMorel-w1024-cropped.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/6972","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=6972"}],"version-history":[{"count":5,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/6972\/revisions"}],"predecessor-version":[{"id":13362,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/6972\/revisions\/13362"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/media\/6820"}],"wp:attachment":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/media?parent=6972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/categories?post=6972"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/tags?post=6972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}