{"id":5951,"date":"2020-05-30T21:13:37","date_gmt":"2020-05-30T18:13:37","guid":{"rendered":"https:\/\/kifarunix.com\/?p=5951"},"modified":"2024-03-14T20:29:54","modified_gmt":"2024-03-14T17:29:54","slug":"install-and-setup-tig-stack-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-and-setup-tig-stack-on-ubuntu-20-04\/","title":{"rendered":"Install and Setup TIG Stack on Ubuntu 20.04"},"content":{"rendered":"\n<p>In this tutorial, we are going to learn how to install and setup TIG Stack on Ubuntu 20.04. <\/p>\n\n\n\n<p>TIG stack is a group of powerful open-source monitoring tools, Telegraf, InfluxDB and Grafana where;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/www.influxdata.com\/time-series-platform\/telegraf\/\" target=\"_blank\">Telegraf<\/a>&nbsp;is an open-source server agent for collecting and sending metrics and events from databases, systems, and IoT sensors.<\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/www.influxdata.com\/\" target=\"_blank\">InfluxDB<\/a>&nbsp;is an open-source time series database and provides datastore for metrics, events, and real-time analytics.<\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/grafana.com\/docs\/\" target=\"_blank\">Grafana<\/a>&nbsp;is a data visualization and monitoring tool and supports time series datastores such as Graphite, InfluxDB, Prometheus, Elasticsearch.<\/li>\n<\/ul>\n\n\n\n<p>TIG stack can be used for monitoring system metrics such as memory, disk, logged in users, system load, swap usage, system uptime, system processes.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"installtigstackonubuntu20.04\"><a href=\"#installtigstackonubuntu20.04\">Installing and Setup TIG Stack on Ubuntu 20.04<\/a><\/h2>\n\n\n\n<p>In order to install TIG stack, you need to install and setup each individual component of the stack, Telegraf, InfluxDB, Grafana.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"updatesystem\"><a href=\"#updatesystem\">Run System Update<\/a><\/h3>\n\n\n\n<p>To begin with, ensure that your system packages are up-to-date;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update\napt upgrade<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"installtelegrafonUbuntu20.04\"><a href=\"#installtelegrafonUbuntu20.04\">Install Telegraf on Ubuntu 20.04<\/a><\/h3>\n\n\n\n<p>You can install Telegraf on Ubuntu 20.04 either by downloading the DEB package file or directly from the InfluxData repos.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Install Telegraf using DEB Package File<\/h4>\n\n\n\n<p>To install Telegraf using the DEB binary, grab the binary installer from the <a rel=\"noreferrer noopener\" href=\"https:\/\/portal.influxdata.com\/downloads\/\" target=\"_blank\">InfluxData<\/a><a href=\"https:\/\/portal.influxdata.com\/downloads\/\" target=\"_blank\" rel=\"noreferrer noopener\"> <\/a><a rel=\"noreferrer noopener\" href=\"https:\/\/portal.influxdata.com\/downloads\/\" target=\"_blank\">downloads page<\/a>. You can simply obtain the link to binary installer and pull it with wget;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><code>wget https:\/\/dl.influxdata.com\/telegraf\/releases\/telegraf_1.14.3-1_amd64.deb<\/code><\/code><\/pre>\n\n\n\n<p>Once you have the binary downloaded, you can install it as follows<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dpkg -i telegraf_1.14.3-1_amd64.deb<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Install Telegraf from InfluxData Repos<\/h4>\n\n\n\n<p>If you want to install it from the InfluxData repos to ensure seamless updates whenever there are new releases, simply create the InfluxData repos as follows;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget -qO- https:\/\/repos.influxdata.com\/influxdb.key | sudo apt-key add -<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>source \/etc\/lsb-release<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>echo \"deb https:\/\/repos.influxdata.com\/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable\" | sudo tee \/etc\/apt\/sources.list.d\/influxdb.list<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install telegraf<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Running Telegraf on Ubuntu 20.04<\/h4>\n\n\n\n<p>Once the installation is done, you can start and enable Telegraf to run on system boot (This is usually done automatically during installation);<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl enable --now telegraf<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"installinfluxdbonubuntu20.04\"><a href=\"#installinfluxdbonubuntu20.04\">Install InfluxDB on Ubuntu 20.04<\/a><\/h3>\n\n\n\n<p>Similarly, InfluxDB can be installed using DEB package file or from the InfluxData repository.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Install InfluxDB using DEB Package File<\/h4>\n\n\n\n<p>The binary package can be downloaded from <a rel=\"noreferrer noopener\" href=\"https:\/\/portal.influxdata.com\/downloads\/\" target=\"_blank\">InfluxData downloads page<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget https:\/\/dl.influxdata.com\/influxdb\/releases\/influxdb_1.8.0_amd64.deb<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dpkg -i influxdb_1.8.0_amd64.deb<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Install InfluxDB from InfluxData Repos<\/h4>\n\n\n\n<p>As of this writing, InfluxData repos for Ubuntu 20.04 do not provide InfluxDB package. However, InfluxDB package is available on the Focal Universe repos but it is not the latest version as of this writing. Hence, we prefer to install InfluxDB on Ubuntu 20.04 using the debian binary package as described above.<\/p>\n\n\n\n<p>Start and enable InfluxDB to run on system boot;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl enable --now influxdb<\/code><\/pre>\n\n\n\n<p>You can check the status by running the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl status influxdb<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"installgrafanaonubuntu20.04\"><a href=\"#installgrafanaonubuntu20.04\">Install Grafana on Ubuntu 20.04<\/a><\/h3>\n\n\n\n<p>Same to Telegraf and InfluxDB, you can install Grafana on Ubuntu 20.04 using the debian package file or directly from Grafana repos.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Install Grafana using Debian Package File<\/h4>\n\n\n\n<p>To install Grafana using the debian package file, download the latest stable release version of Grafana from <a rel=\"noreferrer noopener\" href=\"https:\/\/grafana.com\/grafana\/download\" target=\"_blank\">Grafana downloads page<\/a>. The latest stable release version is usually selected by default;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install&nbsp;-y adduser libfontconfig1<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget&nbsp;https:\/\/dl.grafana.com\/oss\/release\/grafana_7.0.1_amd64.deb<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dpkg&nbsp;-i&nbsp;grafana_7.0.1_amd64.deb<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Install Grafana From Grafana Repos<\/h4>\n\n\n\n<p>In this tutorial, we are installing the opensource version of Grafana. Create the repo and install Grafana as follows;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code><code>wget -q -O - https:\/\/packages.grafana.com\/gpg.key | sudo apt-key add -<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>add-apt-repository \"deb https:\/\/packages.grafana.com\/oss\/deb stable main\"<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update -y<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install grafana<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Running Grafana<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl daemon-reload\nsystemctl enable --now grafana-server<\/code><\/pre>\n\n\n\n<p>To check the status;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl status grafana-server<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\u25cf grafana-server.service - Grafana instance\n     Loaded: loaded (\/lib\/systemd\/system\/grafana-server.service; enabled; vendor preset: enabled)\n     Active: active (running) since Sat 2020-05-30 10:00:09 UTC; 3s ago\n       Docs: http:\/\/docs.grafana.org\n   Main PID: 6325 (grafana-server)\n      Tasks: 8 (limit: 2282)\n     Memory: 7.8M\n     CGroup: \/system.slice\/grafana-server.service\n             \u2514\u25006325 \/usr\/sbin\/grafana-server --config=\/etc\/grafana\/grafana.ini --pidfile=\/var\/run\/grafana\/grafana-server.pid --packaging=deb cfg:default.paths.logs=\/var\/lo&gt;\n\nMay 30 10:00:10 ubuntu20 grafana-server&#91;6325]: t=2020-05-30T10:00:10+0000 lvl=info msg=\"Executing migration\" logger=migrator id=\"add unique index user.email\"\n...<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"configuringtigstackonubuntu20.04\"><a href=\"#configuringtigstackonubuntu20.04\">Configuring TIG Stack on Ubuntu 20.04<\/a><\/h3>\n\n\n\n<p>Once all the components of the stack are in place, proceed with configuration.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"configureinfluxdb\"><a href=\"#configureinfluxdb\">Configure InfluxDB to Store System Metrics Collected by Telegraf<\/a><\/h4>\n\n\n\n<p>Create InfluxDB database for storing the time series metrics to be collected by the Telegraf agent. Connect to InfluxDB using the <code>influx<\/code> client command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>influx<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Connected to http:\/\/localhost:8086 version 1.8.0\nInfluxDB shell version: 1.8.0\n&gt;<\/code><\/pre>\n\n\n\n<p>Next, create InfluxDB database. In this demo, we create a database called <code>telegraf<\/code> and a database user called <code>telegraf<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>create database telegraf<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>create user telegraf with password 'myP@SSword'\ngrant all on telegraf to telegraf<\/code><\/pre>\n\n\n\n<p>You can list the created databases;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>show databases<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>name: databases\nname\n----\n<strong>telegraf\n<\/strong>_internal<\/code><\/pre>\n\n\n\n<p>To list users;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>show users<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>user     admin\n----     -----\ntelegraf false<\/code><\/pre>\n\n\n\n<p>Exit InfluxDB and verify the connection to the database using the credentials created above;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>influx -username 'telegraf' -password '' -database telegraf<\/code><\/pre>\n\n\n\n<p>Enter the password. If all is well, you should get InfluxDB prompt;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>password: <strong>myP@SSword<\/strong>\nConnected to http:\/\/localhost:8086 version 1.8.0\nInfluxDB shell version: 1.8.0\n&gt; <\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"configuretelegraf\"><a href=\"#configuretelegraf\">Configuring Telegraf to Collect System Metrics<\/a><\/h4>\n\n\n\n<p>is a plugin-driven server agent for collecting and sending metrics and events from databases, systems, and IoT sensors. All metrics are gathered from the declared inputs, and sent to the declared outputs. It is basically made up of four distinct plugin types:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/influxdata\/telegraf#input-plugins\" target=\"_blank\">Input Plugins<\/a>&nbsp;collect metrics from the system, services<\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/influxdata\/telegraf#processor-plugins\" target=\"_blank\">Processor Plugins<\/a>&nbsp;transform, decorate, and\/or filter metrics<\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/influxdata\/telegraf#aggregator-plugins\" target=\"_blank\">Aggregator Plugins<\/a>&nbsp;create aggregate metrics (e.g. mean, min, max, quantiles, etc.)<\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/influxdata\/telegraf#output-plugins\" target=\"_blank\">Output Plugins<\/a>&nbsp;write metrics to various destinations such as InfluxDB for our case.<\/li>\n<\/ul>\n\n\n\n<p><code>\/etc\/telegraf\/telegraf.conf<\/code> is the default Telegraf configuration file.<\/p>\n\n\n\n<p>In this tutorial, we will configure TIG stack monitor system memory usage, system processes, disk usage, system load, system uptime and logged in users.<\/p>\n\n\n\n<p>As such, we will generate our custom Telegraf configuration with the above specified metrics on the input filter.  Custom Telegraf configuration file can be generated with <code>telegraf<\/code> command.<\/p>\n\n\n\n<p>Create a backup of the original Telegraf configuration file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mv \/etc\/telegraf\/telegraf.conf{,.old}<\/code><\/pre>\n\n\n\n<p>Generate the Custom Telegraf for the specified metrics;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>telegraf config -input-filter <strong>cpu:mem:swap:system:processes:disk<\/strong> -output-filter influxdb &gt; \/etc\/telegraf\/telegraf.conf<\/code><\/pre>\n\n\n\n<p>Read more about Telegraf input plugins on <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/influxdata\/telegraf\/tree\/master\/plugins\/\" target=\"_blank\">Telegraf Plugins<\/a> Github page.<\/p>\n\n\n\n<p>Once the configuration file is generated, edit it to define the connection details to InfluxDB metrics database;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>vim \/etc\/telegraf\/telegraf.conf<\/code><\/pre>\n\n\n\n<p>Replace the InfluxDB database connection details accordingly.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>###############################################################################\n#                            OUTPUT PLUGINS                                   #\n###############################################################################\n\n\n# Configuration for sending metrics to InfluxDB\n[[outputs.influxdb]]\n<strong>  urls = [\"http:\/\/127.0.0.1:8086\"]\n  database = \"telegraf\"\n  username = \"telegraf\"\n  password = \"myP@SSword\"\n<\/strong><\/code><\/pre>\n\n\n\n<p>This is how our configuration file looks like with no comment lines;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>grep -v \"^\\s*[#\\;]\\|^\\s*$\" \/etc\/telegraf\/telegraf.conf<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;global_tags]\n&#91;agent]\n  interval = \"10s\"\n  round_interval = true\n  metric_batch_size = 1000\n  metric_buffer_limit = 10000\n  collection_jitter = \"0s\"\n  flush_interval = \"10s\"\n  flush_jitter = \"0s\"\n  precision = \"\"\n  hostname = \"\"\n  omit_hostname = false\n&#91;&#91;outputs.influxdb]]\n  urls = &#91;\"http:\/\/127.0.0.1:8086\"]\n  database = \"telegraf\"\n  username = \"telegraf\"\n  password = \"myP@SSword\"\n&#91;&#91;inputs.cpu]]\n  percpu = true\n  totalcpu = true\n  collect_cpu_time = false\n  report_active = false\n&#91;&#91;inputs.disk]]\n  ignore_fs = &#91;\"tmpfs\", \"devtmpfs\", \"devfs\", \"iso9660\", \"overlay\", \"aufs\", \"squashfs\"]\n&#91;&#91;inputs.diskio]]\n&#91;&#91;inputs.kernel]]\n&#91;&#91;inputs.mem]]\n&#91;&#91;inputs.processes]]\n&#91;&#91;inputs.swap]]\n&#91;&#91;inputs.system]]<\/code><\/pre>\n\n\n\n<p>For further configurations of Telegraf, refer to <a rel=\"noreferrer noopener\" href=\"https:\/\/docs.influxdata.com\/telegraf\/v1.10\/administration\/configuration\/\" target=\"_blank\">Telegraf administration configuration<\/a>&nbsp;page.<\/p>\n\n\n\n<p>Restart Telegraf after modifications;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl restart telegraf<\/code><\/pre>\n\n\n\n<p>Recheck the status;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl status telegraf<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\u25cf telegraf.service - The plugin-driven server agent for reporting metrics into InfluxDB\n     Loaded: loaded (\/lib\/systemd\/system\/telegraf.service; enabled; vendor preset: enabled)\n     Active: active (running) since Sat 2020-05-30 16:43:07 UTC; 8s ago\n       Docs: https:\/\/github.com\/influxdata\/telegraf\n   Main PID: 4776 (telegraf)\n      Tasks: 10 (limit: 2282)\n     Memory: 10.1M\n     CGroup: \/system.slice\/telegraf.service\n             \u2514\u25004776 \/usr\/bin\/telegraf -config \/etc\/telegraf\/telegraf.conf -config-directory \/etc\/telegraf\/telegraf.d\n\nMay 30 16:43:07 ubuntu20 systemd&#91;1]: Started The plugin-driven server agent for reporting metrics into InfluxDB.\nMay 30 16:43:07 ubuntu20 telegraf&#91;4776]: 2020-05-30T16:43:07Z I! Starting Telegraf 1.14.3\nMay 30 16:43:07 ubuntu20 telegraf&#91;4776]: 2020-05-30T16:43:07Z I! Loaded inputs: swap system cpu disk diskio kernel mem processes\nMay 30 16:43:07 ubuntu20 telegraf&#91;4776]: 2020-05-30T16:43:07Z I! Loaded aggregators:\nMay 30 16:43:07 ubuntu20 telegraf&#91;4776]: 2020-05-30T16:43:07Z I! Loaded processors:\nMay 30 16:43:07 ubuntu20 telegraf&#91;4776]: 2020-05-30T16:43:07Z I! Loaded outputs: influxdb\nMay 30 16:43:07 ubuntu20 telegraf&#91;4776]: 2020-05-30T16:43:07Z I! Tags enabled: host=ubuntu20\nMay 30 16:43:07 ubuntu20 telegraf&#91;4776]: 2020-05-30T16:43:07Z I! &#91;agent] Config: Interval:10s, Quiet:false, Hostname:\"ubuntu20\", Flush Interval:10s<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Start Telegraf and Verify If data appears<\/h4>\n\n\n\n<p>Telegraf enables you to run configuration tests outputing metrics to stdout. To run a general test for all metrics defined;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>telegraf --config \/etc\/telegraf\/telegraf.conf --test<\/code><\/pre>\n\n\n\n<p>To run configuration test for a specific metric for example, system input plugin;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>telegraf -test -config \/etc\/telegraf\/telegraf.conf --input-filter system<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>2020-05-30T11:07:42Z I! Starting Telegraf 1.14.3\n&gt; system,host=ubuntu20 <strong>load1=0.01,load15=0,load5=0.02,n_cpus=2i,n_users=2i<\/strong> 1590836862000000000\n&gt; system,host=ubuntu20 <strong>uptime=9206i<\/strong> 1590836862000000000\n&gt; system,host=ubuntu20 <strong>uptime_format=\" 2:33\"<\/strong> 1590836862000000000<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"#configure-grafana-influxdb-telegraf-dashboard\">Configure Grafana to Display InfluxDB\/Telegraf Metrics<\/a><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Accessing Grafana Web Interface<\/h4>\n\n\n\n<p>To access Grafana externally, you need to open port 3000\/tcp on UFW if it is running.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ufw allow 3000\/tcp<\/code><\/pre>\n\n\n\n<p>You can now access Grafana web Interface, <code><strong>http:\/\/server-IP-or-Hostname:3000<\/strong><\/code>. On the&nbsp;login&nbsp;page, type <code>admin<\/code> for the username and password.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1525\" height=\"733\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/grafana-login.png\" alt=\"\" class=\"wp-image-5961\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/grafana-login.png?v=1590861443 1525w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/grafana-login-768x369.png?v=1590861443 768w\" sizes=\"(max-width: 1525px) 100vw, 1525px\" \/><\/figure>\n\n\n\n<p>Reset the password and proceed to Grafana web Interface.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"influxdb-datasource\"><a href=\"#influxdb-datasource\">Add InfluxDB Data source<\/a><\/h4>\n\n\n\n<p>To add your data source, click the either of the highlighted sections as in the screenshot below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1906\" height=\"496\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/datasource.png\" alt=\"Grafana InfluxDB data source\" class=\"wp-image-5962\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/datasource.png?v=1590861528 1906w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/datasource-768x200.png?v=1590861528 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/datasource-1536x400.png?v=1590861528 1536w\" sizes=\"(max-width: 1906px) 100vw, 1906px\" \/><\/figure>\n\n\n\n<p>Search for and select InfluxDB data source.<\/p>\n\n\n\n<p>Set the Name and URL of the InfluxDB data source. You can leave it as <code>http:\/\/localhost:8086<\/code> for local connection.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1199\" height=\"598\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/influxdb-url.png\" alt=\"\" class=\"wp-image-5963\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/influxdb-url.png?v=1590861709 1199w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/influxdb-url-768x383.png?v=1590861709 768w\" sizes=\"(max-width: 1199px) 100vw, 1199px\" \/><\/figure>\n\n\n\n<p>To test the connection to the InfluxDB database, click <strong>Save&amp;Test<\/strong> button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1845\" height=\"753\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/ds-working.png\" alt=\"\" class=\"wp-image-5964\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/ds-working.png?v=1590861737 1845w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/ds-working-768x313.png?v=1590861737 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/ds-working-1536x627.png?v=1590861737 1536w\" sizes=\"(max-width: 1845px) 100vw, 1845px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"creategrafanatelegraf-dashboard\"><a href=\"#creategrafanatelegraf dashboard\">Create Grafana Telegraf Dashboard<\/a><\/h4>\n\n\n\n<p>You can either create your own dashboards for Telegraf are find any that suit your needs from the already created <a rel=\"noreferrer noopener\" href=\"https:\/\/grafana.com\/dashboards\" target=\"_blank\">Grafana community dashboards<\/a>. In this tutorial, we are using the community <a rel=\"noreferrer noopener\" href=\"https:\/\/grafana.com\/grafana\/dashboards\/5955\" target=\"_blank\">Telegraf-system metrics dashboard<\/a> created by user, jmutai.<\/p>\n\n\n\n<p>To import the dashboard, click the <code>+ (plus)<\/code> sign on the left panel of Grafana UI. You can either import using the dashboard ID or JSON file provided on specific Grafana dashboard page.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"993\" height=\"818\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/import-grafana-dash.png\" alt=\"\" class=\"wp-image-5965\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/import-grafana-dash.png?v=1590861779 993w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/import-grafana-dash-768x633.png?v=1590861779 768w\" sizes=\"(max-width: 993px) 100vw, 993px\" \/><\/figure>\n\n\n\n<p>Click <strong>Load<\/strong> to load the dashboard.<\/p>\n\n\n\n<p>Once the dashboard loads, <strong>select the InfluxDB data source and import the dashboard<\/strong>. You should now be able to see various dashboards detailing various system metrics;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1891\" height=\"955\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/system-metrics.png\" alt=\"\" class=\"wp-image-5966\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/system-metrics.png?v=1590861838 1891w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/system-metrics-768x388.png?v=1590861838 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/05\/system-metrics-1536x776.png?v=1590861838 1536w\" sizes=\"(max-width: 1891px) 100vw, 1891px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Further Reading<\/h3>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/docs.influxdata.com\/telegraf\/v1.14\/\" target=\"_blank\">Telegraf 1.14 documentation<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/docs.influxdata.com\/influxdb\/v1.8\/\" target=\"_blank\">InfluxDB 1.8 documentation<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/grafana.com\/docs\/grafana\/latest\/\" target=\"_blank\">Grafana Documentation<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Related Tutorials<\/h3>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/install-and-setup-tig-stack-on-fedora-30\/\" target=\"_blank\">Install and Setup TIG Stack on Fedora 30<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/install-latest-grafana-on-centos-8\/\" target=\"_blank\">Install Latest Grafana on CentOS 8<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-elastic-elk-stack-on-ubuntu-20-04\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install ELK Stack on Ubuntu 20.04<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-and-setup-prometheus-on-ubuntu-20-04\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install and Setup Prometheus on Ubuntu 20.04<\/a><\/p>\n\n\n\n<p> <\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we are going to learn how to install and setup TIG Stack on Ubuntu 20.04. TIG stack is a group of powerful<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,301,72,939],"tags":[302,937,1617,1616,1615,1618,935,940,1619],"class_list":["post-5951","post","type-post","status-publish","format-standard","hentry","category-howtos","category-grafana","category-monitoring","category-tig-stack","tag-grafana","tag-influxdb","tag-install-grafana-ubuntu-20-04","tag-install-influxdb-ubuntu-20-04","tag-install-telegraf-ubuntu-20-04","tag-install-tig-stack-ubuntu-20-04","tag-telegraf","tag-tig-stack","tag-tig-stack-setup-on-ubuntu-20-04","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/5951"}],"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\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=5951"}],"version-history":[{"count":12,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/5951\/revisions"}],"predecessor-version":[{"id":21377,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/5951\/revisions\/21377"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=5951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=5951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=5951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}