From 533a13ec36dff552171deddfbc13578e56eda45b Mon Sep 17 00:00:00 2001 From: tanupoo Date: Sat, 14 Mar 2020 17:17:32 +0900 Subject: [PATCH 1/7] initial commit for grafana. --- grafana/Dockerfile | 5 + grafana/config.ini | 8 + grafana/dashboards/dashboards.json | 2009 +++++++++++++++++ .../provisioning/dashboards/dashboards.yml | 25 + .../datasources/datasources.yml.template | 16 + grafana/set_db_password.sh | 29 + 6 files changed, 2092 insertions(+) create mode 100644 grafana/Dockerfile create mode 100644 grafana/config.ini create mode 100644 grafana/dashboards/dashboards.json create mode 100644 grafana/provisioning/dashboards/dashboards.yml create mode 100644 grafana/provisioning/datasources/datasources.yml.template create mode 100755 grafana/set_db_password.sh diff --git a/grafana/Dockerfile b/grafana/Dockerfile new file mode 100644 index 0000000..b7f7b44 --- /dev/null +++ b/grafana/Dockerfile @@ -0,0 +1,5 @@ +#FROM grafana/grafana:6.5.0-beta1 +FROM grafana/grafana:6.5.0 +ADD ./provisioning /etc/grafana/provisioning +ADD ./config.ini /etc/grafana/config.ini +ADD ./dashboards /var/lib/grafana/dashboards diff --git a/grafana/config.ini b/grafana/config.ini new file mode 100644 index 0000000..75423c5 --- /dev/null +++ b/grafana/config.ini @@ -0,0 +1,8 @@ +[paths] +provisioning = /etc/grafana/provisioning + +[server] +enable_gzip = true + +[log] +#level = debug diff --git a/grafana/dashboards/dashboards.json b/grafana/dashboards/dashboards.json new file mode 100644 index 0000000..4d21737 --- /dev/null +++ b/grafana/dashboards/dashboards.json @@ -0,0 +1,2009 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 2, + "iteration": 1584003521133, + "links": [], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "sindan-mysql", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 5, + "w": 12, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 4, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"v4rtt_srv_max\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v4rtt_srv_max\" and\n target = \"$target_v4rtt_srv\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"v4rtt_srv_ave\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v4rtt_srv_ave\" and\n target = \"$target_v4rtt_srv\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "B", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"v4rtt_srv_min\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v4rtt_srv_min\" and\n target = \"$target_v4rtt_srv\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "C", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "v4rtt_srv of $target_v4rtt_srv", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "sindan-mysql", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 5, + "w": 12, + "x": 12, + "y": 0 + }, + "hiddenSeries": false, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 AS \"v6rtt_srv_max\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v6rtt_srv_max\" and\n target = \"$target_v6rtt_srv\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 AS \"v6rtt_srv_ave\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v6rtt_srv_ave\" and\n target = \"$target_v6rtt_srv\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "B", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 AS \"v6rtt_srv_min\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v6rtt_srv_min\" and\n target = \"$target_v6rtt_srv\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "C", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "v6rtt_srv of $target_v6rtt_srv", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "sindan-mysql", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 5, + "w": 12, + "x": 0, + "y": 5 + }, + "hiddenSeries": false, + "id": 6, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"AAAA_dual\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v4dnsrtt_AAAA_dual.sindan-net.com\" and\n target = \"8.8.8.8\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"AAAA_ipv4\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v4dnsrtt_AAAA_ipv4.sindan-net.com\" and\n target = \"8.8.8.8\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "B", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"AAAA_ipv6\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v4dnsrtt_AAAA_ipv6.sindan-net.com\" and\n target = \"8.8.8.8\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "C", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"A_dual\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v4dnsrtt_A_dual.sindan-net.com\" and\n target = \"8.8.8.8\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "D", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"A_ipv4\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v4dnsrtt_A_ipv4.sindan-net.com\" and\n target = \"8.8.8.8\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "E", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"A_ipv6\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v4dnsrtt_A_ipv6.sindan-net.com\" and\n target = \"8.8.8.8\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "F", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "v4dnsrtt of GPDNS4", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": null, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "sindan-mysql", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 5, + "w": 12, + "x": 12, + "y": 5 + }, + "hiddenSeries": false, + "id": 8, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"AAAA_dual\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v6dnsrtt_AAAA_dual.sindan-net.com\" and\n target = \"2001:4860:4860::8888\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"AAAA_ipv4\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v6dnsrtt_AAAA_ipv4.sindan-net.com\" and\n target = \"2001:4860:4860::8888\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "B", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"AAAA_ipv6\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v6dnsrtt_AAAA_ipv6.sindan-net.com\" and\n target = \"2001:4860:4860::8888\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "C", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"A_dual\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v6dnsrtt_A_dual.sindan-net.com\" and\n target = \"2001:4860:4860::8888\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "D", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"A_ipv4\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v6dnsrtt_A_ipv4.sindan-net.com\" and\n target = \"2001:4860:4860::8888\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "E", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"A_ipv6\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v6dnsrtt_A_ipv6.sindan-net.com\" and\n target = \"2001:4860:4860::8888\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "F", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "v6dnsrtt of GPDNS6", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": null, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "sindan-mysql", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 4, + "w": 6, + "x": 0, + "y": 10 + }, + "hiddenSeries": false, + "id": 14, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pluginVersion": "6.6.2", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"GPDNS4(1.1.1.1)\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v4pmtu_srv\" and\n target = \"1.1.1.1\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"GPDNS4(8.8.8.8)\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v4pmtu_srv\" and\n target = \"8.8.8.8\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "B", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"sh.wide.ad.jp\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v4pmtu_srv\" and\n target = \"203.178.139.60\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "C", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "p4pmtu_srv", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "sindan-mysql", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 4, + "w": 6, + "x": 6, + "y": 10 + }, + "hiddenSeries": false, + "id": 16, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"GPDNS6(::1111)\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v6pmtu_srv\" and\n target = \"2606:4700:4700::1111\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"GPDNS6(::8888)\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v6pmtu_srv\" and\n target = \"2001:4860:4860::8888\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "B", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"sh.wide.ad.jp\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v6pmtu_srv\" and\n target = \"2001:200:0:180c::6\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "C", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "v6pmtu_srv", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "sindan-mysql", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 2, + "w": 12, + "x": 12, + "y": 10 + }, + "hiddenSeries": false, + "id": 22, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": true, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0 as \"www.yahoo.co.jp\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v4http_srv\" and\n target = \"$target_v4http_srv\"", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "v4http_srv of $target_v4http_srv", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "sindan-mysql", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 2, + "w": 12, + "x": 12, + "y": 12 + }, + "hiddenSeries": false, + "id": 24, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": false, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": true, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0 as \"www.google.co.jp\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"v6http_srv\" and\n target = \"$target_v6http_srv\"", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "v6http_srv of $target_v6http_srv", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": { + "SNR": "blue" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "sindan-mysql", + "description": "SNR should be 20 or more for a data network.", + "fill": 0, + "fillGradient": 0, + "gridPos": { + "h": 5, + "w": 8, + "x": 0, + "y": 14 + }, + "hiddenSeries": false, + "id": 12, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": false + }, + "lines": false, + "linewidth": 2, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "/(rssi|noise)/", + "lines": true, + "zindex": 3 + }, + { + "alias": "SNR", + "bars": true, + "yaxis": 2, + "zindex": -3 + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"rssi\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"rssi\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"noise\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"noise\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "B", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + }, + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n a.occurred_at AS \"time\",\n (a.detail+0.0) - (b.detail+0.0) AS \"SNR\"\nFROM\n (\n SELECT log_campaign_uuid, occurred_at, detail\n FROM diagnosis_logs\n WHERE\n $__timeFilter(occurred_at) AND\n log_type = \"RSSI\" AND\n log_campaign_uuid in (\n SELECT log_campaign_uuid\n FROM log_campaigns\n WHERE mac_addr = \"$sindanClientID\"\n )\n ) AS a\nLEFT JOIN\n (\n SELECT log_campaign_uuid, occurred_at, detail\n FROM diagnosis_logs\n WHERE\n $__timeFilter(occurred_at) AND\n log_type = \"noise\" AND\n log_campaign_uuid in (\n SELECT log_campaign_uuid\n FROM log_campaigns\n WHERE mac_addr = \"$sindanClientID\"\n )\n ) As b\nON a.log_campaign_uuid = b.log_campaign_uuid", + "refId": "C", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "WiFi Status", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "decimals": null, + "format": "short", + "label": "", + "logBase": 1, + "max": "50", + "min": "0", + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "datasource": "sindan-mysql", + "gridPos": { + "h": 5, + "w": 4, + "x": 8, + "y": 14 + }, + "id": 10, + "options": { + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [], + "max": 0, + "min": -100, + "thresholds": [ + { + "color": "red", + "value": null + }, + { + "color": "orange", + "value": -80 + }, + { + "color": "#EAB839", + "value": -70 + }, + { + "color": "green", + "value": -67 + }, + { + "color": "#6ED0E0", + "value": -30 + } + ], + "unit": "dBm" + }, + "override": {}, + "overrides": [], + "values": false + }, + "orientation": "auto", + "showThresholdLabels": false, + "showThresholdMarkers": false + }, + "pluginVersion": "6.5.0", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n detail+0.0 as \"RSSI\"\nFROM diagnosis_logs\nWHERE\n $__timeFilter(occurred_at) and\n log_type = \"rssi\" and\n log_campaign_uuid in (\n select\n log_campaign_uuid\n from log_campaigns\n where mac_addr = \"$sindanClientID\" )\nORDER BY occurred_at", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + } + ] + ], + "table": "diagnosis_logs", + "timeColumn": "occurred_at", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "RSSI", + "type": "gauge" + }, + { + "cacheTimeout": null, + "columns": [], + "datasource": "sindan-mysql", + "fontSize": "80%", + "gridPos": { + "h": 5, + "w": 6, + "x": 12, + "y": 14 + }, + "id": 20, + "links": [], + "options": {}, + "pageSize": null, + "pluginVersion": "6.6.2", + "showHeader": true, + "sort": { + "col": 1, + "desc": true + }, + "styles": [ + { + "alias": "Time", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "time", + "type": "date" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "mappingType": 1, + "pattern": "/.*/", + "thresholds": [], + "type": "string", + "unit": "short" + } + ], + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n occurred_at AS \"time\",\n mac_addr AS \"sindanClientID\"\nFROM log_campaigns\nWHERE\n $__timeFilter(occurred_at)\nORDER BY occurred_at", + "refId": "A", + "select": [ + [ + { + "params": [ + "value" + ], + "type": "column" + } + ] + ], + "timeColumn": "time", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Latest Campaign", + "transform": "table", + "type": "table" + }, + { + "dashboardFilter": "", + "dashboardTags": [], + "datasource": "sindan_mysql", + "folderId": null, + "gridPos": { + "h": 5, + "w": 6, + "x": 18, + "y": 14 + }, + "id": 18, + "limit": 10, + "nameFilter": "", + "onlyAlertsOnDashboard": false, + "options": {}, + "show": "current", + "sortOrder": 1, + "stateFilter": [], + "timeFrom": null, + "timeShift": null, + "title": "Alert", + "type": "alertlist" + } + ], + "refresh": false, + "schemaVersion": 21, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "tags": [], + "text": "00:22:cf:e3:45:fa", + "value": "00:22:cf:e3:45:fa" + }, + "datasource": "sindan-mysql", + "definition": "SELECT distinct(mac_addr) FROM log_campaigns ORDER BY mac_addr;", + "hide": 0, + "includeAll": false, + "label": "node_id", + "multi": false, + "name": "sindanClientID", + "options": [], + "query": "SELECT distinct(mac_addr) FROM log_campaigns ORDER BY mac_addr;", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 5, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": { + "selected": false, + "tags": [], + "text": "www.wide.ad.jp", + "value": "www.wide.ad.jp" + }, + "hide": 0, + "includeAll": false, + "label": "v4rtt_srv", + "multi": false, + "name": "target_v4rtt_srv", + "options": [ + { + "selected": false, + "text": "www.yahoo.co.jp", + "value": "www.yahoo.co.jp" + }, + { + "selected": true, + "text": "www.wide.ad.jp", + "value": "www.wide.ad.jp" + } + ], + "query": "www.yahoo.co.jp, www.wide.ad.jp", + "skipUrlSync": false, + "type": "custom" + }, + { + "allValue": null, + "current": { + "selected": false, + "text": "www.wide.ad.jp", + "value": "www.wide.ad.jp" + }, + "hide": 0, + "includeAll": false, + "label": "v6rtt_srv", + "multi": false, + "name": "target_v6rtt_srv", + "options": [ + { + "selected": false, + "text": "www.google.co.jp", + "value": "www.google.co.jp" + }, + { + "selected": true, + "text": "www.wide.ad.jp", + "value": "www.wide.ad.jp" + } + ], + "query": "www.google.co.jp, www.wide.ad.jp", + "skipUrlSync": false, + "type": "custom" + }, + { + "allValue": null, + "current": { + "selected": false, + "text": "8.8.8.8", + "value": "8.8.8.8" + }, + "hide": 0, + "includeAll": false, + "label": "v4pmtu", + "multi": false, + "name": "target_v4pmtu", + "options": [ + { + "selected": true, + "text": "8.8.8.8", + "value": "8.8.8.8" + }, + { + "selected": false, + "text": "203.178.139.60", + "value": "203.178.139.60" + } + ], + "query": "8.8.8.8, 203.178.139.60", + "skipUrlSync": false, + "type": "custom" + }, + { + "allValue": null, + "current": { + "selected": false, + "text": "2001:4860:4860::8888", + "value": "2001:4860:4860::8888" + }, + "hide": 0, + "includeAll": false, + "label": "v6pmtu", + "multi": false, + "name": "target_v6pmtu", + "options": [ + { + "selected": true, + "text": "2001:4860:4860::8888", + "value": "2001:4860:4860::8888" + }, + { + "selected": false, + "text": "2001:200:0:180c::6", + "value": "2001:200:0:180c::6" + } + ], + "query": "2001:4860:4860::8888, 2001:200:0:180c::6", + "skipUrlSync": false, + "type": "custom" + }, + { + "allValue": null, + "current": { + "selected": false, + "tags": [], + "text": "www.wide.ad.jp", + "value": "www.wide.ad.jp" + }, + "hide": 0, + "includeAll": false, + "label": "v4http_srv", + "multi": false, + "name": "target_v4http_srv", + "options": [ + { + "selected": false, + "text": "www.yahoo.co.jp", + "value": "www.yahoo.co.jp" + }, + { + "selected": true, + "text": "www.wide.ad.jp", + "value": "www.wide.ad.jp" + } + ], + "query": "www.yahoo.co.jp, www.wide.ad.jp", + "skipUrlSync": false, + "type": "custom" + }, + { + "allValue": null, + "current": { + "selected": false, + "text": "www.wide.ad.jp", + "value": "www.wide.ad.jp" + }, + "hide": 0, + "includeAll": false, + "label": "v6http_srv", + "multi": false, + "name": "target_v6http_srv", + "options": [ + { + "selected": false, + "text": "www.google.co.jp", + "value": "www.google.co.jp" + }, + { + "selected": true, + "text": "www.wide.ad.jp", + "value": "www.wide.ad.jp" + } + ], + "query": "www.google.co.jp, www.wide.ad.jp", + "skipUrlSync": false, + "type": "custom" + } + ] + }, + "time": { + "from": "now-24h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "10m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "SINDAN by fluentd.docker.local", + "uid": "isZjpDuZz", + "version": 18 +} diff --git a/grafana/provisioning/dashboards/dashboards.yml b/grafana/provisioning/dashboards/dashboards.yml new file mode 100644 index 0000000..d068bf9 --- /dev/null +++ b/grafana/provisioning/dashboards/dashboards.yml @@ -0,0 +1,25 @@ +apiVersion: 1 + +providers: + # an unique provider name +- name: 'sindan1' + # org id. will default to orgId 1 if not specified + orgId: 1 + # name of the dashboard folder. Required + folder: '' + # folder UID. will be automatically generated if not specified + folderUid: '' + # provider type. Required + type: file + # disable dashboard deletion + disableDeletion: false + # enable dashboard editing + editable: true + # how often Grafana will scan for changed dashboards + updateIntervalSeconds: 10 + # allow updating provisioned dashboards from the UI + allowUiUpdates: true + options: + # path to dashboard files on disk. Required + path: /var/lib/grafana/dashboards + diff --git a/grafana/provisioning/datasources/datasources.yml.template b/grafana/provisioning/datasources/datasources.yml.template new file mode 100644 index 0000000..e09545a --- /dev/null +++ b/grafana/provisioning/datasources/datasources.yml.template @@ -0,0 +1,16 @@ +apiVersion: 1 + +datasources: + - name: "sindan-mysql" + type: mysql + version: 1 + editable: false + url: mysql:3306 + database: sindan_production + user: sindan + password: %%__DB_PWD__%% + jsonData: + maxOpenConns: 0 + maxIdleConns: 5 + connMaxLifetime: 14400 + diff --git a/grafana/set_db_password.sh b/grafana/set_db_password.sh new file mode 100755 index 0000000..53be932 --- /dev/null +++ b/grafana/set_db_password.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +template="grafana/provisioning/datasources/datasources.yml.template" +target="grafana/provisioning/datasources/datasources.yml" +secret_file=".secrets/db_password.txt" + +if [ ! -f "$secret_file" ] ; then + echo "ERROR: no such file, $secret_file" + exit 1 +fi +secret=$(cat $secret_file) + +if [ -z "$secret" ] ; then + echo "ERROR: zero length password. check $secret_file." + exit 1 +fi + +if [ ! -f "$template" ] ; then + echo "ERROR: no such file, $template" + exit 1 +fi + +if [ -f "$target" ] ; then + echo "ERROR: $target has already existed. please consider to delete it first." + exit 1 +fi + +sed -e "s/%%__DB_PWD__%%/${secret}/" < $template > $target +echo "$target has been created." From 67ca1f0a1121d123e618711f8ca80f7f6e1074f5 Mon Sep 17 00:00:00 2001 From: tanupoo Date: Sat, 14 Mar 2020 17:18:26 +0900 Subject: [PATCH 2/7] added grafana. --- Makefile | 1 + docker-compose.yml | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/Makefile b/Makefile index 4a5b246..5245371 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,7 @@ build: --build-arg BUILDTIME_DB_PASSWORD_FILE=/run/secrets/db_password \ --secret id=rails_secret,src=.secrets/rails_secret_key_base.txt \ --secret id=db_pass,src=.secrets/db_password.txt + docker-compose build grafana .PHONY: push push: diff --git a/docker-compose.yml b/docker-compose.yml index 309ded5..5bdcf67 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -98,6 +98,22 @@ services: labels: com.sindan-net.description: "Web frontend to manage diagnosis logs" + grafana: + image: sindan/grafana:6.5.0 + build: + context: ./grafana + hostname: sindan-grafana + restart: always + depends_on: + - mysql + ports: + - "3001:3000" + environment: + - GF_PATHS_CONFIG=/etc/grafana/config.ini + - GF_INSTALL_PLUGINS=grafana-clock-panel + volumes: + - grafana-data:/var/lib/grafana + secrets: db_password: file: .secrets/db_password.txt @@ -110,3 +126,4 @@ volumes: fluentd-data: mysql-data: visualization-data: + grafana-data: From d8c2db49c7d52bd994e742193246cb23accd84d9 Mon Sep 17 00:00:00 2001 From: tanupoo Date: Sat, 14 Mar 2020 17:40:24 +0900 Subject: [PATCH 3/7] added text for grafana --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6311b67..29b575d 100644 --- a/README.md +++ b/README.md @@ -37,10 +37,14 @@ $ git submodule update --init --recursive ### Setup secrets All of password files in this directory are not tracked by Git. -Set the password of MySQL database. +Set the password of MySQL database. If you are Mac user, please use "*shasum -a 256*" instead of sha256sum below. ```bash $ echo PASSWORD_OF_YOUR_ENV | sha256sum | cut -d ' ' -f 1 > .secrets/db_password.txt ``` +Set the hashed password into the grafana datasource file. +```bash +$ grafana/set_db_password.sh +``` Register user account of SINDAN Web. User's password must be **8-72 characters long**. Sample `accounts.yml` registers an account whose name is `sindan` and password is `changeme`. @@ -80,6 +84,10 @@ Open your favorite browser and go [http://localhost:3000](http://localhost:3000) ![Safari screenshot](https://raw.githubusercontent.com/SINDAN/sindan-docker/screenshot/safari.png) +You can see some graph charts by [Grafana](https://grafana.com/) when you open [http://localhost:3001](http://localhost:3001) + +![screenshot of SINDAN Grafana](https://raw.githubusercontent.com/SINDAN/sindan-docker/screenshot/grafana.png) + ### Stop and remove ``` $ make stop # stop all containers From 8d59b8e8f2da7948ed81dfd6863edf09cde61060 Mon Sep 17 00:00:00 2001 From: tanupoo Date: Sat, 14 Mar 2020 18:01:04 +0900 Subject: [PATCH 4/7] added text for password to login into grafana. --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 29b575d..efd24b5 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,10 @@ Open your favorite browser and go [http://localhost:3000](http://localhost:3000) ![Safari screenshot](https://raw.githubusercontent.com/SINDAN/sindan-docker/screenshot/safari.png) -You can see some graph charts by [Grafana](https://grafana.com/) when you open [http://localhost:3001](http://localhost:3001) +You can see some graph charts by [Grafana](https://grafana.com/) when you open [http://localhost:3001](http://localhost:3001). +Firstly, you have to log into the dashboard as a user "*admin*". +The default password is "*admin*" as well. +You have to change the password then. ![screenshot of SINDAN Grafana](https://raw.githubusercontent.com/SINDAN/sindan-docker/screenshot/grafana.png) From f197967be78c6ff60626a19aa60fcb657072004f Mon Sep 17 00:00:00 2001 From: mi2428 Date: Wed, 3 Jun 2020 02:07:09 +0900 Subject: [PATCH 5/7] Update to use BuildKit and Docker Secrets (Editing PR #13) Signed-off-by: mi2428 --- .secrets/gf_password.txt.example | 1 + .secrets/gf_user.txt.example | 1 + Makefile | 8 ++++- docker-compose.yml | 23 +++++++++++++-- grafana/Dockerfile | 18 +++++++++--- grafana/entrypoint.sh | 11 +++++++ ...tasources.yml.template => datasources.yml} | 3 +- grafana/set_db_password.sh | 29 ------------------- 8 files changed, 56 insertions(+), 38 deletions(-) create mode 100644 .secrets/gf_password.txt.example create mode 100644 .secrets/gf_user.txt.example create mode 100644 grafana/entrypoint.sh rename grafana/provisioning/datasources/{datasources.yml.template => datasources.yml} (81%) delete mode 100755 grafana/set_db_password.sh diff --git a/.secrets/gf_password.txt.example b/.secrets/gf_password.txt.example new file mode 100644 index 0000000..dff0ae5 --- /dev/null +++ b/.secrets/gf_password.txt.example @@ -0,0 +1 @@ +changeme diff --git a/.secrets/gf_user.txt.example b/.secrets/gf_user.txt.example new file mode 100644 index 0000000..e1eb876 --- /dev/null +++ b/.secrets/gf_user.txt.example @@ -0,0 +1 @@ +sindan diff --git a/Makefile b/Makefile index c63ac25..753900a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ BUILDKIT_DOCKER_BUILD = DOCKER_BUILDKIT=1 docker build SINDAN_FLUENTD_TAG = sindan/fluentd:v1.6-1-rev1 SINDAN_VISUALIZATION_TAG = sindan/visualization:2.6.3-alpine-rev1 +SINDAN_GRAFANA_TAG = sindan/grafana:6.5.0-rev1 .PHONY: all all: run @@ -9,6 +10,7 @@ all: run lint: fluentd/Dockerfile visualization/Dockerfile docker run --rm -i hadolint/hadolint < fluentd/Dockerfile || true docker run --rm -i hadolint/hadolint < visualization/Dockerfile || true + docker run --rm -i hadolint/hadolint < grafana/Dockerfile || true .PHONY: build build: @@ -20,17 +22,19 @@ build: --build-arg BUILDTIME_DB_PASSWORD_FILE=/run/secrets/db_password \ --secret id=rails_secret,src=.secrets/rails_secret_key_base.txt \ --secret id=db_pass,src=.secrets/db_password.txt - docker-compose build grafana + $(BUILDKIT_DOCKER_BUILD) grafana --no-cache -t $(SINDAN_GRAFANA_TAG) .PHONY: push push: docker push $(SINDAN_FLUENTD_TAG) docker push $(SINDAN_VISUALIZATION_TAG) + docker push $(SINDAN_GRAFANA_TAG) .PHONY: pull pull: docker pull $(SINDAN_FLUENTD_TAG) docker pull $(SINDAN_VISUALIZATION_TAG) + docker pull $(SINDAN_GRAFANA_TAG) .PHONY: init init: @@ -68,5 +72,7 @@ destroy: docker volume rm -f $(shell basename $(CURDIR))_fluentd-data docker volume rm -f $(shell basename $(CURDIR))_mysql-data docker volume rm -f $(shell basename $(CURDIR))_visualization-data + docker volume rm -f $(shell basename $(CURDIR))_grafana-data docker rmi -f $(SINDAN_FLUENTD_TAG) docker rmi -f $(SINDAN_VISUALIZATION_TAG) + docker rmi -f $(SINDAN_GRAFANA_TAG) diff --git a/docker-compose.yml b/docker-compose.yml index 5ce7e6c..363fc6b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -99,7 +99,7 @@ services: com.sindan-net.description: "Web frontend to manage diagnosis logs" grafana: - image: sindan/grafana:6.5.0 + image: sindan/grafana:6.5.0-rev1 build: context: ./grafana hostname: sindan-grafana @@ -108,11 +108,24 @@ services: - mysql ports: - "3001:3000" + secrets: + - db_password + - gf_user + - gf_password + logging: *default-logging environment: - - GF_PATHS_CONFIG=/etc/grafana/config.ini - - GF_INSTALL_PLUGINS=grafana-clock-panel + GF_PATHS_CONFIG: "/etc/grafana/config.ini" + GF_INSTALL_PLUGINS: "grafana-clock-panel" + GF_SECURITY_ADMIN_USER__FILE: "/run/secrets/gf_user" + GF_SECURITY_ADMIN_PASSWORD__FILE: "/run/secrets/gf_password" + healthcheck: + <<: *default-healthcheck + test: wget --spider http://127.0.0.1:3000/api/health || exit 1 + timeout: "2s" volumes: - grafana-data:/var/lib/grafana + labels: + com.sindan-net.description: "Grafana dashboard" secrets: db_password: @@ -121,6 +134,10 @@ secrets: file: .secrets/rails_secret_key_base.txt accounts: file: .secrets/accounts.yml + gf_user: + file: .secrets/gf_user.txt + gf_password: + file: .secrets/gf_password.txt volumes: fluentd-data: diff --git a/grafana/Dockerfile b/grafana/Dockerfile index b7f7b44..0f2018c 100644 --- a/grafana/Dockerfile +++ b/grafana/Dockerfile @@ -1,5 +1,15 @@ -#FROM grafana/grafana:6.5.0-beta1 FROM grafana/grafana:6.5.0 -ADD ./provisioning /etc/grafana/provisioning -ADD ./config.ini /etc/grafana/config.ini -ADD ./dashboards /var/lib/grafana/dashboards + +USER root + +COPY ./entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +USER grafana + +COPY ./provisioning /etc/grafana/provisioning +COPY ./config.ini /etc/grafana/config.ini +COPY ./dashboards /var/lib/grafana/dashboards + +ENTRYPOINT /entrypoint.sh + diff --git a/grafana/entrypoint.sh b/grafana/entrypoint.sh new file mode 100644 index 0000000..2c33af0 --- /dev/null +++ b/grafana/entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +env_secrets_expand(){ + if [[ -f /run/secrets/db_password ]]; then + export GF_MYSQL_DB_PASSWORD=$(< /run/secrets/db_password) + fi +} + +env_secrets_expand +exec /run.sh + diff --git a/grafana/provisioning/datasources/datasources.yml.template b/grafana/provisioning/datasources/datasources.yml similarity index 81% rename from grafana/provisioning/datasources/datasources.yml.template rename to grafana/provisioning/datasources/datasources.yml index e09545a..b2b1a67 100644 --- a/grafana/provisioning/datasources/datasources.yml.template +++ b/grafana/provisioning/datasources/datasources.yml @@ -8,7 +8,8 @@ datasources: url: mysql:3306 database: sindan_production user: sindan - password: %%__DB_PWD__%% + secureJsonData: + password: ${GF_MYSQL_DB_PASSWORD} jsonData: maxOpenConns: 0 maxIdleConns: 5 diff --git a/grafana/set_db_password.sh b/grafana/set_db_password.sh deleted file mode 100755 index 53be932..0000000 --- a/grafana/set_db_password.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -template="grafana/provisioning/datasources/datasources.yml.template" -target="grafana/provisioning/datasources/datasources.yml" -secret_file=".secrets/db_password.txt" - -if [ ! -f "$secret_file" ] ; then - echo "ERROR: no such file, $secret_file" - exit 1 -fi -secret=$(cat $secret_file) - -if [ -z "$secret" ] ; then - echo "ERROR: zero length password. check $secret_file." - exit 1 -fi - -if [ ! -f "$template" ] ; then - echo "ERROR: no such file, $template" - exit 1 -fi - -if [ -f "$target" ] ; then - echo "ERROR: $target has already existed. please consider to delete it first." - exit 1 -fi - -sed -e "s/%%__DB_PWD__%%/${secret}/" < $template > $target -echo "$target has been created." From 6684cbd01a84d4ff8774a878e762175838c8e8ec Mon Sep 17 00:00:00 2001 From: mi2428 Date: Wed, 3 Jun 2020 02:11:49 +0900 Subject: [PATCH 6/7] Add travis rules for build and deploy sindan/grafana (Editing PR #13) Signed-off-by: mi2428 --- .travis.yml | 10 ++++++++-- .travis/deploy_dockerhub.sh | 2 ++ .travis/deploy_github.sh | 4 ++++ .travis/test_building_grafana.sh | 18 ++++++++++++++++++ 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 .travis/test_building_grafana.sh diff --git a/.travis.yml b/.travis.yml index d716779..fc0a71f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,14 +40,18 @@ jobs: # env: # - CACHE_NAME=visualization - - stage: "Test: building 1/2" + - stage: "Test: building 1/3" name: "Building sindan-fluentd" script: bash .travis/test_building_fluentd.sh - - stage: "Test: building 2/2" + - stage: "Test: building 2/3" name: "Building sindan-visualization (with build-time secret option)" script: bash .travis/test_building_visualization.sh + - stage: "Test: building 3/3" + name: "Building sindan-grafana" + script: bash .travis/test_building_grafana.sh + - stage: "Test: initializing and running" name: "Initialize database and start rails app with fluentd" script: @@ -64,6 +68,7 @@ jobs: - ls -al docker - gzip -dc docker/fluentd.tar.gz | docker load - gzip -dc docker/visualization.tar.gz | docker load + - gzip -dc docker/grafana.tar.gz | docker load - bash .travis/deploy_dockerhub.sh - name: "Deploy to GitHub Package Registry" if: branch = master @@ -71,6 +76,7 @@ jobs: - ls -al docker - gzip -dc docker/fluentd.tar.gz | docker load - gzip -dc docker/visualization.tar.gz | docker load + - gzip -dc docker/grafana.tar.gz | docker load - bash .travis/deploy_github.sh env: diff --git a/.travis/deploy_dockerhub.sh b/.travis/deploy_dockerhub.sh index 39ee395..73acb69 100644 --- a/.travis/deploy_dockerhub.sh +++ b/.travis/deploy_dockerhub.sh @@ -2,8 +2,10 @@ cd $(dirname $0)/.. IMAGE_TAG_FLUENTD="$(grep 'image: sindan/fluentd' docker-compose.yml | awk '{print $2}')" IMAGE_TAG_VISUALIZATION="$(grep 'image: sindan/visualization' docker-compose.yml | awk '{print $2}')" +IMAGE_TAG_GRAFANA="$(grep 'image: sindan/grafana' docker-compose.yml | awk '{print $2}')" docker login --username "$DOCKER_HUB_USERNAME" --password "$DOCKER_HUB_PASSWORD" docker push "$IMAGE_TAG_FLUENTD" docker push "$IMAGE_TAG_VISUALIZATION" +docker push "$IMAGE_TAG_GRAFANA" diff --git a/.travis/deploy_github.sh b/.travis/deploy_github.sh index a7a0392..c580120 100644 --- a/.travis/deploy_github.sh +++ b/.travis/deploy_github.sh @@ -2,6 +2,7 @@ cd $(dirname $0)/.. IMAGE_TAG_FLUENTD="$(grep 'image: sindan/fluentd' docker-compose.yml | awk '{print $2}')" IMAGE_TAG_VISUALIZATION="$(grep 'image: sindan/visualization' docker-compose.yml | awk '{print $2}')" +IMAGE_TAG_GRAFANA="$(grep 'image: sindan/grafana' docker-compose.yml | awk '{print $2}')" docker login docker.pkg.github.com --username "$GITHUB_PKG_USERNAME" --password "$GITHUB_PKG_TOKEN" @@ -10,10 +11,13 @@ docker login docker.pkg.github.com --username "$GITHUB_PKG_USERNAME" --password PREFIX=docker.pkg.github.com/sindan/sindan-docker IMAGE_FLUENTD=$(echo $IMAGE_TAG_FLUENTD | cut -d '/' -f 2) IMAGE_VISUALIZATION=$(echo $IMAGE_TAG_VISUALIZATION | cut -d '/' -f 2) +IMAGE_GRAFANA=$(echo $IMAGE_TAG_GRAFANA | cut -d '/' -f 2) docker tag $IMAGE_TAG_FLUENTD $PREFIX/$IMAGE_FLUENTD docker tag $IMAGE_TAG_VISUALIZATION $PREFIX/$IMAGE_VISUALIZATION +docker tag $IMAGE_TAG_GRAFANA $PREFIX/$IMAGE_GRAFANA docker push $PREFIX/$IMAGE_FLUENTD docker push $PREFIX/$IMAGE_VISUALIZATION +docker push $PREFIX/$IMAGE_GRAFANA diff --git a/.travis/test_building_grafana.sh b/.travis/test_building_grafana.sh new file mode 100644 index 0000000..da48706 --- /dev/null +++ b/.travis/test_building_grafana.sh @@ -0,0 +1,18 @@ +cd $(dirname $0)/.. + +IMAGE_TAG="$(grep 'image: sindan/grafana' docker-compose.yml | awk '{print $2}')" +echo $IMAGE_TAG + +pushd grafana + +BUILDKIT_HOST=tcp://0.0.0.0:1234 \ + buildctl build --no-cache --frontend dockerfile.v0 --local context=. --local dockerfile=. --progress plain \ + --output type=docker,name=$IMAGE_TAG | docker load + +st=$? +(( $st > 0 )) && exit $st + +popd + +docker images +docker save $IMAGE_TAG | gzip > docker/grafana.tar.gz From b77bbbdb1db8248d6e6b9466e7665ca36cfae70a Mon Sep 17 00:00:00 2001 From: mi2428 Date: Wed, 3 Jun 2020 02:52:42 +0900 Subject: [PATCH 7/7] Update README.md (Editing PR #13) Signed-off-by: mi2428 --- README.md | 61 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index b250cc8..7dd804a 100644 --- a/README.md +++ b/README.md @@ -5,53 +5,63 @@ [![](https://travis-ci.org/SINDAN/sindan-docker.svg?branch=master)](https://travis-ci.org/SINDAN/sindan-docker) [![](http://img.shields.io/github/license/SINDAN/sindan-docker)](LICENSE) [![](https://img.shields.io/github/issues/SINDAN/sindan-docker)](https://github.com/SINDAN/sindan-docker/issues) [![](https://img.shields.io/github/issues-pr/SINDAN/sindan-docker)](https://github.com/SINDAN/sindan-docker/pull) [![](https://img.shields.io/github/last-commit/SINDAN/sindan-docker)](https://github.com/SINDAN/sindan-docker/commits) [![](https://img.shields.io/github/release/SINDAN/sindan-docker)](https://github.com/SINDAN/sindan-docker/releases) [![](https://img.shields.io/github/release-date/SINDAN/sindan-docker)](https://github.com/SINDAN/sindan-docker/releases) Dockerization of server-side [@SINDAN](https://github.com/SINDAN) suite -- **[Branch: shored-master](https://github.com/SINDAN/sindan-docker/tree/shored-master)** Previous generation maintained by [@shored](https://github.com/shored) (soon to be deprecated and removed) +- **[Branch: shored-master](https://github.com/SINDAN/sindan-docker/tree/shored-master)** is the previous generation maintained by [@shored](https://github.com/shored) (soon to be deprecated and removed) ## About SINDAN Project + Please visit website [sindan-net.com](https://www.sindan-net.com) for more details. (Japanese edition only) > In order to detect network failure, SINDAN project evaluates the network status based on user-side observations, and aims to establish a method that enables network operators to troubleshoot quickly. ## Getting Started + These instructions will get you a copy of this project up and running on your environment for production purpose. -If you want to use this for development or testing purposes, it is necessary to edit some configurations appropriately. +If you want to use this for development or testing purposes, some configurations need to be fixed appropriately. ### Prerequisites -To build images, **Docker with BuildKit support is needed.** + +To build images on your local environment, **Docker with BuildKit support is needed.** GNU/Make is not necessary, but it can reduce the number of commands you type. - docker-engine: 18.06.0 and higher - docker-compose: 1.22.0 and higher ### Clone repository + First of all, you have to shallow clone this repository recursively with: + ```bash $ git clone --recursive --depth 1 https://github.com/SINDAN/sindan-docker ``` + If you ran simple cloning command without recursive option or downloaded as a zip archive via browser, make sure that all submodules are fully updated. + ```bash $ git submodule update --init --recursive ``` ### Setup secrets -All of password files in this directory are not tracked by Git. -Set the password of MySQL database. If you are Mac user, please use "*shasum -a 256*" instead of sha256sum below. + +Git will ignore all of password files in `.secrets` directory, so that the updates are local-only. +Set the password of MySQL database. +For mac users, use `shasum -a 256` instead of `sha256sum` below. + ```bash $ echo PASSWORD_OF_YOUR_ENV | sha256sum | cut -d ' ' -f 1 > .secrets/db_password.txt ``` -Set the hashed password into the grafana datasource file. -```bash -$ grafana/set_db_password.sh -``` -Register user account of SINDAN Web. + +Register user accounts of SINDAN Web. User's password must be **8-72 characters long**. Sample `accounts.yml` registers an account whose name is `sindan` and password is `changeme`. + ```bash $ cp .secrets/accounts.yml.example .secrets/accounts.yml $ vim .secrets/accounts.yml ``` + You can register multiple accounts in bulk. + ```yml accounts: - username: hoge @@ -62,35 +72,44 @@ accounts: password: changeme ``` -### Build/Get docker image and initialize DB +Finally, set the Grafana's username and password to `gf_user.txt` and `gf_password.txt` respectively. + +### Build/Get docker imagesand initialize DB + Build dockerfile and initialize database. This might take a while. + ```bash $ cp .secrets/rails_secret_key_base.txt.example .secrets/rails_secret_key_base.txt $ make build init ``` -Instead of building locally, you can download built container images from [DockerHub](https://hub.docker.com/u/sindan). + +Instead of building locally, you can download pre-built images from [DockerHub](https://hub.docker.com/u/sindan). +Note that in this case, you must not edit `.secrets/rails_secret_key_base.txt` as you like. +Just follow the next: + ```bash $ cp .secrets/rails_secret_key_base.txt.example .secrets/rails_secret_key_base.txt $ make pull init ``` ### Deploy -Deploy containers built previous steps. + +Deploy containers built/pulled previous steps. + ``` $ make run log ``` + Open your favorite browser and go [http://localhost:3000](http://localhost:3000) to see SINDAN Web. ![Safari screenshot](https://raw.githubusercontent.com/SINDAN/sindan-docker/screenshot/safari.png) -You can see some graph charts by [Grafana](https://grafana.com/) when you open [http://localhost:3001](http://localhost:3001). -Firstly, you have to log into the dashboard as a user "*admin*". -The default password is "*admin*" as well. -You have to change the password then. +You can also access [Grafana](https://grafana.com/) with [http://localhost:3001](http://localhost:3001). -![screenshot of SINDAN Grafana](https://raw.githubusercontent.com/SINDAN/sindan-docker/screenshot/grafana.png) + ### Stop and remove + ``` $ make stop # stop all containers $ make clean # remove all containers (data will not be lost) @@ -98,16 +117,20 @@ $ make destroy # remove all containers, volumes, images ``` ## Contributing + Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us. ## Versioning -We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/SINDAN/sindan-docker/tags). + +We use [CalVer](https://calver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/SINDAN/sindan-docker/tags). ## Authors + - **Tomohiro ISHIHARA** - *Initial work & Patch contribution* - [@shored](https://github.com/shored) - **Taichi MIYA** - *Overhaul & Refactoring* - [@mi2428](https://github.com/mi2428) See also the list of [contributors](https://github.com/SINDAN/sindan-docker/graphs/contributors) who participated in this project. ## License + This project is licensed under the BSD 3-Clause "New" or "Revised" License - see the [LICENSE](LICENSE) file for details.