Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using fritzinfluxdb with InfluxDBv2 #18

Closed
TheLux83 opened this issue Feb 14, 2021 · 75 comments
Closed

Using fritzinfluxdb with InfluxDBv2 #18

TheLux83 opened this issue Feb 14, 2021 · 75 comments
Milestone

Comments

@TheLux83
Copy link

Hey there.

I just found this cool project and wanted to use it, but it seems, that it is not available for user who use influxDB in Version 2.
Is there any possibility to use this project with version 2, or will this be available in a next release?

@bb-Ricardo
Copy link
Owner

Hi, good point. Haven't tested influxdb 2. Will give it a go in the next few days and see what the issue is.

Do you have any output from the tool about the complaint?

@TheLux83
Copy link
Author

Hey @bb-Ricardo thanks for your reply.
I have to say, that I didn't try to get it working, because for influxDBv2 you don't use username and password anymore, but a token and a bucket.

@bb-Ricardo
Copy link
Owner

Ahhh I see. I have to admit I didn't look into influxdb since version 2 was released but can't be that difficult to solve. Maybe a small project for tonight.

@bb-Ricardo
Copy link
Owner

bb-Ricardo added a commit that referenced this issue Feb 15, 2021
@bb-Ricardo
Copy link
Owner

Hi,

can you test the branch "add-influx2.0-support"? I was able to see the measurements in the Influx GUI.

@TheLux83
Copy link
Author

Hey @bb-Ricardo,

it seems to be working. I get data to my InfluxDB instance.
The only thing that isn't working is the dashboard template. I tried to get it working, but that isn't as simple as I thought ^^

@bb-Ricardo
Copy link
Owner

That's true. I hoped it would work as it seemed that there was a compatible layer to query data "the old way". Maybe the data needs to written differently to match the queries.

I will have a look.

@bb-Ricardo
Copy link
Owner

bb-Ricardo commented Feb 15, 2021

Just spun up some containers and it seems like that we have to rewrite all queries for InfluxDB2 to Flux query language.

Sorry. This might take some time as I don't know anything about the language.

@bb-Ricardo
Copy link
Owner

can you try out this basic dashboard with one panel

The test dashboard json

{
  "__inputs": [
    {
      "name": "DS_INFLUXDB2",
      "label": "InfluxDB2",
      "description": "",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "7.4.1"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "influxdb",
      "name": "InfluxDB",
      "version": "1.0.0"
    }
  ],
  "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": null,
  "links": [],
  "panels": [
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_INFLUXDB2}",
      "fieldConfig": {
        "defaults": {
          "custom": {},
          "links": []
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 13,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "hiddenSeries": false,
      "id": 2,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "7.4.1",
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "/UP.*/",
          "transform": "negative-Y"
        },
        {
          "alias": "/.*Physical Max/",
          "color": "#64b0c8",
          "fill": 0
        },
        {
          "alias": "/.*DSL Sync/",
          "color": "#3f6833",
          "fill": 0
        },
        {
          "alias": "/.*netto Max/",
          "color": "#890f02",
          "fill": 0
        },
        {
          "alias": "/.*rror.*/",
          "bars": true,
          "yaxis": 2
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "alias": "UP",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "linear"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "measurement": "fritzbox",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "from(bucket: \"fritzflux\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r._measurement == \"fritzbox\" and\n    r._field == \"sendrate\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _value: r._value *8,\n      _field: \"UP\"\n    })\n  )\n  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n  |> yield(name: \"mean\")",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "sendrate"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              },
              {
                "params": [
                  "*8"
                ],
                "type": "math"
              }
            ]
          ],
          "tags": []
        },
        {
          "alias": "DOWN",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "linear"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "measurement": "fritzbox",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "from(bucket: \"fritzflux\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r._measurement == \"fritzbox\" and\n    r._field == \"receiverate\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _value: r._value *8,\n      _field: \"DOWN\"\n    })\n  )\n  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n  |> yield(name: \"mean\")",
          "refId": "B",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "receiverate"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              },
              {
                "params": [
                  "*8"
                ],
                "type": "math"
              }
            ]
          ],
          "tags": []
        },
        {
          "alias": "DOWN netto Max",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "linear"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "measurement": "fritzbox",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "from(bucket: \"fritzflux\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r._measurement == \"fritzbox\" and\n    r._field == \"downstreammax\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _field: \"DOWN netto Max\"\n    })\n  )\n  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n  |> yield(name: \"mean\")",
          "refId": "C",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "downstreammax"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": []
        },
        {
          "alias": "DOWN Physical Max",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "linear"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "measurement": "fritzbox",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "from(bucket: \"fritzflux\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r._measurement == \"fritzbox\" and\n    r._field == \"downstreamphysicalmax\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _field: \"DOWN Physical Max\"\n    })\n  )\n  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n  |> yield(name: \"mean\")",
          "refId": "D",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "downstreamphysicalmax"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "last"
              }
            ]
          ],
          "tags": []
        },
        {
          "alias": "DOWN DSL Sync",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "linear"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "measurement": "fritzbox",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "from(bucket: \"fritzflux\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r._measurement == \"fritzbox\" and\n    r._field == \"downstream_dsl_sync_max\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _value: r._value * 1000,\n      _field: \"DOWN DSL Sync\"\n    })\n  )\n  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n  |> yield(name: \"mean\")",
          "rawQuery": false,
          "refId": "E",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "downstream_dsl_sync_max"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              },
              {
                "params": [
                  "*1000"
                ],
                "type": "math"
              }
            ]
          ],
          "tags": []
        },
        {
          "alias": "UP netto Max",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "linear"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "measurement": "fritzbox",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "from(bucket: \"fritzflux\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r._measurement == \"fritzbox\" and\n    r._field == \"upstreammax\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _field: \"UP netto Max\"\n    })\n  )\n  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n  |> yield(name: \"mean\")",
          "rawQuery": false,
          "refId": "F",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "upstreammax"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": []
        },
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "orderByTime": "ASC",
          "policy": "default",
          "query": "from(bucket: \"fritzflux\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r._measurement == \"fritzbox\" and\n    r._field == \"upstreamphysicalmax\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _field: \"UP Physical Max\"\n    })\n  )\n  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n  |> yield(name: \"mean\")",
          "refId": "G",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": []
        },
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "orderByTime": "ASC",
          "policy": "default",
          "query": "from(bucket: \"fritzflux\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r._measurement == \"fritzbox\" and\n    r._field == \"upstream_dsl_sync_max\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _value: r._value * 1000,\n      _field: \"UP DSL Sync\"\n    })\n  )\n  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n  |> yield(name: \"mean\")",
          "refId": "H",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": []
        },
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "orderByTime": "ASC",
          "policy": "default",
          "query": "from(bucket: \"fritzflux\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r._measurement == \"fritzbox\" and\n    r._field == \"crc_errors\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _field: \"CRC Errors\"\n    })\n  )\n  |> derivative(unit: v.windowPeriod, nonNegative: true, columns: [\"_value\"], timeColumn: \"_time\")\n  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n  |> yield(name: \"last\")",
          "refId": "I",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": []
        },
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "orderByTime": "ASC",
          "policy": "default",
          "query": "from(bucket: \"fritzflux\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r._measurement == \"fritzbox\" and\n    r._field == \"errored_seconds\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _field: \"Errored Seconds\"\n    })\n  )\n  |> derivative(unit: v.windowPeriod, nonNegative: true, columns: [\"_value\"], timeColumn: \"_time\")\n  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n  |> yield(name: \"last\")",
          "refId": "J",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": []
        },
        {
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "orderByTime": "ASC",
          "policy": "default",
          "query": "from(bucket: \"fritzflux\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r._measurement == \"fritzbox\" and\n    r._field == \"severely_errored_seconds\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _field: \"Severely Errored Seconds\"\n    })\n  )\n  |> derivative(unit: v.windowPeriod, nonNegative: true, columns: [\"_value\"], timeColumn: \"_time\")\n  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n  |> yield(name: \"last\")",
          "refId": "K",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "tags": []
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Current UP/DOWN",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": null,
          "format": "bps",
          "label": "DSL Speed",
          "logBase": 1,
          "max": "142000000",
          "min": "-40000000",
          "show": true
        },
        {
          "decimals": 0,
          "format": "short",
          "label": "Errors",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "schemaVersion": 27,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "New dashboard Copy",
  "uid": "8tNTrYEMk",
  "version": 6
}

@TheLux83
Copy link
Author

Is it okay, if I test it tomorrow? I'm not on the corresponding system anymore for today. :-)

@bb-Ricardo
Copy link
Owner

Yes, of course. No problem

@TheLux83
Copy link
Author

grafik
Looking good :)

@bb-Ricardo
Copy link
Owner

Great. Let's see when I got time to modify all the other panels.

You might want to adjust the max Y axis value to 80000000.

@bb-Ricardo
Copy link
Owner

can you try out this new version? It should be close to the InfluxDB 1 Dashboard

The test dashboard json

{
    "__inputs": [
      {
        "name": "DS_INFLUXDB2",
        "label": "InfluxDB2",
        "description": "",
        "type": "datasource",
        "pluginId": "influxdb",
        "pluginName": "InfluxDB"
      },
      {
        "name": "VAR_MEASUREMENT",
        "type": "constant",
        "label": "InfluxDB measurement",
        "value": "fritzbox",
        "description": ""
      },
      {
        "name": "VAR_BUCKET",
        "type": "constant",
        "label": "InfluxDB bucket",
        "value": "fritzflux",
        "description": ""
      },
      {
        "name": "VAR_DOWN_MAX",
        "type": "constant",
        "label": "Max Down Speed (Mbit)",
        "value": "100",
        "description": ""
      },
      {
        "name": "VAR_UP_MAX",
        "type": "constant",
        "label": "Max Up Speed (Mbit)",
        "value": "40",
        "description": ""
      },
      {
        "name": "VAR_DATA_INTERVAL",
        "type": "constant",
        "label": "Data retrieval Interval",
        "value": "10",
        "description": ""
      }
    ],
    "__requires": [
      {
        "type": "panel",
        "id": "gauge",
        "name": "Gauge",
        "version": ""
      },
      {
        "type": "grafana",
        "id": "grafana",
        "name": "Grafana",
        "version": "7.4.1"
      },
      {
        "type": "panel",
        "id": "graph",
        "name": "Graph",
        "version": ""
      },
      {
        "type": "datasource",
        "id": "influxdb",
        "name": "InfluxDB",
        "version": "1.0.0"
      },
      {
        "type": "panel",
        "id": "singlestat",
        "name": "Singlestat",
        "version": ""
      },
      {
        "type": "panel",
        "id": "stat",
        "name": "Stat",
        "version": ""
      },
      {
        "type": "panel",
        "id": "table",
        "name": "Table",
        "version": ""
      }
    ],
    "editable": true,
    "gnetId": null,
    "graphTooltip": 0,
    "id": null,
    "iteration": 1613552794909,
    "links": [],
    "panels": [
      {
        "aliasColors": {},
        "bars": false,
        "dashLength": 10,
        "dashes": false,
        "datasource": "${DS_INFLUXDB2}",
        "fieldConfig": {
          "defaults": {
            "custom": {},
            "links": []
          },
          "overrides": []
        },
        "fill": 1,
        "fillGradient": 0,
        "gridPos": {
          "h": 13,
          "w": 24,
          "x": 0,
          "y": 0
        },
        "hiddenSeries": false,
        "id": 2,
        "legend": {
          "avg": false,
          "current": false,
          "max": false,
          "min": false,
          "show": true,
          "total": false,
          "values": false
        },
        "lines": true,
        "linewidth": 1,
        "links": [],
        "nullPointMode": "null",
        "options": {
          "alertThreshold": true
        },
        "percentage": false,
        "pluginVersion": "7.4.1",
        "pointradius": 5,
        "points": false,
        "renderer": "flot",
        "seriesOverrides": [
          {
            "alias": "/UP.*/",
            "transform": "negative-Y"
          },
          {
            "alias": "/.*Physical Max/",
            "color": "#64b0c8",
            "fill": 0
          },
          {
            "alias": "/.*DSL Sync/",
            "color": "#3f6833",
            "fill": 0
          },
          {
            "alias": "/.*netto Max/",
            "color": "#890f02",
            "fill": 0
          },
          {
            "alias": "/.*rror.*/",
            "bars": true,
            "yaxis": 2
          }
        ],
        "spaceLength": 10,
        "stack": false,
        "steppedLine": false,
        "targets": [
          {
            "hide": false,
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r[\"_measurement\"] == \"${measurement}\" and\n    r._field == \"sendrate\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _value: r._value *8,\n      _field: \"UP\"\n    })\n  )\n  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n  |> yield(name: \"mean\")",
            "refId": "A",
            "resultFormat": "time_series"
          },
          {
            "hide": false,
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r[\"_measurement\"] == \"${measurement}\" and\n    r._field == \"receiverate\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _value: r._value *8,\n      _field: \"DOWN\"\n    })\n  )\n  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n  |> yield(name: \"mean\")",
            "refId": "B",
            "resultFormat": "time_series"
          },
          {
            "hide": false,
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r[\"_measurement\"] == \"${measurement}\" and\n    r._field == \"downstreammax\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _field: \"DOWN netto Max\"\n    })\n  )\n  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n  |> yield(name: \"mean\")",
            "refId": "C",
            "resultFormat": "time_series"
          },
          {
            "hide": false,
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r[\"_measurement\"] == \"${measurement}\" and\n    r._field == \"downstreamphysicalmax\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _field: \"DOWN Physical Max\"\n    })\n  )\n  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n  |> yield(name: \"mean\")",
            "refId": "D",
            "resultFormat": "time_series"
          },
          {
            "hide": false,
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r[\"_measurement\"] == \"${measurement}\" and\n    r._field == \"downstream_dsl_sync_max\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _value: r._value * 1000,\n      _field: \"DOWN DSL Sync\"\n    })\n  )\n  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n  |> yield(name: \"mean\")",
            "rawQuery": false,
            "refId": "E",
            "resultFormat": "time_series"
          },
          {
            "hide": false,
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r[\"_measurement\"] == \"${measurement}\" and\n    r._field == \"upstreammax\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _field: \"UP netto Max\"\n    })\n  )\n  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n  |> yield(name: \"mean\")",
            "rawQuery": false,
            "refId": "F",
            "resultFormat": "time_series"
          },
          {
            "hide": false,
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r[\"_measurement\"] == \"${measurement}\" and\n    r._field == \"upstreamphysicalmax\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _field: \"UP Physical Max\"\n    })\n  )\n  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n  |> yield(name: \"mean\")",
            "refId": "G",
            "resultFormat": "time_series"
          },
          {
            "hide": false,
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r[\"_measurement\"] == \"${measurement}\" and\n    r._field == \"upstream_dsl_sync_max\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _value: r._value * 1000,\n      _field: \"UP DSL Sync\"\n    })\n  )\n  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)\n  |> yield(name: \"mean\")",
            "refId": "H",
            "resultFormat": "time_series"
          },
          {
            "hide": false,
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r[\"_measurement\"] == \"${measurement}\" and\n    r._field == \"crc_errors\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _field: \"CRC Errors\"\n    })\n  )\n  |> derivative(unit: v.windowPeriod, nonNegative: true, columns: [\"_value\"], timeColumn: \"_time\")\n  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n  |> yield(name: \"last\")",
            "refId": "I",
            "resultFormat": "time_series"
          },
          {
            "hide": false,
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r[\"_measurement\"] == \"${measurement}\" and\n    r._field == \"errored_seconds\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _field: \"Errored Seconds\"\n    })\n  )\n  |> derivative(unit: v.windowPeriod, nonNegative: true, columns: [\"_value\"], timeColumn: \"_time\")\n  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n  |> yield(name: \"last\")",
            "refId": "J",
            "resultFormat": "time_series"
          },
          {
            "hide": false,
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r[\"_measurement\"] == \"${measurement}\" and\n    r._field == \"severely_errored_seconds\"\n  )\n  |> map(fn: (r) => ({\n      r with\n      _field: \"Severely Errored Seconds\"\n    })\n  )\n  |> derivative(unit: v.windowPeriod, nonNegative: true, columns: [\"_value\"], timeColumn: \"_time\")\n  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n  |> yield(name: \"last\")",
            "refId": "K",
            "resultFormat": "time_series"
          }
        ],
        "thresholds": [],
        "timeFrom": null,
        "timeRegions": [],
        "timeShift": null,
        "title": "Current UP/DOWN",
        "tooltip": {
          "shared": true,
          "sort": 0,
          "value_type": "individual"
        },
        "type": "graph",
        "xaxis": {
          "buckets": null,
          "mode": "time",
          "name": null,
          "show": true,
          "values": []
        },
        "yaxes": [
          {
            "decimals": null,
            "format": "bps",
            "label": "DSL Speed",
            "logBase": 1,
            "max": null,
            "min": null,
            "show": true
          },
          {
            "decimals": 0,
            "format": "short",
            "label": "Errors",
            "logBase": 1,
            "max": null,
            "min": null,
            "show": true
          }
        ],
        "yaxis": {
          "align": false,
          "alignLevel": null
        }
      },
      {
        "cacheTimeout": null,
        "datasource": "${DS_INFLUXDB2}",
        "fieldConfig": {
          "defaults": {
            "color": {
              "mode": "thresholds"
            },
            "custom": {},
            "mappings": [
              {
                "id": 0,
                "op": "=",
                "text": "N/A",
                "type": 1,
                "value": "null"
              },
              {
                "id": 1,
                "op": "=",
                "text": "No",
                "type": 1,
                "value": "0"
              },
              {
                "id": 2,
                "op": "=",
                "text": "Yes",
                "type": 1,
                "value": "1"
              }
            ],
            "thresholds": {
              "mode": "absolute",
              "steps": [
                {
                  "color": "#6ed0e0",
                  "value": null
                },
                {
                  "color": "dark-blue",
                  "value": 0
                },
                {
                  "color": "#508642",
                  "value": 1
                }
              ]
            },
            "unit": "none"
          },
          "overrides": []
        },
        "gridPos": {
          "h": 4,
          "w": 2,
          "x": 0,
          "y": 13
        },
        "id": 4,
        "interval": null,
        "links": [],
        "maxDataPoints": 100,
        "options": {
          "colorMode": "value",
          "graphMode": "none",
          "justifyMode": "auto",
          "orientation": "horizontal",
          "reduceOptions": {
            "calcs": [
              "lastNotNull"
            ],
            "fields": "",
            "values": false
          },
          "text": {},
          "textMode": "auto"
        },
        "pluginVersion": "7.4.1",
        "targets": [
          {
            "dsType": "influxdb",
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"${measurement}\" and r[\"_field\"] == \"upgrade_available\")\n  |> last()",
            "refId": "A",
            "resultFormat": "time_series"
          }
        ],
        "title": "Update Available",
        "type": "stat"
      },
      {
        "cacheTimeout": null,
        "colorBackground": false,
        "colorValue": false,
        "colors": [
          "rgba(245, 54, 54, 0.9)",
          "rgba(237, 129, 40, 0.89)",
          "#1f78c1"
        ],
        "datasource": "${DS_INFLUXDB2}",
        "decimals": 2,
        "fieldConfig": {
          "defaults": {
            "custom": {}
          },
          "overrides": []
        },
        "format": "dtdurations",
        "gauge": {
          "maxValue": 100,
          "minValue": 0,
          "show": false,
          "thresholdLabels": false,
          "thresholdMarkers": true
        },
        "gridPos": {
          "h": 2,
          "w": 6,
          "x": 2,
          "y": 13
        },
        "hideTimeOverride": true,
        "id": 6,
        "interval": null,
        "links": [],
        "mappingType": 1,
        "mappingTypes": [
          {
            "name": "value to text",
            "value": 1
          },
          {
            "name": "range to text",
            "value": 2
          }
        ],
        "maxDataPoints": 100,
        "nullPointMode": "connected",
        "nullText": null,
        "postfix": "",
        "postfixFontSize": "50%",
        "prefix": "",
        "prefixFontSize": "50%",
        "rangeMaps": [
          {
            "from": "null",
            "text": "N/A",
            "to": "null"
          }
        ],
        "sparkline": {
          "fillColor": "rgba(31, 118, 189, 0.18)",
          "full": false,
          "lineColor": "rgb(31, 120, 193)",
          "show": false
        },
        "tableColumn": "",
        "targets": [
          {
            "dsType": "influxdb",
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"${measurement}\" and r[\"_field\"] == \"linkuptime\")\n  |> last()\n",
            "refId": "A",
            "resultFormat": "time_series"
          }
        ],
        "thresholds": "1,1",
        "timeFrom": "5m",
        "timeShift": null,
        "title": "DSL Link Uptime",
        "type": "singlestat",
        "valueFontSize": "50%",
        "valueMaps": [
          {
            "op": "=",
            "text": "N/A",
            "value": "null"
          },
          {
            "op": "=",
            "text": "Disconnected",
            "value": "0"
          }
        ],
        "valueName": "current"
      },
      {
        "cacheTimeout": null,
        "datasource": "${DS_INFLUXDB2}",
        "fieldConfig": {
          "defaults": {
            "color": {
              "mode": "continuous-GrYlRd"
            },
            "custom": {},
            "decimals": 1,
            "mappings": [],
            "min": 0,
            "thresholds": {
              "mode": "absolute",
              "steps": [
                {
                  "color": "rgba(245, 54, 54, 0.9)",
                  "value": null
                }
              ]
            },
            "unit": "Bps"
          },
          "overrides": []
        },
        "gridPos": {
          "h": 4,
          "w": 3,
          "x": 8,
          "y": 13
        },
        "id": 10,
        "interval": null,
        "links": [],
        "maxDataPoints": 100,
        "options": {
          "orientation": "horizontal",
          "reduceOptions": {
            "calcs": [
              "lastNotNull"
            ],
            "fields": "/^receiverate$/",
            "values": false
          },
          "showThresholdLabels": false,
          "showThresholdMarkers": false,
          "text": {}
        },
        "pluginVersion": "7.4.1",
        "targets": [
          {
            "dsType": "influxdb",
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"${measurement}\" and r[\"_field\"] == \"receiverate\")\n  |> last()\n",
            "refId": "A",
            "resultFormat": "time_series"
          },
          {
            "hide": false,
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"${measurement}\"  and r._field == \"downstreammax\")\n  |> last()\n  |> map(fn: (r) => ({\n      r with\n      _value: r._value / 8,\n    })\n  )",
            "refId": "B",
            "resultFormat": "time_series"
          }
        ],
        "title": "Current Download",
        "type": "gauge"
      },
      {
        "cacheTimeout": null,
        "datasource": "${DS_INFLUXDB2}",
        "fieldConfig": {
          "defaults": {
            "color": {
              "mode": "continuous-YlBl"
            },
            "custom": {},
            "decimals": 1,
            "mappings": [],
            "min": 0,
            "thresholds": {
              "mode": "absolute",
              "steps": [
                {
                  "color": "rgba(245, 54, 54, 0.9)",
                  "value": null
                }
              ]
            },
            "unit": "Bps"
          },
          "overrides": []
        },
        "gridPos": {
          "h": 4,
          "w": 3,
          "x": 11,
          "y": 13
        },
        "id": 12,
        "interval": null,
        "links": [],
        "maxDataPoints": 100,
        "options": {
          "orientation": "horizontal",
          "reduceOptions": {
            "calcs": [
              "lastNotNull"
            ],
            "fields": "/^sendrate$/",
            "values": false
          },
          "showThresholdLabels": false,
          "showThresholdMarkers": false,
          "text": {}
        },
        "pluginVersion": "7.4.1",
        "targets": [
          {
            "dsType": "influxdb",
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"${measurement}\" and r[\"_field\"] == \"sendrate\")\n  |> last()\n",
            "refId": "A",
            "resultFormat": "time_series"
          },
          {
            "hide": false,
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"${measurement}\"  and r._field == \"upstreammax\")\n  |> last()\n  |> map(fn: (r) => ({\n      r with\n      _value: r._value / 8,\n    })\n  )",
            "refId": "B",
            "resultFormat": "time_series"
          }
        ],
        "title": "Current Upload",
        "type": "gauge"
      },
      {
        "cacheTimeout": null,
        "datasource": "${DS_INFLUXDB2}",
        "fieldConfig": {
          "defaults": {
            "color": {
              "mode": "thresholds"
            },
            "custom": {},
            "decimals": 3,
            "mappings": [],
            "thresholds": {
              "mode": "absolute",
              "steps": [
                {
                  "color": "red",
                  "value": null
                }
              ]
            },
            "unit": "decbytes"
          },
          "overrides": []
        },
        "gridPos": {
          "h": 4,
          "w": 5,
          "x": 14,
          "y": 13
        },
        "hideTimeOverride": true,
        "id": 14,
        "interval": null,
        "links": [],
        "maxDataPoints": 100,
        "options": {
          "colorMode": "value",
          "graphMode": "area",
          "justifyMode": "auto",
          "orientation": "horizontal",
          "reduceOptions": {
            "calcs": [
              "lastNotNull"
            ],
            "fields": "",
            "values": false
          },
          "text": {},
          "textMode": "auto"
        },
        "pluginVersion": "7.4.1",
        "targets": [
          {
            "dsType": "influxdb",
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"${measurement}\" and r[\"_field\"] == \"totalbytessent\")\n  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n",
            "rawQuery": true,
            "refId": "A",
            "resultFormat": "time_series"
          }
        ],
        "timeFrom": "24h",
        "timeShift": null,
        "title": "Total Upload since connection",
        "description": "Don't trust this values, FritzBox seems to have an issue to reset 'totalbytessent' to 0 on reconnect",
        "type": "stat"
      },
      {
        "cacheTimeout": null,
        "datasource": "${DS_INFLUXDB2}",
        "fieldConfig": {
          "defaults": {
            "color": {
              "mode": "thresholds"
            },
            "custom": {},
            "mappings": [],
            "thresholds": {
              "mode": "absolute",
              "steps": [
                {
                  "color": "semi-dark-blue",
                  "value": null
                }
              ]
            },
            "unit": "decbytes"
          },
          "overrides": []
        },
        "gridPos": {
          "h": 4,
          "w": 5,
          "x": 19,
          "y": 13
        },
        "hideTimeOverride": true,
        "id": 16,
        "interval": null,
        "links": [],
        "maxDataPoints": 100,
        "options": {
          "colorMode": "value",
          "graphMode": "area",
          "justifyMode": "auto",
          "orientation": "horizontal",
          "reduceOptions": {
            "calcs": [
              "lastNotNull"
            ],
            "fields": "",
            "values": false
          },
          "text": {},
          "textMode": "auto"
        },
        "pluginVersion": "7.4.1",
        "targets": [
          {
            "dsType": "influxdb",
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"${measurement}\" and r[\"_field\"] == \"totalbytesreceived\")\n  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n",
            "rawQuery": true,
            "refId": "A",
            "resultFormat": "time_series"
          }
        ],
        "timeFrom": "24h",
        "title": "Total Download since connection",
        "description": "Don't trust this values, FritzBox seems to have an issue to reset 'totalbytesreceived' to 0 on reconnect",
        "type": "stat"
      },
      {
        "cacheTimeout": null,
        "colorBackground": false,
        "colorValue": false,
        "colors": [
          "rgba(245, 54, 54, 0.9)",
          "rgba(237, 129, 40, 0.89)",
          "rgba(50, 172, 45, 0.97)"
        ],
        "datasource": "${DS_INFLUXDB2}",
        "decimals": 2,
        "fieldConfig": {
          "defaults": {
            "custom": {}
          },
          "overrides": []
        },
        "format": "dtdurations",
        "gauge": {
          "maxValue": 100,
          "minValue": 0,
          "show": false,
          "thresholdLabels": false,
          "thresholdMarkers": true
        },
        "gridPos": {
          "h": 2,
          "w": 6,
          "x": 2,
          "y": 15
        },
        "hideTimeOverride": true,
        "id": 8,
        "interval": null,
        "links": [],
        "mappingType": 1,
        "mappingTypes": [
          {
            "name": "value to text",
            "value": 1
          },
          {
            "name": "range to text",
            "value": 2
          }
        ],
        "maxDataPoints": 100,
        "nullPointMode": "connected",
        "nullText": null,
        "postfix": "",
        "postfixFontSize": "50%",
        "prefix": "",
        "prefixFontSize": "50%",
        "rangeMaps": [
          {
            "from": "null",
            "text": "N/A",
            "to": "null"
          }
        ],
        "sparkline": {
          "fillColor": "rgba(31, 118, 189, 0.18)",
          "full": false,
          "lineColor": "rgb(31, 120, 193)",
          "show": false
        },
        "tableColumn": "",
        "targets": [
          {
            "dsType": "influxdb",
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"${measurement}\" and r[\"_field\"] == \"systemuptime\")\n  |> last()\n",
            "rawQuery": false,
            "refId": "A",
            "resultFormat": "time_series"
          }
        ],
        "thresholds": "1,1",
        "timeFrom": "5m",
        "title": "System Uptime",
        "type": "singlestat",
        "valueFontSize": "50%",
        "valueMaps": [
          {
            "op": "=",
            "text": "N/A",
            "value": "null"
          }
        ],
        "valueName": "current"
      },
      {
        "cacheTimeout": null,
        "datasource": "${DS_INFLUXDB2}",
        "fieldConfig": {
          "defaults": {
            "color": {
              "mode": "thresholds"
            },
            "custom": {},
            "decimals": 3,
            "mappings": [],
            "thresholds": {
              "mode": "absolute",
              "steps": [
                {
                  "color": "semi-dark-red",
                  "value": null
                }
              ]
            },
            "unit": "decbytes"
          },
          "overrides": []
        },
        "gridPos": {
          "h": 3,
          "w": 6,
          "x": 0,
          "y": 17
        },
        "id": 18,
        "interval": null,
        "links": [],
        "maxDataPoints": 100,
        "options": {
          "colorMode": "value",
          "graphMode": "area",
          "justifyMode": "auto",
          "orientation": "horizontal",
          "reduceOptions": {
            "calcs": [
              "lastNotNull"
            ],
            "fields": "",
            "values": false
          },
          "text": {},
          "textMode": "auto"
        },
        "pluginVersion": "7.4.1",
        "targets": [
          {
            "dsType": "influxdb",
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"${measurement}\" and r[\"_field\"] == \"totalbytessent\")\n  |> difference(nonNegative: true, columns: [\"_value\"])\n  |> fill(column: \"_value\", usePrevious: true)\n  |> filter(fn: (r) => r._value < ${up_max} * ${data_interval} * 2 * 100000)\n  |> cumulativeSum(columns: [\"_value\"])\n  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n ",
            "rawQuery": true,
            "refId": "A",
            "resultFormat": "time_series"
          }
        ],
        "timeFrom": "24h",
        "timeShift": null,
        "title": "Last 24h Upload",
        "type": "stat"
      },
      {
        "cacheTimeout": null,
        "datasource": "${DS_INFLUXDB2}",
        "description": "",
        "fieldConfig": {
          "defaults": {
            "color": {
              "mode": "thresholds"
            },
            "custom": {},
            "mappings": [],
            "thresholds": {
              "mode": "absolute",
              "steps": [
                {
                  "color": "semi-dark-blue",
                  "value": null
                }
              ]
            },
            "unit": "decbytes"
          },
          "overrides": []
        },
        "gridPos": {
          "h": 3,
          "w": 6,
          "x": 6,
          "y": 17
        },
        "hideTimeOverride": false,
        "id": 20,
        "interval": null,
        "links": [],
        "maxDataPoints": 100,
        "options": {
          "colorMode": "value",
          "graphMode": "area",
          "justifyMode": "auto",
          "orientation": "auto",
          "reduceOptions": {
            "calcs": [
              "lastNotNull"
            ],
            "fields": "",
            "values": false
          },
          "text": {},
          "textMode": "auto"
        },
        "pluginVersion": "7.4.1",
        "targets": [
          {
            "dsType": "influxdb",
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"${measurement}\" and r[\"_field\"] == \"totalbytesreceived\")\n  |> difference(nonNegative: true, columns: [\"_value\"])\n  |> fill(column: \"_value\", usePrevious: true)\n  |> filter(fn: (r) => r._value < ${down_max} * ${data_interval} * 2 * 100000)\n  |> cumulativeSum(columns: [\"_value\"])\n  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n  |> yield(name: \"last\")\n",
            "rawQuery": true,
            "refId": "A",
            "resultFormat": "time_series"
          }
        ],
        "timeFrom": "24h",
        "timeShift": null,
        "title": "Last 24h Download",
        "type": "stat"
      },
      {
        "aliasColors": {
          "Download": "semi-dark-blue",
          "Upload": "#e24d42",
          "download": "#1F78C1",
          "upload": "#EA6460"
        },
        "annotate": {
          "enable": false
        },
        "bars": true,
        "dashLength": 10,
        "dashes": false,
        "datasource": "${DS_INFLUXDB2}",
        "decimals": null,
        "editable": true,
        "fieldConfig": {
          "defaults": {
            "custom": {},
            "links": []
          },
          "overrides": []
        },
        "fill": 0,
        "fillGradient": 0,
        "grid": {},
        "gridPos": {
          "h": 8,
          "w": 12,
          "x": 12,
          "y": 17
        },
        "hiddenSeries": false,
        "id": 22,
        "interval": "1h",
        "legend": {
          "avg": false,
          "current": true,
          "max": false,
          "min": false,
          "show": true,
          "total": true,
          "values": true
        },
        "lines": false,
        "linewidth": 1,
        "links": [],
        "nullPointMode": "null",
        "options": {
          "alertThreshold": false
        },
        "percentage": false,
        "pluginVersion": "7.4.1",
        "pointradius": 5,
        "points": false,
        "renderer": "flot",
        "resolution": 100,
        "scale": 1,
        "seriesOverrides": [],
        "spaceLength": 10,
        "stack": false,
        "steppedLine": true,
        "targets": [
          {
            "dsType": "influxdb",
            "hide": false,
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"${measurement}\" and r[\"_field\"] == \"totalbytesreceived\")\n  |> difference(nonNegative: true, columns: [\"_value\"])\n  |> fill(column: \"_value\", usePrevious: true)\n  |> filter(fn: (r) => r._value < ${down_max} * ${data_interval} * 2 * 100000)\n  |> cumulativeSum(columns: [\"_value\"])\n  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n  |> difference(nonNegative: true, columns: [\"_value\"])\n  |> map(fn: (r) => ({ r with _field: \"Download\" }))\n  |> yield(name: \"last\")\n\n",
            "rawQuery": true,
            "refId": "A",
            "resultFormat": "time_series"
          },
          {
            "dsType": "influxdb",
            "fill": "null",
            "hide": false,
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"${measurement}\" and r[\"_field\"] == \"totalbytessent\")\n  |> difference(nonNegative: true, columns: [\"_value\"])\n  |> fill(column: \"_value\", usePrevious: true)\n  |> filter(fn: (r) => r._value < ${up_max} * ${data_interval} * 2 * 100000)\n  |> cumulativeSum(columns: [\"_value\"])\n  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n  |> difference(nonNegative: true, columns: [\"_value\"])\n  |> map(fn: (r) => ({ r with _field: \"Upload\" }))\n  |> yield(name: \"last\")\n\n",
            "rawQuery": true,
            "refId": "B",
            "resultFormat": "time_series"
          }
        ],
        "thresholds": [],
        "timeFrom": "24h",
        "timeRegions": [],
        "timeShift": null,
        "title": "Current Traffic",
        "tooltip": {
          "msResolution": false,
          "query_as_alias": true,
          "shared": true,
          "sort": 0,
          "value_type": "cumulative"
        },
        "type": "graph",
        "xaxis": {
          "buckets": null,
          "mode": "time",
          "name": null,
          "show": true,
          "values": []
        },
        "yaxes": [
          {
            "decimals": null,
            "format": "decbytes",
            "label": "",
            "logBase": 1,
            "max": null,
            "min": 0,
            "show": true
          },
          {
            "format": "short",
            "logBase": 1,
            "max": null,
            "min": null,
            "show": false
          }
        ],
        "yaxis": {
          "align": false,
          "alignLevel": null
        },
        "zerofill": true
      },
      {
        "aliasColors": {
          "Download": "#1f78c1",
          "Upload": "#e24d42",
          "fritzbox_value.non_negative_derivative": "#ba43a9",
          "fritzbox_value.non_negative_difference": "#e24d42"
        },
        "bars": true,
        "dashLength": 10,
        "dashes": false,
        "datasource": "${DS_INFLUXDB2}",
        "fieldConfig": {
          "defaults": {
            "custom": {},
            "links": []
          },
          "overrides": []
        },
        "fill": 1,
        "fillGradient": 0,
        "gridPos": {
          "h": 7,
          "w": 12,
          "x": 0,
          "y": 20
        },
        "hiddenSeries": false,
        "id": 24,
        "interval": "24h",
        "legend": {
          "alignAsTable": false,
          "avg": false,
          "current": true,
          "hideEmpty": false,
          "hideZero": false,
          "max": false,
          "min": false,
          "rightSide": false,
          "show": true,
          "total": false,
          "values": true
        },
        "lines": false,
        "linewidth": 1,
        "links": [],
        "maxDataPoints": null,
        "nullPointMode": "null",
        "options": {
          "alertThreshold": true
        },
        "percentage": false,
        "pluginVersion": "7.4.1",
        "pointradius": 5,
        "points": false,
        "renderer": "flot",
        "seriesOverrides": [],
        "spaceLength": 10,
        "stack": false,
        "steppedLine": false,
        "targets": [
          {
            "hide": false,
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"${measurement}\" and r[\"_field\"] == \"totalbytesreceived\")\n  |> difference(nonNegative: true, columns: [\"_value\"])\n  |> fill(column: \"_value\", usePrevious: true)\n  |> filter(fn: (r) => r._value < ${down_max} * ${data_interval} * 2 * 100000)\n  |> cumulativeSum(columns: [\"_value\"])\n  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n  |> difference(nonNegative: true, columns: [\"_value\"])\n  |> map(fn: (r) => ({ r with _field: \"Download\" }))\n  |> yield(name: \"last\")",
            "refId": "A",
            "resultFormat": "time_series"
          },
          {
            "hide": false,
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"${measurement}\" and r[\"_field\"] == \"totalbytessent\")\n  |> difference(nonNegative: true, columns: [\"_value\"])\n  |> fill(column: \"_value\", usePrevious: true)\n  |> filter(fn: (r) => r._value < ${up_max} * ${data_interval} * 2 * 100000)\n  |> cumulativeSum(columns: [\"_value\"])\n  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n  |> difference(nonNegative: true, columns: [\"_value\"])\n  |> map(fn: (r) => ({ r with _field: \"Upload\" }))",
            "refId": "B",
            "resultFormat": "time_series"
          }
        ],
        "thresholds": [],
        "timeFrom": "7d",
        "timeRegions": [],
        "timeShift": null,
        "title": "Daily Traffic",
        "tooltip": {
          "shared": true,
          "sort": 0,
          "value_type": "individual"
        },
        "type": "graph",
        "xaxis": {
          "buckets": null,
          "mode": "time",
          "name": null,
          "show": true,
          "values": []
        },
        "yaxes": [
          {
            "decimals": null,
            "format": "decbytes",
            "label": "",
            "logBase": 1,
            "max": null,
            "min": null,
            "show": true
          },
          {
            "format": "decbytes",
            "label": null,
            "logBase": 1,
            "max": null,
            "min": null,
            "show": false
          }
        ],
        "yaxis": {
          "align": false,
          "alignLevel": null
        }
      },
      {
        "datasource": "${DS_INFLUXDB2}",
        "fieldConfig": {
          "defaults": {
            "color": {
              "mode": "thresholds"
            },
            "custom": {
              "align": null,
              "filterable": false
            },
            "mappings": [],
            "thresholds": {
              "mode": "absolute",
              "steps": [
                {
                  "color": "green",
                  "value": null
                }
              ]
            }
          },
          "overrides": [
            {
              "matcher": {
                "id": "byName",
                "options": "Metric"
              },
              "properties": [
                {
                  "id": "displayName",
                  "value": "Name"
                },
                {
                  "id": "mappings",
                  "value": [
                    {
                      "from": "",
                      "id": 1,
                      "text": "Link Status",
                      "to": "",
                      "type": 1,
                      "value": "connection_status"
                    },
                    {
                      "from": "",
                      "id": 2,
                      "text": "External IPv4",
                      "to": "",
                      "type": 1,
                      "value": "external_ip"
                    },
                    {
                      "from": "",
                      "id": 3,
                      "text": "External IPv6",
                      "to": "",
                      "type": 1,
                      "value": "external_ipv6"
                    },
                    {
                      "from": "",
                      "id": 4,
                      "text": "Last Connect Error",
                      "to": "",
                      "type": 1,
                      "value": "last_connection_error"
                    },
                    {
                      "from": "",
                      "id": 5,
                      "text": "Model",
                      "to": "",
                      "type": 1,
                      "value": "model"
                    },
                    {
                      "from": "",
                      "id": 6,
                      "text": "Number of Hosts",
                      "to": "",
                      "type": 1,
                      "value": "number_of_hosts"
                    },
                    {
                      "from": "",
                      "id": 7,
                      "text": "Link Status",
                      "to": "",
                      "type": 1,
                      "value": "physicallinkstatus"
                    },
                    {
                      "from": "",
                      "id": 8,
                      "text": "Link Type",
                      "to": "",
                      "type": 1,
                      "value": "physicallinktype"
                    },
                    {
                      "from": "",
                      "id": 9,
                      "text": "Remote POP",
                      "to": "",
                      "type": 1,
                      "value": "remote_pop"
                    },
                    {
                      "from": "",
                      "id": 10,
                      "text": "Serial",
                      "to": "",
                      "type": 1,
                      "value": "serialnumber"
                    },
                    {
                      "from": "",
                      "id": 11,
                      "text": "SW Version",
                      "to": "",
                      "type": 1,
                      "value": "softwareversion"
                    }
                  ]
                }
              ]
            }
          ]
        },
        "gridPos": {
          "h": 10,
          "w": 12,
          "x": 12,
          "y": 25
        },
        "hideTimeOverride": true,
        "id": 29,
        "interval": "",
        "links": [],
        "options": {
          "frameIndex": 1,
          "showHeader": true
        },
        "pluginVersion": "7.4.1",
        "targets": [
          {
            "groupBy": [],
            "hide": false,
            "limit": "1",
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"${measurement}\" and (\n    r[\"_field\"] == \"connection_status\" or \n    r[\"_field\"] == \"physicallinkstatus\" or \n    r[\"_field\"] == \"physicallinktype\" or \n    r[\"_field\"] == \"last_connection_error\" or \n    r[\"_field\"] == \"external_ip\" or \n    r[\"_field\"] == \"external_ipv6\" or \n    r[\"_field\"] == \"remote_pop\" or \n    r[\"_field\"] == \"model\" or \n    r[\"_field\"] == \"serialnumber\" or \n    r[\"_field\"] == \"softwareversion\" or \n    r[\"_field\"] == \"number_of_hosts\"))\n  |> last()\n  |> keep(columns: [\"_time\",\"_field\", \"_value\"])\n\n",
            "rawQuery": false,
            "refId": "A",
            "resultFormat": "time_series"
          }
        ],
        "timeFrom": "1m",
        "timeShift": null,
        "title": "FritzBox Info",
        "transformations": [
          {
            "id": "seriesToRows",
            "options": {
              "reducers": []
            }
          }
        ],
        "type": "table"
      },
      {
        "datasource": "${DS_INFLUXDB2}",
        "fieldConfig": {
          "defaults": {
            "color": {
              "mode": "thresholds"
            },
            "custom": {
              "align": null,
              "filterable": false
            },
            "decimals": 2,
            "displayName": "",
            "mappings": [],
            "thresholds": {
              "mode": "absolute",
              "steps": [
                {
                  "color": "green",
                  "value": null
                }
              ]
            },
            "unit": "decbytes"
          },
          "overrides": [
            {
              "matcher": {
                "id": "byName",
                "options": "Time"
              },
              "properties": [
                {
                  "id": "displayName",
                  "value": "Time"
                },
                {
                  "id": "unit",
                  "value": "time: MMMM D, YYYY LT"
                },
                {
                  "id": "custom.align",
                  "value": null
                }
              ]
            },
            {
              "matcher": {
                "id": "byName",
                "options": "Upload fritzbox"
              },
              "properties": [
                {
                  "id": "displayName",
                  "value": "Upload"
                }
              ]
            },
            {
              "matcher": {
                "id": "byName",
                "options": "Download fritzbox"
              },
              "properties": [
                {
                  "id": "displayName",
                  "value": "Download"
                }
              ]
            }
          ]
        },
        "gridPos": {
          "h": 8,
          "w": 12,
          "x": 0,
          "y": 27
        },
        "id": 27,
        "interval": "24h",
        "links": [],
        "options": {
          "frameIndex": 1,
          "showHeader": true
        },
        "pluginVersion": "7.4.1",
        "targets": [
          {
            "alias": "Download",
            "dsType": "influxdb",
            "measurement": "fritzbox_value",
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"${measurement}\" and r[\"_field\"] == \"totalbytessent\")\n  |> difference(nonNegative: true, columns: [\"_value\"])\n  |> fill(column: \"_value\", usePrevious: true)\n  |> filter(fn: (r) => r._value < 45000000)\n  |> cumulativeSum(columns: [\"_value\"])\n  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n  |> difference(nonNegative: true, columns: [\"_value\"])\n  |> map(fn: (r) => ({ r with _field: \"Upload\" }))\n  |> yield(name: \"last\")",
            "rawQuery": true,
            "refId": "A",
            "resultFormat": "time_series"
          },
          {
            "alias": "Upload",
            "dsType": "influxdb",
            "measurement": "fritzbox_value",
            "orderByTime": "ASC",
            "policy": "default",
            "query": "from(bucket: \"${bucket}\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) => r[\"_measurement\"] == \"${measurement}\" and r[\"_field\"] == \"totalbytesreceived\")\n  |> difference(nonNegative: true, columns: [\"_value\"])\n  |> fill(column: \"_value\", usePrevious: true)\n  |> filter(fn: (r) => r._value < 150000000)\n  |> cumulativeSum(columns: [\"_value\"])\n  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)\n  |> difference(nonNegative: true, columns: [\"_value\"])\n  |> map(fn: (r) => ({ r with _field: \"Download\" }))\n  |> yield(name: \"last\")",
            "rawQuery": true,
            "refId": "B",
            "resultFormat": "time_series"
          }
        ],
        "timeFrom": "7d",
        "timeShift": null,
        "title": "Daily Traffic",
        "transformations": [
          {
            "id": "seriesToColumns",
            "options": {}
          }
        ],
        "type": "table"
      }
    ],
    "refresh": "10s",
    "schemaVersion": 27,
    "style": "dark",
    "tags": [],
    "templating": {
      "list": [
        {
          "description": "Measurement name for the fritzflux data",
          "error": null,
          "hide": 2,
          "label": "InfluxDB measurement",
          "name": "measurement",
          "query": "${VAR_MEASUREMENT}",
          "skipUrlSync": false,
          "type": "constant",
          "current": {
            "value": "${VAR_MEASUREMENT}",
            "text": "${VAR_MEASUREMENT}",
            "selected": false
          },
          "options": [
            {
              "value": "${VAR_MEASUREMENT}",
              "text": "${VAR_MEASUREMENT}",
              "selected": false
            }
          ]
        },
        {
          "description": "Bucket name for the fritzflux data",
          "error": null,
          "hide": 2,
          "label": "InfluxDB bucket",
          "name": "bucket",
          "query": "${VAR_BUCKET}",
          "skipUrlSync": false,
          "type": "constant",
          "current": {
            "value": "${VAR_BUCKET}",
            "text": "${VAR_BUCKET}",
            "selected": false
          },
          "options": [
            {
              "value": "${VAR_BUCKET}",
              "text": "${VAR_BUCKET}",
              "selected": false
            }
          ]
        },
        {
          "description": "This is used to filter out wrong values",
          "error": null,
          "hide": 2,
          "label": "Max Down Speed (Mbit)",
          "name": "down_max",
          "query": "${VAR_DOWN_MAX}",
          "skipUrlSync": false,
          "type": "constant",
          "current": {
            "value": "${VAR_DOWN_MAX}",
            "text": "${VAR_DOWN_MAX}",
            "selected": false
          },
          "options": [
            {
              "value": "${VAR_DOWN_MAX}",
              "text": "${VAR_DOWN_MAX}",
              "selected": false
            }
          ]
        },
        {
          "description": "This is used to filter out wrong values",
          "error": null,
          "hide": 2,
          "label": "Max Up Speed (Mbit)",
          "name": "up_max",
          "query": "${VAR_UP_MAX}",
          "skipUrlSync": false,
          "type": "constant",
          "current": {
            "value": "${VAR_UP_MAX}",
            "text": "${VAR_UP_MAX}",
            "selected": false
          },
          "options": [
            {
              "value": "${VAR_UP_MAX}",
              "text": "${VAR_UP_MAX}",
              "selected": false
            }
          ]
        },
        {
          "description": "Interval of FritzBox data written to InfluxDB",
          "error": null,
          "hide": 2,
          "label": "Data retrieval Interval",
          "name": "data_interval",
          "query": "${VAR_DATA_INTERVAL}",
          "skipUrlSync": false,
          "type": "constant",
          "current": {
            "value": "${VAR_DATA_INTERVAL}",
            "text": "${VAR_DATA_INTERVAL}",
            "selected": false
          },
          "options": [
            {
              "value": "${VAR_DATA_INTERVAL}",
              "text": "${VAR_DATA_INTERVAL}",
              "selected": false
            }
          ]
        }
      ]
    },
    "time": {
      "from": "now-24h",
      "to": "now"
    },
    "timepicker": {},
    "timezone": "browser",
    "title": "FRITZ!Box Router Status",
    "uid": "FritzFlux",
    "version": 1
  }

@TheLux83
Copy link
Author

This looks really good!
The only thing I see is that the daily traffic only shows today and no other day:
grafik

The rest looks good.
And if I didn't said it before: Awesome work! I would never have gotten the dashboard running like that in that small time. Not to mention the influxDBv2 integration!

@bb-Ricardo
Copy link
Owner

since when are you collecting data? It will grow over time. I didn't get the query to report past "half" days.

@TheLux83
Copy link
Author

I'm collecting since 15.02.

@bb-Ricardo
Copy link
Owner

mmhh. I will have a look.

bb-Ricardo added a commit that referenced this issue Feb 17, 2021
@bb-Ricardo bb-Ricardo added this to the 0.4 milestone Feb 24, 2021
@bb-Ricardo
Copy link
Owner

bb-Ricardo commented Feb 24, 2021

I'm collecting since 15.02.

I tried but failed to display the data properly.

influxdata/flux#2203

This issue describes it quite right and I was unsuccessful to get the daily data right.

I should add a comment to the panel to not confuse the user.

@gehwissenlos
Copy link

Hello,

is the version with InfluxDB 2.0/2.1 support "production ready" or is this still under heavy development. And does this work with influxdb_client 1.26 or do I really need the version 1.14?

Thanks
Manuel

@bb-Ricardo
Copy link
Owner

Hi, haven't looked into it since really. I guess I should try again.

The issue was that the values are off for the daily usage

@ekoschmi
Copy link

ekoschmi commented Mar 19, 2022

Hey guys,
@bb-Ricardo i just want to let u know that u can enable influxql on influxdb2: https://docs.influxdata.com/influxdb/v2.1/query-data/influxql/

So, it would be pretty cool if fritzinfluxdb could support influxdb2, for people like me who are using it for other things too, then the grafana dashboard wouldn't change if ur enabling influxql. Just change/create the datasource adding a custom header with Authorization : Token {API_TOKEN} and there u go: https://docs.influxdata.com/influxdb/v2.1/query-data/execute-queries/influx-api/
image

image
image
image

love the project! ❤

@bb-Ricardo
Copy link
Owner

Hey,

Thank you for this input.

This looks great. There is already a branch with influx2 support. Maybe you can check this out and give it a go.

This would also maintaining the dashboard a lot easier.

Hope I find some time to test and integrate it the next few days. Then finally we can support Influxdb 2 fully.

@bb-Ricardo
Copy link
Owner

Thank you. Got my test setup running now. Need to wait two days and see if the issue with the daily data (#18 (comment)) is still there.

@bb-Ricardo
Copy link
Owner

I checked the data and it looks perfect. I get the same data via InfluxQL from a InfluxDB 2 and a InfluxDB 1.

I updated the dashboard as well. Needs a Grafana 8.4. Can you give it a try? https://github.com/karrot-dev/fritzinfluxdb/blob/add-influx2.0-support/grafana_dashboard_fritzbox.json

Thank you

@ronaldn1969
Copy link

I checked the data and it looks perfect. I get the same data via InfluxQL from a InfluxDB 2 and a InfluxDB 1.

I updated the dashboard as well. Needs a Grafana 8.4. Can you give it a try? https://github.com/karrot-dev/fritzinfluxdb/blob/add-influx2.0-support/grafana_dashboard_fritzbox.json

Thank you

Hi Ricardo

Whant to give a try. But when I try to clone the influx2.0 branch, I get the message
fatal: Repository... nicht gefunden...

Which URL I have to use...

I tried:
https://github.com/karrot-dev/fritzinfluxdb/tree/add-influx2.0-support
and
https://github.com/karrot-dev/fritzinfluxdb/blob/add-influx2.0-support/

Kind Regards
Ronald

@T0biii
Copy link

T0biii commented Mar 24, 2022

@ronaldn1969 try somethink like this

git clone https://github.com/karrot-dev/fritzinfluxdb/
git checkout add-influx2.0-support

@ronaldn1969
Copy link

@bb-Ricardo @ekoschmi

Ups... It looks like, that only the "Lua" values find the way inside the bucket... Or did I miss something?

image

@bb-Ricardo
Copy link
Owner

bb-Ricardo commented Apr 1, 2022

Hi, well, in my last commit I forgot to activate the TR069 handler. 😀
Just try a git pull and start it again, then you should see loads more.

@bb-Ricardo
Copy link
Owner

Hey @ronaldn1969,

Now if you pull the code again you should get your NewDownstreamPower : power_downstream NewUpstreamPower : power_upstream metrics again.

@ronaldn1969
Copy link

@bb-Ricardo thanks a lot... yes... now I get all the data...

But actually, I can't connect with Grafana onto the database... Running as version 2... think, I need more time to explore the v2 environment. Maybe because influxDB an Grafana are running in separat container.

Will try as version 1, than I can use my old influx-grafana container...

nice weekend

@bb-Ricardo
Copy link
Owner

thank you.

yes the Grafana 2 Setup is a bit different in order to use it with the same dashboard. Thank you for testing as well

@ronaldn1969
Copy link

@bb-Ricardo my old dashboard is running well with your new services in my InfluxDB v1.8 and Grafana 8.4.4 environment. only have to rename 4 values. now I can add the new lua values like cpu, ram and energy...

When I find a bit more time, I will give v2 a try again. collecting was not the problem only the connection between Influx and Grafana...

@bb-Ricardo
Copy link
Owner

The Auth header part where you have to add the token is a bit tricky.

We need to write a propper documentation to help users connecting to influxdb 2 via grafana. But @ekoschmi describtion above is quite complete on this matter.

You had to rename values? At least the TR069 should all be the same.

@ronaldn1969
Copy link

@bb-Ricardo yes... I don't remember, but my totalbytesreceived and totalbytessend have a 64 at the end... Found out that I have both 32 an 64 bit in my old ini. No problem...

If I get it running, I will let you know...

BTW, you made an awesome job...

@ronaldn1969
Copy link

Hey @ronaldn1969,

Now if you pull the code again you should get your NewDownstreamPower : power_downstream NewUpstreamPower : power_upstream metrics again.

@bb-Ricardo ... Hi Ricardo, I saw that the value are in the service list, but not in my database... I'm using the new version an Influx v1.

image

on the other hand I found out, that the DB structure is different from your old way of collecting data...

old version:
image

new version:
image

Cheers
Ronald

@bb-Ricardo
Copy link
Owner

Hi, yes the timestamping has changed. Now single services can have different intervals. So the measurement gets the timestamp at when it actually was taken. This is resulting in different timestamp.

Except for log entries. They get timestamped with their log time entry.

This also gives me some trouble with Grafana and how it presents data but it should be possible to solve. Otherwise I have to come up with a fix for that.

Btw. Just testing the logs panel in Grafana and it is working beautifully.

@ronaldn1969
Copy link

by now I saw no problems in Grafana with the graphs. everything looks fine.

Where, with which data, did you have trouble in Grafana...

I found out, why power_down- and upstream didn't find the way to my database. It's not included in services_tr069.py also I cloned the repository before I build the container... So, I have to do it again...

@ronaldn1969
Copy link

@bb-Ricardo @ekoschmi

After some trouble (I missed the "Token" in front of the token) to connect Grafana via InfluxQL to my database its now running. But unfortunately I'm not able to use my old dashboard. Everything is black...

image

and when I edit a panel... datasource is set to -- Grafana -- even, my old datasource "InfluxDB Home" exist.

image

It looks like, that I have to renew all panels. After I set the datasource to "InfluxDB Home" and copy & paste the select from the old dashboard, the data will displayed...

image

Then I found out, that the uid is different. after I exchanged all in the dashboard json, it looking good, but still some panels to modify

     "datasource": {
        "type": "influxdb",
        "uid": "yIntkjy7k"

image

So thanks a lot for your great work... Now running v2 with InfluxQL and can update my dashboard with the new Lua values and can upgrade Influx when a new version is out...

@bb-Ricardo
Copy link
Owner

Hi @ronaldn1969 @ekoschmi,

Anyone willing to test the new/update dashboards?

-> https://github.com/karrot-dev/fritzinfluxdb/tree/rewrite-adding-async/grafana

dashboards

@ronaldn1969
Copy link

@bb-Ricardo of course I will... ;)

Have some trouble with the old fritzbox info table. Didn't get the data. And have to move it on my pi4, because it looks like that my pi3 is not fast enough or have lack of ram... Some times fritzinfluxdb is not possible to write into influxdb and than it displayed at timeout in the log...

On the other side I try to convert my dashboard to Flux. But it looks like, that this is not a short way...

@bb-Ricardo
Copy link
Owner

I had trouble with Flux language. It was not consistent in a few places, breaking the metrics.

Have a look here: https://github.com/karrot-dev/fritzinfluxdb/blob/6b5b41944d02123578fa1f88b315bca60bf9dc69/grafana_dashboard_fritzbox_influxdb2.json

@ronaldn1969
Copy link

@bb-Ricardo after my first coffee, I imported your both dashboards... what should I say... INCREDIBLE...!!

running without any problems and display all. If you don't mind, I will snoop around and copy & paste some of the panels to my dashboard. Definitely I will use the separation with drop-down.

later I will take a look on your Flux dashboard. Maybe it's a task, when I get retired... :o)

@bb-Ricardo
Copy link
Owner

thank you.

There are still missing metrics:

  • WLAN associations, channel, name, ...
  • VPN Users
  • Home automation
  • DECT handsets

@ekoschmi
Copy link

ekoschmi commented Apr 6, 2022

Hey @bb-Ricardo

I just pulled the repo and now getting following errors:
2022-04-06 14:18:34,225 - INFO: Starting main loop
2022-04-06 14:18:56,209 - ERROR: Unable to perform request to 'http://192.168.1.10/data.lua': HTTPConnectionPool(host='192.168.1.10', port=80): Read timed out. (read timeout=5)
2022-04-06 14:18:56,209 - ERROR: Unable to request FritzBox Lua service 'Passive network hosts'
2022-04-06 14:19:07,405 - ERROR: Unable to perform request to 'http://192.168.1.10/data.lua': HTTPConnectionPool(host='192.168.1.10', port=80): Read timed out. (read timeout=5)
2022-04-06 14:19:07,405 - ERROR: Unable to request FritzBox Lua service 'Passive network hosts'
2022-04-06 14:19:14,443 - ERROR: Unable to perform request to 'http://192.168.1.10/data.lua': HTTPConnectionPool(host='192.168.1.10', port=80): Read timed out. (read timeout=5)
2022-04-06 14:19:14,444 - ERROR: Unable to request FritzBox Lua service 'Passive network hosts'
2022-04-06 14:19:24,221 - ERROR: Unable to perform request to 'http://192.168.1.10/data.lua': HTTPConnectionPool(host='192.168.1.10', port=80): Read timed out. (read timeout=5)
2022-04-06 14:19:24,221 - ERROR: Unable to request FritzBox Lua service 'Passive network hosts'
2022-04-06 14:19:31,105 - ERROR: Unable to perform request to 'http://192.168.1.10/data.lua': HTTPConnectionPool(host='192.168.1.10', port=80): Read timed out. (read timeout=5)
2022-04-06 14:19:31,106 - ERROR: Unable to request FritzBox Lua service 'Passive network hosts'
2022-04-06 14:19:39,966 - ERROR: Unable to perform request to 'http://192.168.1.10/data.lua': HTTPConnectionPool(host='192.168.1.10', port=80): Read timed out. (read timeout=5)
2022-04-06 14:19:39,966 - ERROR: Unable to request FritzBox Lua service 'Passive network hosts'
2022-04-06 14:19:52,813 - ERROR: Unable to perform request to 'http://192.168.1.10/data.lua': HTTPConnectionPool(host='192.168.1.10', port=80): Read timed out. (read timeout=5)
2022-04-06 14:19:52,813 - ERROR: Unable to request FritzBox Lua service 'Passive network hosts'
2022-04-06 14:20:05,632 - ERROR: Unable to perform request to 'http://192.168.1.10/data.lua': HTTPConnectionPool(host='192.168.1.10', port=80): Read timed out. (read timeout=5)
2022-04-06 14:20:05,633 - ERROR: Unable to request FritzBox Lua service 'Passive network hosts'

I also get data very infrequently and not all values...

I looked up logs on the fritzbox which saying something about the session is broken?!

image

Thank you!

@bb-Ricardo
Copy link
Owner

mmmmh, the ungültige Sitzungskennung should not happen. Does a -v reveal more?

@ekoschmi
Copy link

ekoschmi commented Apr 6, 2022

Hey, thanks for that nice tip with the verbose flag: I think my Fritzbox needed a restart ^^

now it works fine and there are no more "ungültige Sitzungskennung", although it still cant get the 'Passive network hosts'

@bb-Ricardo
Copy link
Owner

Do you get a timeout? Do you have a lot of passive hosts? Maybe try to increase thw timeout value to 10 seconds.

@ekoschmi
Copy link

ekoschmi commented Apr 6, 2022

You are a god!!! Now it works, thank you! There are 35 passive hosts, i increased the timeout to 20 seconds. Maybe 5 seconds are not enough.

Thank you!

@bb-Ricardo
Copy link
Owner

Great. Please also try out the two Dashboards and see if they work for you.

Thank you.

@bb-Ricardo
Copy link
Owner

if anyone is interested in testing the new version, comments are highly appreciated: https://github.com/karrot-dev/fritzinfluxdb/tree/rewrite-adding-async

This branch contains a complete rewrite including two new dashboards.

@bb-Ricardo
Copy link
Owner

version 1.0.0 has been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants