{
  "__inputs": [
    {
      "name": "DS_NFSEN",
      "label": "nfsen",
      "description": "",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "4.1.1"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "influxdb",
      "name": "InfluxDB",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    }
  ],
  "annotations": {
    "list": []
  },
  "editable": true,
  "gnetId": null,
  "graphTooltip": 0,
  "hideControls": false,
  "id": null,
  "links": [
    {
      "icon": "external link",
      "includeVars": true,
      "keepTime": true,
      "tags": [],
      "targetBlank": true,
      "title": "NFSen",
      "tooltip": "",
      "type": "link",
      "url": "http://localhost/nfsen/nfsen.php"
    },
    {
      "icon": "external link",
      "includeVars": true,
      "keepTime": true,
      "tags": [],
      "targetBlank": true,
      "title": "g2nfsen",
      "type": "link",
      "url": "http://localhost/nfsen/grafana2nfsen.php"
    }
  ],
  "refresh": false,
  "rows": [
    {
      "collapse": false,
      "height": "250px",
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_NFSEN}",
          "editable": true,
          "error": false,
          "fill": 4,
          "grid": {},
          "id": 1,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": false,
            "max": true,
            "min": true,
            "show": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 12,
          "stack": true,
          "steppedLine": false,
          "targets": [
            {
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "channel"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "profile"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "nfsen_stats",
              "policy": "default",
              "query": "SELECT mean(\"$counter\")/300 FROM \"nfsen_stats\" WHERE \"profile\" =~ /^$profile$/ AND \"channel\" =~ /^$channel$/ AND \"profilegroup\" =~ /^$group$/ AND $timeFilter GROUP BY time($interval), \"channel\", \"profile\" fill(null)",
              "rawQuery": true,
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "$counter"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "mean"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "profile",
                  "operator": "=~",
                  "value": "/^$profile$/"
                },
                {
                  "condition": "AND",
                  "key": "channel",
                  "operator": "=~",
                  "value": "/^$channel$/"
                },
                {
                  "condition": "AND",
                  "key": "profilegroup",
                  "operator": "=~",
                  "value": "/^$group$/"
                }
              ]
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "RATE $counter on channel $channel profile $profile",
          "tooltip": {
            "msResolution": true,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "bps",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        },
        {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_NFSEN}",
          "editable": true,
          "error": false,
          "fill": 4,
          "grid": {},
          "id": 2,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": false,
            "max": true,
            "min": true,
            "show": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 12,
          "stack": true,
          "steppedLine": false,
          "targets": [
            {
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "$interval"
                  ],
                  "type": "time"
                },
                {
                  "params": [
                    "channel"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "profile"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "null"
                  ],
                  "type": "fill"
                }
              ],
              "measurement": "nfsen_stats",
              "policy": "default",
              "query": "SELECT sum(\"$counter\") FROM \"nfsen_stats\" WHERE \"profile\" =~ /^$profile$/ AND \"channel\" =~ /^$channel$/ AND \"profilegroup\" =~ /^$group$/ AND $timeFilter GROUP BY time($interval), \"channel\", \"profile\" fill(null)",
              "rawQuery": true,
              "refId": "A",
              "resultFormat": "time_series",
              "select": [
                [
                  {
                    "params": [
                      "$counter"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "sum"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "profile",
                  "operator": "=~",
                  "value": "/^$profile$/"
                },
                {
                  "condition": "AND",
                  "key": "channel",
                  "operator": "=~",
                  "value": "/^$channel$/"
                },
                {
                  "condition": "AND",
                  "key": "profilegroup",
                  "operator": "=~",
                  "value": "/^$group$/"
                }
              ]
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "SUM $counter on channel $channel profile $profile",
          "tooltip": {
            "msResolution": true,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "bits",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "Row",
      "titleSize": "h6"
    },
    {
      "collapse": false,
      "height": "250px",
      "panels": [
        {
          "columns": [],
          "datasource": "${DS_NFSEN}",
          "editable": true,
          "error": false,
          "fontSize": "100%",
          "id": 3,
          "interval": ">5m",
          "links": [],
          "pageSize": null,
          "scroll": true,
          "showHeader": true,
          "sort": {
            "col": 0,
            "desc": true
          },
          "span": 12,
          "styles": [
            {
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "pattern": "Time",
              "type": "hidden"
            },
            {
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "decimals": 2,
              "pattern": "/.*/",
              "thresholds": [],
              "type": "number",
              "unit": "bytes"
            }
          ],
          "targets": [
            {
              "alias": "",
              "dsType": "influxdb",
              "groupBy": [
                {
                  "params": [
                    "profile"
                  ],
                  "type": "tag"
                },
                {
                  "params": [
                    "channel"
                  ],
                  "type": "tag"
                }
              ],
              "measurement": "nfsen_stats",
              "policy": "default",
              "query": "SELECT mean(\"$counter\"), max(\"$counter\") FROM \"nfsen_stats\" WHERE  \"profile\" =~ /^$profile$/ AND \"channel\" =~ /^$channel$/ AND \"profilegroup\" =~ /^$group$/ AND $timeFilter GROUP BY time($interval) fill(null)",
              "rawQuery": false,
              "refId": "A",
              "resultFormat": "table",
              "select": [
                [
                  {
                    "params": [
                      "traffic"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "sum"
                  },
                  {
                    "params": [
                      "traffic"
                    ],
                    "type": "alias"
                  }
                ],
                [
                  {
                    "params": [
                      "traffic_icmp"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "sum"
                  },
                  {
                    "params": [
                      "icmp"
                    ],
                    "type": "alias"
                  }
                ],
                [
                  {
                    "params": [
                      "traffic_tcp"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "sum"
                  },
                  {
                    "params": [
                      "tcp"
                    ],
                    "type": "alias"
                  }
                ],
                [
                  {
                    "params": [
                      "traffic_udp"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "sum"
                  },
                  {
                    "params": [
                      "udp"
                    ],
                    "type": "alias"
                  }
                ],
                [
                  {
                    "params": [
                      "traffic_other"
                    ],
                    "type": "field"
                  },
                  {
                    "params": [],
                    "type": "sum"
                  },
                  {
                    "params": [
                      "other"
                    ],
                    "type": "alias"
                  }
                ]
              ],
              "tags": [
                {
                  "key": "profile",
                  "operator": "=~",
                  "value": "/^$profile$/"
                },
                {
                  "condition": "AND",
                  "key": "channel",
                  "operator": "=~",
                  "value": "/^$channel$/"
                }
              ]
            }
          ],
          "title": "$counter on channel $channel profile $profile",
          "transform": "table",
          "type": "table"
        }
      ],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": false,
      "title": "New row",
      "titleSize": "h6"
    }
  ],
  "schemaVersion": 14,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": ".*",
        "current": {},
        "datasource": "${DS_NFSEN}",
        "hide": 0,
        "includeAll": true,
        "label": "Group",
        "multi": true,
        "name": "group",
        "options": [],
        "query": "SHOW TAG VALUES FROM \"nfsen_stats\" WITH KEY = \"profilegroup\"",
        "refresh": 1,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": ".*",
        "current": {},
        "datasource": "${DS_NFSEN}",
        "hide": 0,
        "includeAll": true,
        "label": "Profile",
        "multi": true,
        "name": "profile",
        "options": [],
        "query": "SHOW TAG VALUES FROM \"nfsen_stats\" WITH KEY = \"profile\"",
        "refresh": 1,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_NFSEN}",
        "hide": 0,
        "includeAll": true,
        "label": "Channel",
        "multi": true,
        "name": "channel",
        "options": [],
        "query": "SHOW TAG VALUES FROM \"nfsen_stats\" WITH KEY = \"channel\" WHERE profile =~ /$profile/",
        "refresh": 1,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_NFSEN}",
        "hide": 0,
        "includeAll": false,
        "label": "Counter",
        "multi": false,
        "name": "counter",
        "options": [],
        "query": "SHOW FIELD KEYS FROM \"nfsen_stats\"",
        "refresh": 1,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-1h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "browser",
  "title": "Nfsen Stats",
  "version": 22
}
