{"id":470,"date":"2018-12-26T23:24:02","date_gmt":"2018-12-26T22:24:02","guid":{"rendered":"http:\/\/chrigi.me\/wordpress\/?p=470"},"modified":"2018-12-26T23:25:05","modified_gmt":"2018-12-26T22:25:05","slug":"install-influxdb-grafana-on-synology-nas-in-docker","status":"publish","type":"post","link":"https:\/\/chrigi.me\/wordpress\/install-influxdb-grafana-on-synology-nas-in-docker\/","title":{"rendered":"Install Influxdb &#038; Grafana on Synology NAS in Docker"},"content":{"rendered":"<ol>\n<li>SSH into your NAS. You may have to run\u00a0<code class=\"highlighter-rouge\">sudo su<\/code>\u00a0if you are getting permission errors.<\/li>\n<li>Download the\u00a0<a href=\"https:\/\/hub.docker.com\/r\/samuelebistoletti\/docker-statsd-influxdb-grafana\/\" rel=\"external nofollow\">docker-statsd-influxdb-grafana<\/a>\u00a0image using the command:\u00a0<code class=\"highlighter-rouge\">docker pull samuelebistoletti\/docker-statsd-influxdb-grafana<\/code><\/li>\n<li>To start the container for the first-time launch:\n<div class=\"highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>docker run -d \\\n  --name docker-statsd-influxdb-grafana \\\n  -p 3003:3003 \\\n  -p 3004:8083 \\\n  -p 8086:8086 \\\n  -p 22022:22 \\\n  -p 8125:8125\/udp \\\n  samuelebistoletti\/docker-statsd-influxdb-grafana:latest\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>The image should now be running and both InfluxBD and Grafana should be now up and running.<\/li>\n<li>You can access InfluxDB at http:\/\/NAS_IP_ADDRESS:3004\/ and Grafana at http:\/\/NAS_IP_ADDRESS:3003\/<\/li>\n<li>Navigate to http:\/\/NAS_IP_ADDRESS:3004\/ and create the database\u00a0<code class=\"highlighter-rouge\">home_assistant<\/code>\u00a0using the command\u00a0<code class=\"highlighter-rouge\">CREATE DATABASE home_assistant<\/code>.<\/li>\n<li>\n<p class=\"img\"><img decoding=\"async\" src=\"https:\/\/d33wubrfki0l68.cloudfront.net\/dfeafa31270a9dfadc442d34ef950116e7906c42\/be347\/images\/blog\/2017-04-influxdb-grafana\/create_ha_database.png\" \/><\/p>\n<\/li>\n<li><span style=\"color: #ff0000;\">If Webserver dont show anything: login to te docker container over ssh:\u00a0<\/span>\n<pre><span style=\"color: #ff0000;\"><code class=\"lang-sh\">Address: NAS_IP_ADDRESS\nPort: 22022\nuser:\u00a0root\nPassword: root<\/code><\/span><\/pre>\n<p>Then create Database<\/li>\n<li>\n<pre><span style=\"font-family: Menlo, Consolas, monaco, monospace;\"><span style=\"font-size: 14px; background-color: #e8eaeb;\">influx<\/span><\/span><\/pre>\n<\/li>\n<li>\n<pre><span style=\"font-family: Menlo, Consolas, monaco, monospace;\"><span style=\"font-size: 14px; background-color: #e8eaeb;\">CREATE DATABASE home_assistant<\/span><\/span><\/pre>\n<\/li>\n<\/ol>\n<p>https:\/\/hub.docker.com\/r\/samuelebistoletti\/docker-statsd-influxdb-grafana\/<\/p>\n<ol>\n<li>Now, you need to configure Home Assistant to use InfluxDB. Since, we did not add any username\/password to our database, we can simply add the following to our configuration.yaml (replace the IP address with that of the device running Docker) and restart Home Assistant to setup InfluxDB (you will have to fine tune it based on your preferences):\n<div class=\"highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>influxdb:\n  host: 192.168.2.113\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/li>\n<li>Next, we need to configure Grafana to use InfluxDB. Navigate to http:\/\/NAS_IP_ADDRESS:3003\/ to access Grafana (login with username and password\u00a0<code class=\"highlighter-rouge\">root<\/code>) and add your first data source. Here\u2019s how you can configure Grafana to use InfluxDB database. Note that 192.168.2.113 is the IP address of my NAS.<\/li>\n<li>HTTP Settings:\u00a0http:\/\/NAS_IP_ADDRESS:8086\n<p class=\"img\"><img decoding=\"async\" src=\"https:\/\/d33wubrfki0l68.cloudfront.net\/5980c5ef0e7f8f97ee4a3726494fca7823e90137\/a4ecd\/images\/blog\/2017-04-influxdb-grafana\/add_data_source.png\" \/><\/p>\n<\/li>\n<li>You should see\u00a0<code class=\"highlighter-rouge\">Data source is working<\/code>\u00a0if you have configured everything correctly.<\/li>\n<li>With all that configured, you are now ready for the fun stuff. You can create as many dashboards as you want and then import the same in Home Assistant.<\/li>\n<li>To add the Grafana dashboard in HA, use the following config:\n<div class=\"highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>panel_iframe:\n  router:\n    title: 'Temperature'\n    url: 'http:\/\/192.168.2.113:3003\/dashboard\/db\/temperature?edit&amp;tab=time%20range'\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p>The URL can be obtained by clicking Share Dashboard link on your dashboard:<\/p>\n<p class=\"img\"><img decoding=\"async\" src=\"https:\/\/d33wubrfki0l68.cloudfront.net\/638a1c70eb447f6c376e9b2dbfca4d9000b345e2\/1d85e\/images\/blog\/2017-04-influxdb-grafana\/share_dashboard.png\" \/><\/p>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>SSH into your NAS. You may have to run\u00a0sudo su\u00a0if you are getting permission errors. Download the\u00a0docker-statsd-influxdb-grafana\u00a0image using the command:\u00a0docker pull samuelebistoletti\/docker-statsd-influxdb-grafana To start the container for the first-time launch: docker run -d \\ &#8211;name docker-statsd-influxdb-grafana \\ -p 3003:3003 \\ -p 3004:8083 \\ -p 8086:8086 \\ -p 22022:22 \\ -p&#8230; <a href=\"https:\/\/chrigi.me\/wordpress\/install-influxdb-grafana-on-synology-nas-in-docker\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wprm-recipe-roundup-name":"","wprm-recipe-roundup-description":"","footnotes":""},"categories":[1,128,143],"tags":[],"class_list":["post-470","post","type-post","status-publish","format-standard","hentry","category-linux","category-smart-home","category-todo"],"_links":{"self":[{"href":"https:\/\/chrigi.me\/wordpress\/wp-json\/wp\/v2\/posts\/470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chrigi.me\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chrigi.me\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chrigi.me\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chrigi.me\/wordpress\/wp-json\/wp\/v2\/comments?post=470"}],"version-history":[{"count":1,"href":"https:\/\/chrigi.me\/wordpress\/wp-json\/wp\/v2\/posts\/470\/revisions"}],"predecessor-version":[{"id":471,"href":"https:\/\/chrigi.me\/wordpress\/wp-json\/wp\/v2\/posts\/470\/revisions\/471"}],"wp:attachment":[{"href":"https:\/\/chrigi.me\/wordpress\/wp-json\/wp\/v2\/media?parent=470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chrigi.me\/wordpress\/wp-json\/wp\/v2\/categories?post=470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chrigi.me\/wordpress\/wp-json\/wp\/v2\/tags?post=470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}