{"id":3989,"date":"2019-08-13T22:27:02","date_gmt":"2019-08-13T19:27:02","guid":{"rendered":"https:\/\/kifarunix.com\/?p=3989"},"modified":"2019-08-13T22:27:03","modified_gmt":"2019-08-13T19:27:03","slug":"install-sampler-shell-command-visualization-tool-on-linux","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-sampler-shell-command-visualization-tool-on-linux\/","title":{"rendered":"Install Sampler Shell Command Visualization tool on Linux"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/sampler.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1134\" height=\"567\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/sampler.png\" alt=\"Install Sampler Shell Command Visualization tool on Linux\" class=\"wp-image-3990\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/sampler.png 1134w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/sampler-768x384.png 768w\" sizes=\"(max-width: 1134px) 100vw, 1134px\" \/><\/a><\/figure>\n\n\n\n<p>In this guide, you are going to learn how to install sampler shell command visualization tool on Linux. <a rel=\"noreferrer noopener\" aria-label=\"Sampler (opens in a new tab)\" href=\"https:\/\/github.com\/sqshq\/sampler\" target=\"_blank\">Sampler<\/a> is a tool for shell commands execution, visualization and alerting.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install Sampler Shell Command Visualization tool on Linux<\/h2>\n\n\n\n<p>Sampler is available as a binary that can just be downloaded and installed by placing it on the\u00a0standard Unix directory for storing executable files.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Download Sampler Binary<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget https:\/\/github.com\/sqshq\/sampler\/releases\/download\/v1.0.2\/sampler-1.0.2-linux-amd64<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install Sampler<\/h3>\n\n\n\n<p>Installing Sampler on Linux is as simple as copying the binary to <strong>\/usr\/bin<\/strong> directory renaming it as follows.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>cp sampler-1.0.2-linux-amd64 \/usr\/bin\/sampler<\/code><\/pre>\n\n\n\n<p>Next, make the Sampler binary executable.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>chmod +x \/usr\/bin\/sampler<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Usage of Sampler<\/h3>\n\n\n\n<p>With Sampler, you can execute various shell scripts that gets you metrics and output them for visualization. Sampler is configured with a simple YAML file and hence, you need to define your shell commands in YAML configuration file.<\/p>\n\n\n\n<p>Once you have created you shell commands configuration file, you can then pass it to Sampler for execution with <strong>-c<\/strong> option as in, <strong>sample -c config.yml<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Creating Sample Configuration File<\/h3>\n\n\n\n<p>To begin, let us create a simple configuration file for visualizing a few shell commands. For example, to visualize the CPU usage, system uptime, number of logged in users, memory usage, you can create an YAML configuration like as shown below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>vim config.yml<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sparklines:\n  - title: CPU usage\n    position: [[42, 12], [38, 16]]\n    rate-ms: 200\n    scale: 0\n    sample: ps -A -o %cpu | awk '{s+=$1} END {print s}'\ntextboxes:\n  - title: Memory Usage\n    position: [[1, 27], [79, 15]]\n    rate-ms: 200\n    sample: free -h\n  - title: Logged in Users\n    position: [[0, 12], [41, 16]]\n    rate-ms: 200\n    sample: w\nasciiboxes:\n  - title: System Uptime\n    position: [[0, 0], [80, 12]]\n    rate-ms: 500\n    color: 43\n    sample: uptime | cut -d',' -f1<\/code><\/pre>\n\n\n\n<p>To view the visualization, simply run Sampler with your configuration file as;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sampler -c config.yml<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/sample-sampler.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1354\" height=\"691\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/sample-sampler.png\" alt=\"Sampler visualization\" class=\"wp-image-3991\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/sample-sampler.png 1354w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/sample-sampler-768x392.png 768w\" sizes=\"(max-width: 1354px) 100vw, 1354px\" \/><\/a><\/figure>\n\n\n\n<p>That is just it on simple Sampler shell command visualization. <\/p>\n\n\n\n<p>If you need to see more examples of visualizations, <a rel=\"noreferrer noopener\" aria-label=\"check Sampler documentation page (opens in a new tab)\" href=\"https:\/\/github.com\/sqshq\/sampler#ssh\" target=\"_blank\">check Sampler documentation page<\/a>. Enjoy.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Other Tutorials<\/h4>\n\n\n\n<p>LATEST&nbsp;<\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/connect-to-wifi-in-linux-using-nmcli-command\/\" target=\"_blank\">Connect to WiFi in Linux Using NMCLI command<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/extract-log-lines-of-specific-dates-from-a-log-file\/\" target=\"_blank\">Extract Log Lines of Specific Dates from a Log File<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/delete-lines-matching-a-specific-pattern-in-a-file-using-sed\/\" target=\"_blank\">Delete Lines Matching a Specific Pattern in a File using SED<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/delete-lines-matching-specific-pattern-in-a-file-using-vim\/\" target=\"_blank\">Delete Lines Matching Specific Pattern in a File using VIM<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/installing-perf-performance-analysis-tool-on-ubuntu-18-04\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Installing Perf Performance Analysis Tool on Ubuntu 18.04<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, you are going to learn how to install sampler shell command visualization tool on Linux. Sampler is a tool for shell commands<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,72,1073],"tags":[1074,1075],"class_list":["post-3989","post","type-post","status-publish","format-standard","hentry","category-howtos","category-monitoring","category-sampler","tag-sampler","tag-shell-command-visualization","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3989"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=3989"}],"version-history":[{"count":1,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3989\/revisions"}],"predecessor-version":[{"id":3992,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3989\/revisions\/3992"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=3989"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=3989"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=3989"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}