diff --git a/README.md b/README.md index 19feb8a..7b8cfb3 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ The module is composed by the following containers: - [loki](#loki): log storage, it stores logs from promtail - [grafana](#grafana): metrics visualization, it visualizes metrics from prometheus and logs from loki - [webssh](#webssh): web-based ssh client +- [timescale](#timescale): time-series database for storing metrics ## Install @@ -42,11 +43,12 @@ Launch `configure-module`, by setting the following parameters: - `api_user`: controller admin user - `api_password`: controller admin password, change it after first login - `loki_retention`: Loki retention period in days (default: ``180`` days) -- `promtail_retention`: Promtail retention period in days (default: ``15`` days) +- `prometheus_retention`: Promtail and Timescale retention period in days (default: 15 days) +- `maxmind_license`: [MaxMind](https://www.maxmind.com/) license key to download the GEO IP database, the database is loaded every time the API server is started Example: - api-cli run module/nethsecurity-controller1/configure-module --data '{"host": "mycontroller.nethsecurity.org", "lets_encrypt": false, "ovpn_network": "172.19.64.0", "ovpn_netmask": "255.255.255.0", "ovpn_cn": "nethsec", "api_user": "admin", "api_password": "password", "loki_retention": 180, "prometheus_retention": 15}' + api-cli run module/nethsecurity-controller1/configure-module --data '{"host": "mycontroller.nethsecurity.org", "lets_encrypt": false, "ovpn_network": "172.19.64.0", "ovpn_netmask": "255.255.255.0", "ovpn_cn": "nethsec", "api_user": "admin", "api_password": "password", "loki_retention": 180, "prometheus_retention": 15, ""maxmind_license": "xxx"}' The above command will: - start and configure the nethsecurity-controller instance @@ -160,6 +162,11 @@ It has also some pre-configured dashboards: - nethsecurity.json: a dashboard with the most important metrics from the connected machines, like CPU, memory, disk, network, and system load - logs.json: a dashboard where you can visualize the logs from all the connected machines and filter them by hostname, application, and priority - loki.json: a dashboard with the most important metrics from Loki, like the number of logs ingested, the number of logs dropped, and the status of queriers +- network_traffic.json: this dashboard uses data from Timescale database and shows the global network traffic by unit +- network_traffic_by_client.json: this dashboard uses data from Timescale database and shows the network traffic by unit and client (a client is a machine connected to the unit local network) +- network_traffic_by_host.json: this dashboard uses data from Timescale database and shows the network traffic by unit and host (a host is a machien on the internet) +- malware.json: this dashboard uses data from Timescale database and shows the malware blocked by the unit +- vpn.json: this dashboard uses data from Timescale database and shows the VPN connections Grafana is accessible at `https:///grafana/`, default credentials are the same set for the controller. You should change them on the first login. @@ -169,6 +176,16 @@ Grafana is accessible at `https:///grafana/`, default credentia Access to WebSSH is protected using a random generated URL, you can find it inside the module configuration file at `/home/nethsecurity-controller1/.config/state/config.json`. +### Timescale + +[Timescale](https://docs.timescale.com/latest/main) is a time-series database for storing metrics. It's configured via environment variables and the configuration is available at `/home/nethsecurity-controller1/.config/state/db.env`. + +You can connect to the database with the following command: +``` +runagent -m nethsecurity-controller1 +source db.env; podman exec -it timescale psql -U "${POSTGRES_USER}" -p "${POSTGRES_PORT}" +``` + ## Uninstall To uninstall the instance: diff --git a/build-images.sh b/build-images.sh index 48507e8..d70a941 100755 --- a/build-images.sh +++ b/build-images.sh @@ -9,12 +9,13 @@ images=() repobase="${REPOBASE:-ghcr.io/nethserver}" # Configure the image name reponame="nethsecurity-controller" -controller_version="1.0.1" +controller_version="1.1.0" promtail_version=2.7.1 loki_version=2.9.4 prometheus_version=2.50.1 -grafana_version=10.3.3 +grafana_version=11.2.0 webssh_version=1.6.2 +timescale_version="2.16.1-pg16" # Create a new empty container for webssh echo "Build webssh container" # from https://github.com/huashengdun/webssh @@ -74,8 +75,8 @@ buildah add "${container}" ui/dist /ui # Setup the entrypoint, ask to reserve one TCP port with the label and set a rootless container buildah config --entrypoint=/ \ --label="org.nethserver.authorizations=traefik@any:routeadm node:tunadm" \ - --label="org.nethserver.tcp-ports-demand=10" \ - --label="org.nethserver.images=ghcr.io/nethserver/nethsecurity-vpn:$controller_version ghcr.io/nethserver/nethsecurity-api:$controller_version ghcr.io/nethserver/nethsecurity-ui:$controller_version ghcr.io/nethserver/nethsecurity-proxy:$controller_version docker.io/grafana/promtail:$promtail_version docker.io/grafana/loki:$loki_version docker.io/prom/prometheus:v$prometheus_version docker.io/grafana/grafana:$grafana_version ghcr.io/nethserver/webssh:${IMAGETAG:-latest}" \ + --label="org.nethserver.tcp-ports-demand=11" \ + --label="org.nethserver.images=ghcr.io/nethserver/nethsecurity-vpn:$controller_version ghcr.io/nethserver/nethsecurity-api:$controller_version ghcr.io/nethserver/nethsecurity-ui:$controller_version ghcr.io/nethserver/nethsecurity-proxy:$controller_version docker.io/grafana/promtail:$promtail_version docker.io/grafana/loki:$loki_version docker.io/prom/prometheus:v$prometheus_version docker.io/grafana/grafana:$grafana_version ghcr.io/nethserver/webssh:${IMAGETAG:-latest} docker.io/timescale/timescaledb:$timescale_version" \ "${container}" # Commit the image buildah commit "${container}" "${repobase}/${reponame}" diff --git a/imageroot/actions/configure-module/20configure b/imageroot/actions/configure-module/20configure index 8774077..ddafec6 100755 --- a/imageroot/actions/configure-module/20configure +++ b/imageroot/actions/configure-module/20configure @@ -103,6 +103,7 @@ with open('config.json', 'w') as cfp: # Load subscription info rdb = agent.redis_connect(privileged=False) subscription = rdb.hgetall('cluster/subscription') +metrics_retention_days = request.get('prometheus_retention', '15') with open('config.env', 'w') as env: env.write(f'ADMIN_USER={request["api_user"]}\n') @@ -119,6 +120,9 @@ with open('config.env', 'w') as env: env.write(f'VALID_SUBSCRIPTION=true\n') else: env.write(f'VALID_SUBSCRIPTION=false\n') + if 'maxmind_license' in request: + env.write(f'MAXMIND_LICENSE={request["maxmind_license"]}\n') + env.write(f'RETENTION_DAYS={metrics_retention_days}\n') server_address = request["ovpn_network"].removesuffix('.0') + '.1' with open('promtail.env', 'w') as promtail: @@ -140,11 +144,12 @@ with open('grafana.env', 'w') as gfp: gfp.write("GF_SERVER_HTTP_ADDR=127.0.0.1\n") gfp.write(f'GF_SECURITY_ADMIN_USER={request["api_user"]}\n') gfp.write(f'GF_SECURITY_ADMIN_PASSWORD={request.get("api_password", config["api_password"])}\n') + gfp.write('GF_DATE_FORMATS_USE_BROWSER_LOCALE=true\n') with open('prometheus.env', 'w') as pfp: pfp.write(f"PROMETHEUS_PORT={ports[7]}\n") pfp.write(f"PROMETHEUS_PATH={config['prometheus_path']}\n") - pfp.write(f"PROMETHEUS_RETENTION={request.get('prometheus_retention', '15')}d\n") + pfp.write(f"PROMETHEUS_RETENTION={metrics_retention_days}d\n") with open('prometheus.yml', 'w', encoding='utf-8') as fp: fp.write("global:\n") @@ -159,6 +164,7 @@ with open('prometheus.yml', 'w', encoding='utf-8') as fp: fp.write(f' - 127.0.0.1:{ports[5]}\n') # Grafana configuration +db = agent.read_envfile('db.env') with open('grafana.yml', 'w') as fp: fp.write("apiVersion: 1\n") fp.write("datasources:\n") @@ -174,6 +180,23 @@ with open('grafana.yml', 'w') as fp: fp.write(' access: proxy\n') fp.write(f' url: http://127.0.0.1:{ports[5]}\n') + fp.write(' - name: Local Timescale\n') + fp.write(' type: postgres\n') + fp.write(' uid: timescale\n') + fp.write(f' url: 127.0.0.1:{db.get("POSTGRES_PORT")}\n') + fp.write(f' user: grafana\n') + fp.write(' secureJsonData:\n') + fp.write(f' password: {db.get("GRAFANA_POSTGRES_PASSWORD")}\n') + fp.write(' jsonData:\n') + fp.write(' database: report\n') + fp.write(' sslmode: disable\n') + fp.write(' maxOpenConns: 100\n') + fp.write(' maxIdleConns: 100\n') + fp.write(' maxIdleConnsAuto: true\n') + fp.write(' connMaxLifetime: 14400\n') + fp.write(' postgresVersion: 1500\n') + fp.write(' timescaledb: true\n') + network = agent.read_envfile('network.env') tun = network.get('OVPN_TUN') bits = sum(bin(int(x)).count('1') for x in request["ovpn_netmask"].split('.')) diff --git a/imageroot/actions/configure-module/validate-input.json b/imageroot/actions/configure-module/validate-input.json index ca55a2c..2aabc86 100644 --- a/imageroot/actions/configure-module/validate-input.json +++ b/imageroot/actions/configure-module/validate-input.json @@ -13,7 +13,8 @@ "ovpn_netmask": "255.255.0.0", "ovpn_cn": "nethsec", "loki_retention": 180, - "prometheus_retention": 15 + "prometheus_retention": 15, + "maxmind_license": "1234567890" } ], "type": "object", @@ -63,6 +64,11 @@ "type": "integer", "description": "Retention policy for Prometehus metrics, default is 15 days", "minimum": 1 + }, + "maxmind_license": { + "type": "string", + "description": "MaxMind API key, required for GeoIP database updates", + "minLength": 1 } } } diff --git a/imageroot/actions/create-module/20initialize b/imageroot/actions/create-module/20initialize index 6e40e1c..976be46 100755 --- a/imageroot/actions/create-module/20initialize +++ b/imageroot/actions/create-module/20initialize @@ -19,11 +19,14 @@ promtail_port=$(($start+4)) # port 8 is reserved for prometheus # port 9 is reserved for grafana webssh_port=$(($start+9)) +db_port=$(($start+10)) num=$(echo $MODULE_ID | sed 's/nethsecurity\-controller//') jwt_secret=$(uuidgen | sha256sum | awk '{print $1}') reg_secret=$(uuidgen | sha256sum | awk '{print $1}') +db_secret=$(uuidgen | sha256sum | awk '{print $1}') +grafana_postgres_password=$(uuidgen | sha256sum | awk '{print $1}') cat << EOF > network.env OVPN_UDP_PORT=$ovpn_udp_port @@ -43,4 +46,13 @@ SECRET_JWT=$jwt_secret REGISTRATION_TOKEN=$reg_secret EOF +cat << EOF > db.env +POSTGRES_USER=report +POSTGRES_PORT=$db_port +POSTGRES_PASSWORD=$db_secret +GRAFANA_POSTGRES_PASSWORD=$grafana_postgres_password +REPORT_DB_URI=postgres://report:$db_secret@127.0.0.1:$db_port/report +TS_TUNE_MAX_BG_WORKERS=100 +EOF + mkdir -p clients diff --git a/imageroot/actions/restore-module/30restore_database b/imageroot/actions/restore-module/30restore_database new file mode 100755 index 0000000..a6aa9aa --- /dev/null +++ b/imageroot/actions/restore-module/30restore_database @@ -0,0 +1,12 @@ +#!/bin/sh + +# Load database credentials +. ./db.env + +# Wait for database to be ready pooling every 5 seconds +until podman exec timescale pg_isready -U "${POSTGRES_USER}" -p "${POSTGRES_PORT}" -d "${POSTGRES_DB}"; do + sleep 5 +done + +# Dump the DB from timescale +podman exec -i timescale psql -U "${POSTGRES_USER}" -p "${POSTGRES_PORT}" < backup.sql diff --git a/imageroot/bin/module-cleanup-state b/imageroot/bin/module-cleanup-state new file mode 100755 index 0000000..c0ffb39 --- /dev/null +++ b/imageroot/bin/module-cleanup-state @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +set -e + +rm -f backup.sql diff --git a/imageroot/bin/module-dump-state b/imageroot/bin/module-dump-state new file mode 100755 index 0000000..682f68a --- /dev/null +++ b/imageroot/bin/module-dump-state @@ -0,0 +1,9 @@ +#!/usr/bin/env sh + +set -e + +# Load database credentials +. ./db.env + +# Dump the DB from timescale +podman exec -i timescale pg_dump -U "${POSTGRES_USER}" -p "${POSTGRES_PORT}" > timescale.sql diff --git a/imageroot/etc/dashboards/connectivity.json b/imageroot/etc/dashboards/connectivity.json new file mode 100644 index 0000000..683c139 --- /dev/null +++ b/imageroot/etc/dashboards/connectivity.json @@ -0,0 +1,902 @@ +{ + "__inputs": [ + { + "name": "DS_LOCAL_TIMESCALE", + "label": "Local Timescale", + "description": "", + "type": "datasource", + "pluginId": "grafana-postgresql-datasource", + "pluginName": "PostgreSQL" + }, + { + "name": "DS_LOCAL_PROMETHUS", + "label": "Local Promethus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.2.0" + }, + { + "type": "datasource", + "id": "grafana-postgresql-datasource", + "name": "PostgreSQL", + "version": "1.0.0" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": false, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [ + { + "asDropdown": false, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "unit" + ], + "targetBlank": false, + "title": "New link", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], + "panels": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "mappings": [ + { + "options": { + "offline": { + "color": "dark-red", + "index": 0, + "text": "Offline" + }, + "online": { + "color": "dark-green", + "index": 1, + "text": "Online" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 11, + "x": 0, + "y": 0 + }, + "id": 3, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\n interface,\n device,\n status,\n created_at AS last_update_time\nFROM wan_config\nWHERE uuid = '$uuid'\nORDER BY interface\n", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "MultiWAN status", + "type": "table" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 13, + "x": 11, + "y": 0 + }, + "id": 4, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT \n time,\n wan,\n interface\nFROM mwan_events\nWHERE event = 'offline' AND uuid = '$uuid'\nORDER BY time DESC\nLIMIT 3;", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Last 3 downtime events", + "type": "table" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 6 + }, + "id": 1, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT bucket, count(*) as count FROM ca_mwan_events_hourly\nWHERE $__timeFilter(bucket) AND uuid = '$uuid'\nGROUP by bucket", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "MultiWAN events by time", + "type": "timeseries" + }, + { + "datasource": { + "default": false, + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "Kbits" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 15 + }, + "id": 5, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "repeat": "wan", + "repeatDirection": "h", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_LOCAL_PROMETHUS}" + }, + "editorMode": "code", + "expr": "netdata_net_net_kilobits_persec_average{unit=~'$uuid',chart='net.$wan'}", + "instant": false, + "legendFormat": "{{dimension}}", + "range": true, + "refId": "A" + } + ], + "title": "Interface $wan traffic", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "gridPos": { + "h": 3, + "w": 24, + "x": 0, + "y": 23 + }, + "id": 10, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "# Line quality\n\nPing sent to configured hosts, the traffic\nmay use any interface.", + "mode": "markdown" + }, + "pluginVersion": "11.2.0", + "type": "text" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_LOCAL_PROMETHUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 26 + }, + "id": 7, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_LOCAL_PROMETHUS}" + }, + "editorMode": "code", + "expr": "netdata_fping_latency_ms_average{unit=~'$uuid'}", + "instant": false, + "legendFormat": "{{dimension}}-{{family}}", + "range": true, + "refId": "A" + } + ], + "title": "Ping latency", + "type": "timeseries" + }, + { + "datasource": { + "default": false, + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 26 + }, + "id": 8, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_LOCAL_PROMETHUS}" + }, + "editorMode": "code", + "expr": "netdata_fping_packets_packets_average{unit=~'$uuid'}", + "instant": false, + "legendFormat": "{{dimension}}-{{family}}", + "range": true, + "refId": "A" + } + ], + "title": "Packets", + "type": "timeseries" + }, + { + "datasource": { + "default": false, + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 34 + }, + "id": 9, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_LOCAL_PROMETHUS}" + }, + "editorMode": "code", + "expr": "netdata_fping_quality_percentage_average{unit=~'$uuid'}", + "instant": false, + "legendFormat": "{{dimension}}-{{family}}", + "range": true, + "refId": "A" + } + ], + "title": "Quality", + "type": "timeseries" + } + ], + "refresh": "", + "schemaVersion": 39, + "tags": [ + "timescale", + "unit", + "monitoring" + ], + "templating": { + "list": [ + { + "current": {}, + "hide": 2, + "includeAll": false, + "label": "Local Timescale", + "multi": false, + "name": "DS_TIMESCALE", + "options": [], + "query": "grafana-postgresql-datasource", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "definition": "SELECT uuid AS __value, name AS __text FROM units", + "hide": 0, + "includeAll": false, + "label": "Unit", + "multi": false, + "name": "uuid", + "options": [], + "query": "SELECT uuid AS __value, name AS __text FROM units", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "hide": 2, + "includeAll": false, + "multi": false, + "name": "DS_PROMETHEUS", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "allValue": "*", + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "definition": "SELECT device AS __value, interface AS __text FROM wan_config WHERE uuid = '$uuid'", + "hide": 0, + "includeAll": true, + "label": "WAN interface", + "multi": false, + "name": "wan", + "options": [], + "query": "SELECT device AS __value, interface AS __text FROM wan_config WHERE uuid = '$uuid'", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "Connectivity", + "uid": "ady5vjxjqywowd", + "version": 37, + "weekStart": "" +} \ No newline at end of file diff --git a/imageroot/etc/dashboards/logs.json b/imageroot/etc/dashboards/logs.json index b9fd02e..f0904f3 100644 --- a/imageroot/etc/dashboards/logs.json +++ b/imageroot/etc/dashboards/logs.json @@ -1,4 +1,41 @@ { + "__inputs": [ + { + "name": "DS_LOCAL_LOKI", + "label": "Local Loki", + "description": "", + "type": "datasource", + "pluginId": "loki", + "pluginName": "Loki" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.2.0" + }, + { + "type": "panel", + "id": "logs", + "name": "Logs", + "version": "" + }, + { + "type": "datasource", + "id": "loki", + "name": "Loki", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], "annotations": { "list": [ { @@ -16,18 +53,33 @@ ] }, "description": "Loki dashboard with quick search and timeline.", - "editable": true, + "editable": false, "fiscalYearStartMonth": 0, "gnetId": 13186, "graphTooltip": 0, - "id": 3, - "links": [], + "id": null, + "links": [ + { + "asDropdown": false, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "logs" + ], + "targetBlank": false, + "title": "New link", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], "liveNow": false, "panels": [ { "datasource": { "type": "loki", - "uid": "loki" + "uid": "${DS_LOCAL_LOKI}" }, "fieldConfig": { "defaults": { @@ -41,6 +93,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "bars", "fillOpacity": 100, "gradientMode": "none", @@ -81,8 +134,7 @@ } ] }, - "unit": "short", - "unitScale": true + "unit": "short" }, "overrides": [] }, @@ -114,7 +166,7 @@ { "datasource": { "type": "loki", - "uid": "loki" + "uid": "${DS_LOCAL_LOKI}" }, "editorMode": "code", "expr": "sum(count_over_time({hostname=~\"$hostname\", application=~\"$application\", level=~\"$level\"} |~ \"$search\"[$__interval]))", @@ -129,7 +181,7 @@ { "datasource": { "type": "loki", - "uid": "loki" + "uid": "${DS_LOCAL_LOKI}" }, "gridPos": { "h": 25, @@ -153,7 +205,7 @@ { "datasource": { "type": "loki", - "uid": "loki" + "uid": "${DS_LOCAL_LOKI}" }, "editorMode": "code", "expr": "{hostname=~\"$hostname\", application=~\"$application\", level=~\"$level\"} |~ \"$search\"", @@ -168,19 +220,17 @@ ], "refresh": "", "schemaVersion": 39, - "tags": [], + "tags": [ + "logs" + ], "templating": { "list": [ { "allValue": ".+", - "current": { - "selected": false, - "text": "All", - "value": "$__all" - }, + "current": {}, "datasource": { "type": "loki", - "uid": "loki" + "uid": "${DS_LOCAL_LOKI}" }, "definition": "", "hide": 0, @@ -206,14 +256,10 @@ }, { "allValue": ".*", - "current": { - "selected": true, - "text": "All", - "value": "$__all" - }, + "current": {}, "datasource": { "type": "loki", - "uid": "loki" + "uid": "${DS_LOCAL_LOKI}" }, "definition": "", "hide": 0, @@ -236,18 +282,10 @@ }, { "allValue": ".*", - "current": { - "selected": true, - "text": [ - "error" - ], - "value": [ - "error" - ] - }, + "current": {}, "datasource": { "type": "loki", - "uid": "loki" + "uid": "${DS_LOCAL_LOKI}" }, "definition": "", "hide": 0, @@ -309,6 +347,6 @@ "timezone": "", "title": "Logs", "uid": "liz0yRCZz", - "version": 17, + "version": 5, "weekStart": "" -} +} \ No newline at end of file diff --git a/imageroot/etc/dashboards/loki.json b/imageroot/etc/dashboards/loki.json index 9308c13..5fc7149 100644 --- a/imageroot/etc/dashboards/loki.json +++ b/imageroot/etc/dashboards/loki.json @@ -1,4 +1,47 @@ { + "__inputs": [ + { + "name": "DS_LOCAL_PROMETHUS", + "label": "Local Promethus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.2.0" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], "annotations": { "list": [ { @@ -17,18 +60,33 @@ ] }, "description": "Loki metrics via 2.0", - "editable": true, + "editable": false, "fiscalYearStartMonth": 0, "gnetId": 13407, "graphTooltip": 0, - "id": 4, - "links": [], + "id": null, + "links": [ + { + "asDropdown": false, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "logs" + ], + "targetBlank": false, + "title": "New link", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], "liveNow": false, "panels": [ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "description": "", "gridPos": { @@ -48,12 +106,12 @@ "content": "
\n \n Loki Global Metrics\n
", "mode": "html" }, - "pluginVersion": "10.3.3", + "pluginVersion": "11.2.0", "targets": [ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "expr": "loki_build_info", "format": "table", @@ -69,7 +127,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "fieldConfig": { "defaults": { @@ -85,8 +143,7 @@ } ] }, - "unit": "short", - "unitScale": true + "unit": "short" }, "overrides": [] }, @@ -103,6 +160,7 @@ "graphMode": "none", "justifyMode": "center", "orientation": "auto", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "last" @@ -114,12 +172,12 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "10.3.3", + "pluginVersion": "11.2.0", "targets": [ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "expr": "loki_build_info", "format": "table", @@ -135,7 +193,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "fieldConfig": { "defaults": { @@ -151,8 +209,7 @@ } ] }, - "unit": "short", - "unitScale": true + "unit": "short" }, "overrides": [] }, @@ -169,6 +226,7 @@ "graphMode": "none", "justifyMode": "center", "orientation": "auto", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "last" @@ -180,12 +238,12 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "10.3.3", + "pluginVersion": "11.2.0", "targets": [ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "sum(loki_log_messages_total)", @@ -201,7 +259,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "fieldConfig": { "defaults": { @@ -217,8 +275,7 @@ } ] }, - "unit": "short", - "unitScale": true + "unit": "short" }, "overrides": [] }, @@ -235,6 +292,7 @@ "graphMode": "area", "justifyMode": "auto", "orientation": "auto", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "mean" @@ -246,12 +304,12 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "10.3.3", + "pluginVersion": "11.2.0", "targets": [ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "loki_ingester_streams_created_total", @@ -267,7 +325,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "fieldConfig": { "defaults": { @@ -283,8 +341,7 @@ } ] }, - "unit": "short", - "unitScale": true + "unit": "short" }, "overrides": [] }, @@ -301,6 +358,7 @@ "graphMode": "none", "justifyMode": "center", "orientation": "auto", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "last" @@ -312,12 +370,12 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "10.3.3", + "pluginVersion": "11.2.0", "targets": [ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "expr": "loki_panic_total", "instant": false, @@ -332,7 +390,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "fieldConfig": { "defaults": { @@ -346,6 +404,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -386,8 +445,7 @@ } ] }, - "unit": "s", - "unitScale": true + "unit": "s" }, "overrides": [] }, @@ -418,7 +476,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "expr": "histogram_quantile(0.95, sum(rate(loki_request_duration_seconds_bucket[5m])) by (le,route))", "interval": "", @@ -432,7 +490,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "fieldConfig": { "defaults": { @@ -446,6 +504,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 50, "gradientMode": "none", @@ -486,8 +545,7 @@ } ] }, - "unit": "short", - "unitScale": true + "unit": "short" }, "overrides": [] }, @@ -518,7 +576,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "sum(irate(loki_log_messages_total[5m])) by (level)", @@ -547,7 +605,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "fieldConfig": { "defaults": { @@ -561,6 +619,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -601,8 +660,7 @@ } ] }, - "unit": "Bps", - "unitScale": true + "unit": "Bps" }, "overrides": [] }, @@ -633,7 +691,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "expr": "histogram_quantile(0.95, sum(rate(loki_logql_querystats_bytes_processed_per_seconds_bucket[5m])) by (le,type))", "interval": "", @@ -647,7 +705,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "fieldConfig": { "defaults": { @@ -661,6 +719,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", @@ -702,8 +761,7 @@ } ] }, - "unit": "s", - "unitScale": true + "unit": "s" }, "overrides": [] }, @@ -734,7 +792,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "expr": "histogram_quantile(0.95, sum(rate(loki_logql_querystats_latency_seconds_bucket[5m])) by (le,type))", "interval": "", @@ -762,7 +820,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "fieldConfig": { "defaults": { @@ -843,7 +901,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "expr": "sum by (tenant) (rate(loki_distributor_lines_received_total[5m]))", "interval": "", @@ -857,7 +915,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "fieldConfig": { "defaults": { @@ -940,7 +998,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "expr": "rate(loki_distributor_ingester_appends_total[5m])", "interval": "", @@ -950,7 +1008,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "expr": "loki_distributor_ingester_append_failures_total", "interval": "", @@ -1003,7 +1061,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "fieldConfig": { "defaults": { @@ -1017,6 +1075,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", @@ -1056,8 +1115,7 @@ } ] }, - "unit": "short", - "unitScale": true + "unit": "short" }, "overrides": [] }, @@ -1087,7 +1145,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "expr": "rate(loki_ingester_chunks_created_total[5m])", "interval": "", @@ -1097,7 +1155,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "expr": "sum by (reason) (rate(loki_ingester_chunks_flushed_total[5m]))", "interval": "", @@ -1107,7 +1165,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "expr": "sum by (fake) (rate(loki_ingester_chunks_stored_total[5m]))", "interval": "", @@ -1117,7 +1175,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "expr": "", "interval": "", @@ -1131,7 +1189,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "fieldConfig": { "defaults": { @@ -1145,6 +1203,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", @@ -1184,8 +1243,7 @@ } ] }, - "unit": "short", - "unitScale": true + "unit": "short" }, "overrides": [] }, @@ -1215,7 +1273,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "expr": "loki_ingester_memory_chunks", "interval": "", @@ -1229,7 +1287,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "fieldConfig": { "defaults": { @@ -1243,6 +1301,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", @@ -1282,8 +1341,7 @@ } ] }, - "unit": "short", - "unitScale": true + "unit": "short" }, "overrides": [] }, @@ -1313,7 +1371,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "expr": "sum by (tenan) (loki_ingester_memory_streams)", "interval": "", @@ -1327,7 +1385,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "fieldConfig": { "defaults": { @@ -1410,7 +1468,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "expr": "rate(loki_ingester_streams_created_total[5m])", "interval": "", @@ -1420,7 +1478,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "expr": "rate(loki_ingester_streams_removed_total[5m])", "interval": "", @@ -1436,7 +1494,8 @@ "schemaVersion": 39, "tags": [ "loki", - "prometheus" + "prometheus", + "logs" ], "templating": { "list": [] @@ -1462,6 +1521,6 @@ "timezone": "", "title": "Loki metrics", "uid": "MQHVDmtWk", - "version": 12, + "version": 3, "weekStart": "" -} +} \ No newline at end of file diff --git a/imageroot/etc/dashboards/nethsecurity.json b/imageroot/etc/dashboards/nethsecurity.json index cfcbaf1..0b41086 100644 --- a/imageroot/etc/dashboards/nethsecurity.json +++ b/imageroot/etc/dashboards/nethsecurity.json @@ -1,4 +1,41 @@ { + "__inputs": [ + { + "name": "DS_LOCAL_PROMETHUS", + "label": "Local Promethus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.2.0" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph (old)", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], "annotations": { "list": [ { @@ -22,12 +59,27 @@ ] }, "description": "Netdata dashboards for Grafana via Prometheus.", - "editable": true, + "editable": false, "fiscalYearStartMonth": 0, "gnetId": 7107, "graphTooltip": 0, - "id": 1, - "links": [], + "id": null, + "links": [ + { + "asDropdown": false, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "unit" + ], + "targetBlank": false, + "title": "New link", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], "liveNow": false, "panels": [ { @@ -58,6 +110,7 @@ }, { "datasource": { + "default": false, "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, @@ -74,6 +127,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", @@ -114,8 +168,7 @@ } ] }, - "unit": "none", - "unitScale": true + "unit": "none" }, "overrides": [] }, @@ -126,7 +179,6 @@ "y": 1 }, "id": 11, - "links": [], "options": { "legend": { "calcs": [ @@ -148,7 +200,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_system_load_load_average{dimension!=\"load15\", unit=~\"$unit\"}", @@ -205,7 +257,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "description": "Total CPU utilization (all cores). 100% here means there is no CPU idle time at all. You can get per core usage at the _CPUs_ section and per application usage at the _Applications monitoring_ section.\n\nKeep an eye on **iowait**. If it is constantly high, your disks are a bottleneck and they slow your system down.\n\nAn important metric worth monitoring, is **softirq**. A constantly high percentage of softirq may indicate network driver issues.", "fieldConfig": { @@ -220,6 +272,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 50, "gradientMode": "none", @@ -261,8 +314,7 @@ } ] }, - "unit": "percent", - "unitScale": true + "unit": "percent" }, "overrides": [ { @@ -294,7 +346,6 @@ "y": 8 }, "id": 8, - "links": [], "options": { "legend": { "calcs": [ @@ -333,7 +384,7 @@ "type": "timeseries" }, { - "collapsed": false, + "collapsed": true, "datasource": { "type": "datasource", "uid": "grafana" @@ -345,239 +396,236 @@ "y": 14 }, "id": 45, - "panels": [], - "targets": [ + "panels": [ { "datasource": { - "type": "datasource", - "uid": "grafana" - }, - "refId": "A" - } - ], - "title": "System overview: network", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "description": "Total IPv4 Traffic.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "type": "prometheus", + "uid": "${DS_LOCAL_PROMETHUS}" }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" + "description": "Total IPv4 Traffic.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "KBs" }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 24, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min", + "sum" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true }, - "thresholdsStyle": { - "mode": "off" + "tooltip": { + "mode": "multi", + "sort": "none" } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "pluginVersion": "10.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "KBs", - "unitScale": true - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 15 - }, - "id": 24, - "links": [], - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull", - "max", - "min", - "sum" + "editorMode": "code", + "exemplar": true, + "expr": "netdata_system_ip_kilobits_persec_average{unit=~\"$unit\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{dimension}}", + "range": true, + "refId": "A" + } ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + "title": "IPv4 bandwidth", + "transparent": true, + "type": "timeseries" }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.3.3", - "targets": [ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "exemplar": true, - "expr": "netdata_system_ip_kilobits_persec_average{unit=~\"$unit\"}", - "format": "time_series", - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{dimension}}", - "range": true, - "refId": "A" - } - ], - "title": "IPv4 bandwidth", - "transparent": true, - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "description": "Total IPv6 Traffic.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "uid": "${DS_LOCAL_PROMETHUS}" }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" + "description": "Total IPv6 Traffic.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "KBs" }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 9 + }, + "id": 25, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min", + "sum" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true }, - "thresholdsStyle": { - "mode": "off" + "tooltip": { + "mode": "multi", + "sort": "none" } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "pluginVersion": "10.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "KBs", - "unitScale": true - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 15 - }, - "id": 25, - "links": [], - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull", - "max", - "min", - "sum" + "editorMode": "code", + "expr": "netdata_system_ipv6_kilobits_persec_average{unit=~\"$unit\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{dimension}}", + "range": true, + "refId": "A" + } ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" + "title": "IPv6 bandwidth", + "transparent": true, + "type": "timeseries" } - }, - "pluginVersion": "10.3.3", + ], "targets": [ { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "datasource": { + "type": "datasource", + "uid": "grafana" }, - "editorMode": "code", - "expr": "netdata_system_ipv6_kilobits_persec_average{unit=~\"$unit\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "{{dimension}}", - "range": true, "refId": "A" } ], - "title": "IPv6 bandwidth", - "transparent": true, - "type": "timeseries" + "title": "System overview: network", + "type": "row" }, { - "collapsed": false, + "collapsed": true, "datasource": { "type": "datasource", "uid": "grafana" @@ -586,141 +634,140 @@ "h": 1, "w": 24, "x": 0, - "y": 22 + "y": 15 }, "id": 41, - "panels": [], - "targets": [ + "panels": [ { "datasource": { - "type": "datasource", - "uid": "grafana" - }, - "refId": "A" - } - ], - "title": "System overview: RAM", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "description": "System Random Access Memory (i.e. physical memory) usage.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "type": "prometheus", + "uid": "${DS_LOCAL_PROMETHUS}" }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 50, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" + "description": "System Random Access Memory (i.e. physical memory) usage.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decmbytes" }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 16, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true }, - "thresholdsStyle": { - "mode": "off" + "tooltip": { + "mode": "multi", + "sort": "none" } }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null + "pluginVersion": "10.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "decmbytes", - "unitScale": true - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 23 - }, - "id": 16, - "links": [], - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull", - "max", - "min" + "editorMode": "code", + "expr": "netdata_system_ram_MiB_average{dimension!=\"free\", unit=~\"$unit\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{dimension}}", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_LOCAL_PROMETHUS}" + }, + "editorMode": "code", + "expr": "netdata_system_ram_MiB_average{dimension=\"free\", unit=~\"$unit\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{dimension}}", + "range": true, + "refId": "B" + } ], - "displayMode": "table", - "placement": "right", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" + "title": "System RAM", + "transparent": true, + "type": "timeseries" } - }, - "pluginVersion": "10.3.3", + ], "targets": [ { "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "type": "datasource", + "uid": "grafana" }, - "editorMode": "code", - "expr": "netdata_system_ram_MiB_average{dimension!=\"free\", unit=~\"$unit\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "{{dimension}}", - "range": true, "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "${DS_PROMETHEUS}" - }, - "editorMode": "code", - "expr": "netdata_system_ram_MiB_average{dimension=\"free\", unit=~\"$unit\"}", - "format": "time_series", - "intervalFactor": 1, - "legendFormat": "{{dimension}}", - "range": true, - "refId": "B" } ], - "title": "System RAM", - "transparent": true, - "type": "timeseries" + "title": "System overview: RAM", + "type": "row" }, { "collapsed": true, @@ -732,7 +779,7 @@ "h": 1, "w": 24, "x": 0, - "y": 30 + "y": 16 }, "id": 586, "panels": [ @@ -783,8 +830,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -801,7 +847,7 @@ "h": 8, "w": 12, "x": 0, - "y": 31 + "y": 39 }, "id": 1461, "options": { @@ -820,7 +866,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_net_net_kilobits_persec_average{unit=~\"$unit\",dimension=\"received\"}", @@ -881,8 +927,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -899,7 +944,7 @@ "h": 8, "w": 12, "x": 12, - "y": 31 + "y": 39 }, "id": 1462, "options": { @@ -918,7 +963,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "abs(netdata_net_net_kilobits_persec_average{unit=~\"$unit\",dimension=\"sent\"})", @@ -979,8 +1024,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -997,7 +1041,7 @@ "h": 8, "w": 12, "x": 0, - "y": 39 + "y": 47 }, "id": 1463, "options": { @@ -1016,7 +1060,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_net_packets_packets_persec_average{unit=~\"$unit\", dimension=~\"received\"}", @@ -1077,8 +1121,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1095,7 +1138,7 @@ "h": 8, "w": 12, "x": 12, - "y": 39 + "y": 47 }, "id": 1464, "options": { @@ -1114,7 +1157,7 @@ { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "abs(netdata_net_packets_packets_persec_average{unit=~\"$unit\", dimension=~\"sent\"})", @@ -1153,7 +1196,7 @@ "h": 1, "w": 24, "x": 0, - "y": 31 + "y": 17 }, "id": 39, "panels": [ @@ -1205,8 +1248,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1223,7 +1265,7 @@ "h": 7, "w": 12, "x": 0, - "y": 32 + "y": 40 }, "id": 13, "links": [], @@ -1250,7 +1292,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_system_io_KiB_persec_average{unit=~\"$unit\"}", @@ -1313,8 +1355,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1331,7 +1372,7 @@ "h": 7, "w": 12, "x": 12, - "y": 32 + "y": 40 }, "id": 14, "links": [], @@ -1358,7 +1399,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "exemplar": true, @@ -1398,7 +1439,7 @@ "h": 1, "w": 24, "x": 0, - "y": 32 + "y": 18 }, "id": 47, "panels": [ @@ -1468,7 +1509,7 @@ "h": 7, "w": 12, "x": 0, - "y": 22 + "y": 30 }, "id": 29, "links": [], @@ -1491,7 +1532,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_system_processes_processes_average{unit=~\"$unit\"}", @@ -1571,7 +1612,7 @@ "h": 7, "w": 12, "x": 12, - "y": 22 + "y": 30 }, "id": 31, "links": [], @@ -1592,7 +1633,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_system_forks_processes_persec_average{unit=~\"$unit\"}", @@ -1672,7 +1713,7 @@ "h": 7, "w": 12, "x": 0, - "y": 29 + "y": 37 }, "id": 33, "links": [], @@ -1693,7 +1734,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_system_active_processes_processes_average{unit=~\"$unit\"}", @@ -1773,7 +1814,7 @@ "h": 7, "w": 12, "x": 12, - "y": 29 + "y": 37 }, "id": 35, "links": [], @@ -1794,7 +1835,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_system_ctxt_context_switches_persec_average{unit=~\"$unit\"}", @@ -1832,7 +1873,7 @@ "h": 1, "w": 24, "x": 0, - "y": 33 + "y": 19 }, "id": 49, "panels": [ @@ -1901,7 +1942,7 @@ "h": 6, "w": 24, "x": 0, - "y": 23 + "y": 31 }, "id": 51, "links": [], @@ -1927,7 +1968,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_system_idlejitter_microseconds_lost_persec_average{unit=~\"$unit\"}", @@ -1965,7 +2006,7 @@ "h": 1, "w": 24, "x": 0, - "y": 34 + "y": 20 }, "id": 59, "panels": [ @@ -2035,7 +2076,7 @@ "h": 7, "w": 11, "x": 0, - "y": 24 + "y": 32 }, "id": 55, "links": [], @@ -2056,7 +2097,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_system_intr_interrupts_persec_average{unit=~\"$unit\"}", @@ -2158,7 +2199,7 @@ "h": 7, "w": 13, "x": 11, - "y": 24 + "y": 32 }, "id": 57, "links": [], @@ -2181,7 +2222,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_system_interrupts_interrupts_persec_average{unit=~\"$unit\"}", @@ -2219,7 +2260,7 @@ "h": 1, "w": 24, "x": 0, - "y": 35 + "y": 21 }, "id": 63, "panels": [ @@ -2309,7 +2350,7 @@ "h": 7, "w": 24, "x": 0, - "y": 25 + "y": 33 }, "id": 113, "links": [], @@ -2332,7 +2373,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_system_softirqs_softirqs_persec_average{unit=~\"$unit\"}", @@ -2370,7 +2411,7 @@ "h": 1, "w": 24, "x": 0, - "y": 36 + "y": 22 }, "id": 81, "panels": [ @@ -2438,7 +2479,7 @@ "h": 6, "w": 24, "x": 0, - "y": 26 + "y": 34 }, "id": 79, "links": [], @@ -2461,7 +2502,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "disableTextWrap": false, "editorMode": "code", @@ -2502,7 +2543,7 @@ "h": 1, "w": 24, "x": 0, - "y": 37 + "y": 23 }, "id": 43, "panels": [ @@ -2571,7 +2612,7 @@ "h": 7, "w": 24, "x": 0, - "y": 39 + "y": 47 }, "id": 18, "links": [], @@ -2597,7 +2638,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_system_swap_MiB_average{unit=~\"$unit\"}", @@ -2635,7 +2676,7 @@ "h": 1, "w": 24, "x": 0, - "y": 38 + "y": 24 }, "id": 146, "panels": [ @@ -2706,7 +2747,7 @@ "h": 7, "w": 12, "x": 0, - "y": 40 + "y": 48 }, "id": 140, "links": [], @@ -2732,7 +2773,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "exemplar": false, @@ -2814,7 +2855,7 @@ "h": 7, "w": 12, "x": 12, - "y": 40 + "y": 48 }, "id": 142, "links": [], @@ -2840,7 +2881,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_mem_committed_MiB_average{unit=~\"$unit\"}", @@ -2919,7 +2960,7 @@ "h": 7, "w": 24, "x": 0, - "y": 47 + "y": 55 }, "id": 144, "links": [], @@ -2946,7 +2987,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_mem_pgfaults_faults_persec_average{unit=~\"$unit\"}", @@ -2983,7 +3024,7 @@ "h": 1, "w": 24, "x": 0, - "y": 39 + "y": 25 }, "id": 152, "panels": [ @@ -3074,7 +3115,7 @@ "h": 8, "w": 12, "x": 0, - "y": 41 + "y": 49 }, "id": 148, "links": [], @@ -3101,7 +3142,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_mem_writeback_MiB_average{unit=~\"$unit\"}", @@ -3137,7 +3178,7 @@ "h": 8, "w": 12, "x": 12, - "y": 41 + "y": 49 }, "hiddenSeries": false, "id": 150, @@ -3172,7 +3213,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_mem_kernel_MiB_average{unit=~\"$unit\"}", @@ -3238,7 +3279,7 @@ "h": 1, "w": 24, "x": 0, - "y": 40 + "y": 26 }, "id": 178, "panels": [ @@ -3260,6 +3301,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", @@ -3298,8 +3340,7 @@ } ] }, - "unit": "decmbytes", - "unitScale": true + "unit": "decmbytes" }, "overrides": [] }, @@ -3307,10 +3348,9 @@ "h": 7, "w": 12, "x": 0, - "y": 42 + "y": 23 }, "id": 158, - "links": [], "options": { "legend": { "calcs": [ @@ -3334,7 +3374,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_disk_ops_operations_persec_average{unit=~\"$unit\"}", @@ -3366,6 +3406,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", @@ -3404,8 +3445,7 @@ } ] }, - "unit": "ms", - "unitScale": true + "unit": "ms" }, "overrides": [] }, @@ -3413,10 +3453,9 @@ "h": 7, "w": 12, "x": 12, - "y": 42 + "y": 23 }, "id": 164, - "links": [], "options": { "legend": { "calcs": [ @@ -3440,7 +3479,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_disk_util___of_time_working_average{unit=~\"$unit\"}", @@ -3472,6 +3511,7 @@ "axisLabel": "operations", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", @@ -3510,8 +3550,7 @@ } ] }, - "unit": "none", - "unitScale": true + "unit": "none" }, "overrides": [] }, @@ -3519,10 +3558,9 @@ "h": 7, "w": 12, "x": 0, - "y": 49 + "y": 30 }, "id": 162, - "links": [], "options": { "legend": { "calcs": [ @@ -3546,7 +3584,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_disk_backlog_milliseconds_average{unit=~\"$unit\"}", @@ -3578,6 +3616,7 @@ "axisLabel": "ms per operation", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", @@ -3616,8 +3655,7 @@ } ] }, - "unit": "ms", - "unitScale": true + "unit": "ms" }, "overrides": [] }, @@ -3625,10 +3663,9 @@ "h": 7, "w": 12, "x": 12, - "y": 49 + "y": 30 }, "id": 172, - "links": [], "options": { "legend": { "calcs": [ @@ -3652,7 +3689,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_disk_mops_merged_operations_persec_average{unit=~\"$unit\"}", @@ -3731,10 +3768,9 @@ "h": 7, "w": 12, "x": 0, - "y": 56 + "y": 37 }, "id": 166, - "links": [], "options": { "legend": { "calcs": [ @@ -3757,7 +3793,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_disk_await_milliseconds_operation_average{unit=~\"$unit\"}", @@ -3836,10 +3872,9 @@ "h": 7, "w": 12, "x": 12, - "y": 56 + "y": 37 }, "id": 176, - "links": [], "options": { "legend": { "calcs": [ @@ -3863,7 +3898,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_disk_space_GiB_average{unit=~\"$unit\"}", @@ -3902,7 +3937,7 @@ "h": 1, "w": 24, "x": 0, - "y": 41 + "y": 27 }, "id": 185, "panels": [ @@ -3924,6 +3959,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 50, "gradientMode": "none", @@ -3963,8 +3999,7 @@ } ] }, - "unit": "kbytes", - "unitScale": true + "unit": "kbytes" }, "overrides": [] }, @@ -3972,10 +4007,9 @@ "h": 8, "w": 12, "x": 0, - "y": 43 + "y": 24 }, "id": 183, - "links": [], "options": { "legend": { "calcs": [ @@ -3999,7 +4033,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_disk_inodes_inodes_average{unit=~\"$unit\"}", @@ -4028,6 +4062,120 @@ "title": "Disks: filesystem", "type": "row" }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 28 + }, + "id": 1465, + "panels": [ + { + "datasource": { + "default": false, + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 6, + "x": 0, + "y": 29 + }, + "id": 1466, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "repeat": "vpninterface", + "repeatDirection": "h", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_LOCAL_PROMETHUS}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "netdata_net_net_kilobits_persec_average{unit=~\"$unit\",chart=~\"$vpninterface\"}", + "instant": true, + "legendFormat": "{{dimension}}", + "range": false, + "refId": "A" + } + ], + "title": "VPN interface: $vpninterface", + "type": "timeseries" + } + ], + "title": "VPN networking", + "type": "row" + }, { "collapsed": true, "datasource": { @@ -4038,7 +4186,7 @@ "h": 1, "w": 24, "x": 0, - "y": 42 + "y": 29 }, "id": 264, "panels": [ @@ -4107,7 +4255,7 @@ "h": 7, "w": 24, "x": 0, - "y": 51 + "y": 59 }, "id": 458, "links": [], @@ -4133,7 +4281,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv4_sockstat_sockets_sockets_average{unit=~\"$unit\"}", @@ -4170,7 +4318,7 @@ "h": 1, "w": 24, "x": 0, - "y": 43 + "y": 30 }, "id": 285, "panels": [ @@ -4259,7 +4407,7 @@ "h": 7, "w": 24, "x": 0, - "y": 52 + "y": 60 }, "id": 283, "links": [], @@ -4286,7 +4434,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv4_packets_packets_persec_average{unit=~\"$unit\"}", @@ -4323,7 +4471,7 @@ "h": 1, "w": 24, "x": 0, - "y": 44 + "y": 31 }, "id": 308, "panels": [ @@ -4392,7 +4540,7 @@ "h": 7, "w": 24, "x": 0, - "y": 53 + "y": 61 }, "id": 304, "links": [], @@ -4419,7 +4567,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv4_errors_packets_persec_average{unit=~\"$unit\"}", @@ -4456,7 +4604,7 @@ "h": 1, "w": 24, "x": 0, - "y": 45 + "y": 32 }, "id": 364, "panels": [ @@ -4525,7 +4673,7 @@ "h": 7, "w": 24, "x": 0, - "y": 54 + "y": 62 }, "id": 327, "links": [], @@ -4551,7 +4699,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv4_sockstat_tcp_sockets_sockets_average{unit=~\"$unit\"}", @@ -4631,7 +4779,7 @@ "h": 8, "w": 12, "x": 0, - "y": 61 + "y": 69 }, "id": 329, "links": [], @@ -4657,7 +4805,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv4_tcpsock_active_connections_average{unit=~\"$unit\"}", @@ -4737,7 +4885,7 @@ "h": 8, "w": 12, "x": 12, - "y": 61 + "y": 69 }, "id": 331, "links": [], @@ -4763,7 +4911,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv4_tcpopens_connections_persec_average{unit=~\"$unit\"}", @@ -4841,7 +4989,7 @@ "h": 8, "w": 12, "x": 0, - "y": 69 + "y": 77 }, "id": 350, "links": [], @@ -4868,7 +5016,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv4_tcppackets_packets_persec_average{unit=~\"$unit\"}", @@ -4948,7 +5096,7 @@ "h": 8, "w": 12, "x": 12, - "y": 69 + "y": 77 }, "id": 352, "links": [], @@ -4975,7 +5123,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv4_tcppackets_packets_persec_average{unit=~\"$unit\"}", @@ -5055,7 +5203,7 @@ "h": 7, "w": 24, "x": 0, - "y": 77 + "y": 85 }, "id": 356, "links": [], @@ -5082,7 +5230,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ip_tcpconnaborts_connections_persec_average{unit=~\"$unit\"}", @@ -5162,7 +5310,7 @@ "h": 9, "w": 12, "x": 0, - "y": 84 + "y": 92 }, "id": 354, "links": [], @@ -5189,7 +5337,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv4_tcphandshake_events_persec_average{unit=~\"$unit\"}", @@ -5268,7 +5416,7 @@ "h": 9, "w": 12, "x": 12, - "y": 84 + "y": 92 }, "id": 362, "links": [], @@ -5294,7 +5442,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv4_sockstat_tcp_mem_KiB_average{unit=~\"$unit\"}", @@ -5331,7 +5479,7 @@ "h": 1, "w": 24, "x": 0, - "y": 46 + "y": 33 }, "id": 391, "panels": [ @@ -5400,7 +5548,7 @@ "h": 7, "w": 12, "x": 0, - "y": 55 + "y": 63 }, "id": 383, "links": [], @@ -5426,7 +5574,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv4_sockstat_udp_sockets_sockets_average{unit=~\"$unit\"}", @@ -5504,7 +5652,7 @@ "h": 7, "w": 12, "x": 12, - "y": 55 + "y": 63 }, "id": 385, "links": [], @@ -5531,7 +5679,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv4_udppackets_packets_persec_average{unit=~\"$unit\"}", @@ -5610,7 +5758,7 @@ "h": 7, "w": 12, "x": 0, - "y": 62 + "y": 70 }, "id": 387, "links": [], @@ -5636,7 +5784,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv4_sockstat_udp_mem_KiB_average{unit=~\"$unit\"}", @@ -5736,7 +5884,7 @@ "h": 7, "w": 12, "x": 12, - "y": 62 + "y": 70 }, "id": 389, "links": [], @@ -5762,7 +5910,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv4_udperrors_events_persec_average{unit=~\"$unit\"}", @@ -5799,7 +5947,7 @@ "h": 1, "w": 24, "x": 0, - "y": 47 + "y": 34 }, "id": 416, "panels": [ @@ -5867,7 +6015,7 @@ "h": 8, "w": 12, "x": 0, - "y": 56 + "y": 64 }, "id": 410, "links": [], @@ -5894,7 +6042,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv4_icmp_packets_persec_average{unit=~\"$unit\"}", @@ -5973,7 +6121,7 @@ "h": 8, "w": 12, "x": 12, - "y": 56 + "y": 64 }, "id": 412, "links": [], @@ -6000,7 +6148,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv4_icmp_errors_packets_persec_average{unit=~\"$unit\"}", @@ -6099,7 +6247,7 @@ "h": 7, "w": 24, "x": 0, - "y": 64 + "y": 72 }, "id": 414, "links": [], @@ -6126,7 +6274,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv6_icmp_messages_persec_average{unit=~\"$unit\"}", @@ -6163,7 +6311,7 @@ "h": 1, "w": 24, "x": 0, - "y": 48 + "y": 35 }, "id": 523, "panels": [ @@ -6231,7 +6379,7 @@ "h": 7, "w": 12, "x": 0, - "y": 57 + "y": 65 }, "id": 502, "links": [], @@ -6257,7 +6405,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ip_bcast_kilobits_persec_average{unit=~\"$unit\"}", @@ -6335,7 +6483,7 @@ "h": 7, "w": 12, "x": 12, - "y": 57 + "y": 65 }, "id": 504, "links": [], @@ -6362,7 +6510,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ip_bcastpkts_packets_persec_average{unit=~\"$unit\"}", @@ -6399,7 +6547,7 @@ "h": 1, "w": 24, "x": 0, - "y": 49 + "y": 36 }, "id": 567, "panels": [ @@ -6468,7 +6616,7 @@ "h": 7, "w": 24, "x": 0, - "y": 58 + "y": 66 }, "id": 565, "links": [], @@ -6495,7 +6643,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ip_ecnpkts_packets_persec_average{unit=~\"$unit\"}", @@ -6532,7 +6680,7 @@ "h": 1, "w": 24, "x": 0, - "y": 50 + "y": 37 }, "id": 1106, "panels": [ @@ -6621,7 +6769,7 @@ "h": 7, "w": 12, "x": 0, - "y": 51 + "y": 59 }, "id": 1104, "links": [], @@ -6648,7 +6796,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv6_packets_packets_persec_average{unit=~\"$unit\"}", @@ -6747,7 +6895,7 @@ "h": 7, "w": 12, "x": 12, - "y": 51 + "y": 59 }, "id": 1107, "links": [], @@ -6774,7 +6922,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv6_ect_packets_persec_average{unit=~\"$unit\"}", @@ -6811,7 +6959,7 @@ "h": 1, "w": 24, "x": 0, - "y": 51 + "y": 38 }, "id": 1174, "panels": [ @@ -6880,7 +7028,7 @@ "h": 7, "w": 12, "x": 0, - "y": 52 + "y": 60 }, "id": 1172, "links": [], @@ -6906,7 +7054,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv6_sockstat6_tcp_sockets_sockets_average{unit=~\"$unit\"}", @@ -6943,7 +7091,7 @@ "h": 1, "w": 24, "x": 0, - "y": 52 + "y": 39 }, "id": 1245, "panels": [ @@ -7012,7 +7160,7 @@ "h": 7, "w": 12, "x": 0, - "y": 53 + "y": 61 }, "id": 1239, "links": [], @@ -7038,7 +7186,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv6_sockstat6_udp_sockets_sockets_average{unit=~\"$unit\"}", @@ -7116,7 +7264,7 @@ "h": 7, "w": 12, "x": 12, - "y": 53 + "y": 61 }, "id": 1241, "links": [], @@ -7143,7 +7291,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv6_udppackets_packets_persec_average{unit=~\"$unit\"}", @@ -7222,7 +7370,7 @@ "h": 7, "w": 24, "x": 0, - "y": 60 + "y": 68 }, "id": 1243, "links": [], @@ -7249,7 +7397,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv6_udperrors_events_persec_average{unit=~\"$unit\"}", @@ -7286,7 +7434,7 @@ "h": 1, "w": 24, "x": 0, - "y": 53 + "y": 40 }, "id": 1381, "panels": [ @@ -7395,7 +7543,7 @@ "h": 7, "w": 12, "x": 0, - "y": 54 + "y": 62 }, "id": 1377, "links": [], @@ -7421,7 +7569,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv6_mcast_kilobits_persec_average{unit=~\"$unit\"}", @@ -7540,7 +7688,7 @@ "h": 7, "w": 12, "x": 12, - "y": 54 + "y": 62 }, "id": 1379, "links": [], @@ -7567,7 +7715,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv6_mcastpkts_packets_persec_average{unit=~\"$unit\"}", @@ -7604,7 +7752,7 @@ "h": 1, "w": 24, "x": 0, - "y": 54 + "y": 41 }, "id": 1460, "panels": [ @@ -7672,7 +7820,7 @@ "h": 7, "w": 24, "x": 0, - "y": 55 + "y": 63 }, "id": 1446, "links": [], @@ -7699,7 +7847,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv6_icmp_messages_persec_average{unit=~\"$unit\"}", @@ -7778,7 +7926,7 @@ "h": 7, "w": 24, "x": 0, - "y": 62 + "y": 70 }, "id": 1448, "links": [], @@ -7805,7 +7953,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv6_icmperrors_errors_persec_average{unit=~\"$unit\"}", @@ -7883,7 +8031,7 @@ "h": 9, "w": 12, "x": 0, - "y": 69 + "y": 77 }, "id": 1450, "links": [], @@ -7910,7 +8058,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv6_icmpechos_messages_persec_average{unit=~\"$unit\"}", @@ -7988,7 +8136,7 @@ "h": 9, "w": 12, "x": 12, - "y": 69 + "y": 77 }, "id": 1452, "links": [], @@ -8015,7 +8163,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv6_icmprouter_messages_persec_average{unit=~\"$unit\"}", @@ -8093,7 +8241,7 @@ "h": 9, "w": 12, "x": 0, - "y": 78 + "y": 86 }, "id": 1454, "links": [], @@ -8120,7 +8268,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv6_icmpneighbor_messages_persec_average{unit=~\"$unit\"}", @@ -8198,7 +8346,7 @@ "h": 9, "w": 12, "x": 12, - "y": 78 + "y": 86 }, "id": 1456, "links": [], @@ -8225,7 +8373,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv6_icmpmldv2_reports_persec_average{unit=~\"$unit\"}", @@ -8303,7 +8451,7 @@ "h": 7, "w": 24, "x": 0, - "y": 87 + "y": 95 }, "id": 1458, "links": [], @@ -8330,7 +8478,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_PROMETHEUS}" + "uid": "${DS_LOCAL_PROMETHUS}" }, "editorMode": "code", "expr": "netdata_ipv6_icmprouter_messages_persec_average{unit=~\"$unit\"}", @@ -8369,11 +8517,7 @@ "templating": { "list": [ { - "current": { - "selected": true, - "text": "7BD33F72-F9D7-4A78-80A0-7ACD15991B92", - "value": "7BD33F72-F9D7-4A78-80A0-7ACD15991B92" - }, + "current": {}, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" @@ -8397,11 +8541,7 @@ "type": "query" }, { - "current": { - "selected": false, - "text": "Local Promethus", - "value": "prometheus" - }, + "current": {}, "description": "Prometheus datasource", "hide": 2, "includeAll": false, @@ -8414,6 +8554,31 @@ "regex": "", "skipUrlSync": false, "type": "datasource" + }, + { + "allValue": "", + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${DS_LOCAL_PROMETHUS}" + }, + "definition": "label_values(netdata_net_net_kilobits_persec_average{chart=~\"^net.tun.*|^net.tap.*|^net.ipsec.*\"},chart)", + "hide": 0, + "includeAll": true, + "label": "VPN interface", + "multi": false, + "name": "vpninterface", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(netdata_net_net_kilobits_persec_average{chart=~\"^net.tun.*|^net.tap.*|^net.ipsec.*\"},chart)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" } ] }, @@ -8447,8 +8612,8 @@ ] }, "timezone": "", - "title": "Unit metrics", + "title": "Operating system", "uid": "W3S__804z", - "version": 25, + "version": 18, "weekStart": "" -} +} \ No newline at end of file diff --git a/imageroot/etc/dashboards/network_traffic.json b/imageroot/etc/dashboards/network_traffic.json new file mode 100644 index 0000000..afde728 --- /dev/null +++ b/imageroot/etc/dashboards/network_traffic.json @@ -0,0 +1,1094 @@ +{ + "__inputs": [ + { + "name": "DS_LOCAL_TIMESCALE", + "label": "Local Timescale", + "description": "", + "type": "datasource", + "pluginId": "grafana-postgresql-datasource", + "pluginName": "PostgreSQL" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "panel", + "id": "barchart", + "name": "Bar chart", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.2.0" + }, + { + "type": "datasource", + "id": "grafana-postgresql-datasource", + "name": "PostgreSQL", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "piechart", + "name": "Pie chart", + "version": "" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": false, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [ + { + "asDropdown": false, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "unit" + ], + "targetBlank": false, + "title": "Dashboards", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], + "liveNow": false, + "panels": [ + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "#73BF69", + "value": null + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 0, + "y": 0 + }, + "id": 1, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT sum(bytes) FROM ca_dpi_stats_hourly_bytes\nWHERE $__timeFilter(bucket) AND uuid = '$uuid'", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Total traffic", + "type": "stat" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 18, + "x": 6, + "y": 0 + }, + "id": 3, + "options": { + "barRadius": 0, + "barWidth": 0.97, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": true + }, + "orientation": "auto", + "showValue": "always", + "stacking": "none", + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 100 + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT bucket, bytes FROM ca_dpi_stats_hourly_bytes \nWHERE $__timeFilter(bucket) AND uuid = '$uuid'\nGROUP BY bucket, bytes", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Traffic by hour", + "type": "barchart" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 11, + "options": { + "displayLabels": [], + "legend": { + "displayMode": "list", + "placement": "right", + "showLegend": true, + "values": [ + "value" + ] + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "limit": 10, + "values": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\n CASE\n WHEN application_rank <= 10 THEN application\n ELSE 'Other'\n END AS application,\n SUM(bytes) AS total_bytes\nFROM (\n SELECT\n replace(application, 'netify.', '') AS application,\n SUM(bytes) AS bytes,\n ROW_NUMBER() OVER (ORDER BY SUM(bytes) DESC) AS application_rank\n FROM\n ca_dpi_stats_hourly_application\n WHERE\n $__timeFilter(bucket) AND uuid = '$uuid'\n GROUP BY\n application\n) AS ranked_applications\nGROUP BY\n CASE\n WHEN application_rank <= 10 THEN application\n ELSE 'Other'\n END\nORDER BY\n total_bytes DESC;\n", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Top 10 applications", + "type": "piechart" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 8 + }, + "id": 13, + "options": { + "displayLabels": [], + "legend": { + "displayMode": "list", + "placement": "right", + "showLegend": true, + "values": [ + "value" + ] + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "limit": 10, + "values": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT client_name, sum(bytes) FROM ca_dpi_stats_hourly_client\nWHERE $__timeFilter(bucket) AND uuid = '$uuid'\nGROUP BY client_name", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Top 10 clients", + "type": "piechart" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 18 + }, + "id": 12, + "options": { + "displayLabels": [], + "legend": { + "displayMode": "list", + "placement": "right", + "showLegend": true, + "values": [ + "value" + ] + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "limit": 10, + "values": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\n CASE\n WHEN protocol_rank <= 10 THEN protocol\n ELSE 'Other'\n END AS protocol,\n SUM(bytes) AS total_bytes\nFROM (\n SELECT\n protocol,\n SUM(bytes) AS bytes,\n ROW_NUMBER() OVER (ORDER BY SUM(bytes) DESC) AS protocol_rank\n FROM\n ca_dpi_stats_hourly_protocol\n WHERE\n $__timeFilter(bucket) AND uuid = '$uuid'\n GROUP BY\n protocol\n) AS ranked_protocols\nGROUP BY\n CASE\n WHEN protocol_rank <= 10 THEN protocol\n ELSE 'Other'\n END\nORDER BY\n total_bytes DESC;\n", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Top 10 protocols", + "type": "piechart" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 18 + }, + "id": 14, + "options": { + "displayLabels": [], + "legend": { + "displayMode": "list", + "placement": "right", + "showLegend": true, + "values": [ + "value" + ] + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "limit": 10, + "values": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\n CASE\n WHEN host_rank <= 10 THEN host\n ELSE 'Other'\n END AS host,\n SUM(bytes) AS total_bytes\nFROM (\n SELECT\n host,\n SUM(bytes) AS bytes,\n ROW_NUMBER() OVER (ORDER BY SUM(bytes) DESC) AS host_rank\n FROM\n ca_dpi_stats_hourly_host\n WHERE\n $__timeFilter(bucket) AND uuid = '$uuid'\n GROUP BY\n host\n) AS ranked_hosts\nGROUP BY\n CASE\n WHEN host_rank <= 10 THEN host\n ELSE 'Other'\n END\nORDER BY\n total_bytes DESC;\n", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Top 10 remote hosts", + "type": "piechart" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 15, + "w": 12, + "x": 0, + "y": 28 + }, + "id": 18, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": true + }, + "showHeader": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT protocol, sum(bytes) as bytes FROM ca_dpi_stats_hourly_protocol\nWHERE $__timeFilter(bucket) AND uuid = '$uuid'\nGROUP BY protocol\nORDER BY bytes DESC", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Protocols", + "type": "table" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 15, + "w": 12, + "x": 12, + "y": 28 + }, + "id": 16, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": true + }, + "showHeader": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT replace(application, 'netify.', '') AS application, sum(bytes) as bytes FROM ca_dpi_stats_hourly_application\nWHERE $__timeFilter(bucket) AND uuid = '$uuid'\nGROUP BY application\nORDER BY bytes DESC", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Applications", + "type": "table" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "client_address" + }, + "properties": [ + { + "id": "links", + "value": [ + { + "title": "Client details", + "url": "/grafana/d/b14a1181-a2ee-4df4-a732-888e0190037f/network-traffic-by-host?${__all_variables}&var-client_address=${__value.raw}" + } + ] + } + ] + } + ] + }, + "gridPos": { + "h": 17, + "w": 12, + "x": 0, + "y": 43 + }, + "id": 5, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": true + }, + "showHeader": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT client_address, client_name, bytes FROM ca_dpi_stats_hourly_client\nWHERE $__timeFilter(bucket) AND uuid = '$uuid'\nORDER BY bytes DESC\n", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Clients", + "type": "table" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "host" + }, + "properties": [ + { + "id": "links", + "value": [ + { + "title": "Remote host details", + "url": "/grafana/d/c8d43e5f-068e-4cac-9283-2318d9e1911b/network-traffic-by-host?${__all_variables}&var-host=${__value.raw}" + } + ] + } + ] + } + ] + }, + "gridPos": { + "h": 17, + "w": 12, + "x": 12, + "y": 43 + }, + "id": 19, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": true + }, + "showHeader": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT host, sum(bytes) as bytes FROM ca_dpi_stats_hourly_host\nWHERE $__timeFilter(bucket) AND uuid = '$uuid'\nGROUP BY host\nORDER BY bytes DESC", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Remote hosts", + "type": "table" + } + ], + "refresh": "", + "schemaVersion": 39, + "tags": [ + "unit", + "timescale", + "monitoring" + ], + "templating": { + "list": [ + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "definition": "SELECT uuid AS __value, name AS __text FROM units", + "description": "", + "hide": 0, + "includeAll": false, + "label": "Unit", + "multi": false, + "name": "uuid", + "options": [], + "query": "SELECT uuid AS __value, name AS __text FROM units", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "hide": 2, + "includeAll": false, + "label": "Local Timescale", + "multi": false, + "name": "DS_TIMESCALE", + "options": [], + "query": "grafana-postgresql-datasource", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + } + ] + }, + "time": { + "from": "now-12h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Network traffic", + "uid": "fe0af3cb-9be0-4b2a-8ccb-86704956cf2e", + "version": 32, + "weekStart": "" +} \ No newline at end of file diff --git a/imageroot/etc/dashboards/network_traffic_by_client.json b/imageroot/etc/dashboards/network_traffic_by_client.json new file mode 100644 index 0000000..4dffb96 --- /dev/null +++ b/imageroot/etc/dashboards/network_traffic_by_client.json @@ -0,0 +1,1042 @@ +{ + "__inputs": [ + { + "name": "DS_LOCAL_TIMESCALE", + "label": "Local Timescale", + "description": "", + "type": "datasource", + "pluginId": "grafana-postgresql-datasource", + "pluginName": "PostgreSQL" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "panel", + "id": "barchart", + "name": "Bar chart", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.2.0" + }, + { + "type": "datasource", + "id": "grafana-postgresql-datasource", + "name": "PostgreSQL", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": false, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [ + { + "asDropdown": false, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "unit" + ], + "targetBlank": false, + "title": "New link", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], + "liveNow": false, + "panels": [ + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 7, + "x": 0, + "y": 0 + }, + "id": 6, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^client_name$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT client_name \nFROM ca_dpi_stats_hourly_client\nWHERE $__timeFilter(bucket) AND uuid = '$uuid' AND client_address = '$client_address'", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Hostname", + "type": "stat" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-GrYlRd" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 17, + "x": 7, + "y": 0 + }, + "id": 5, + "options": { + "barRadius": 0, + "barWidth": 0.97, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "orientation": "auto", + "showValue": "auto", + "stacking": "none", + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 0 + }, + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT bucket, bytes \nFROM ca_dpi_stats_hourly_client\nWHERE $__timeFilter(bucket) AND uuid = '$uuid' AND client_address = '$client_address'", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Traffic by hour", + "type": "barchart" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 7, + "x": 0, + "y": 3 + }, + "id": 2, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT bytes \nFROM ca_dpi_stats_hourly_client\nWHERE $__timeFilter(bucket) AND uuid = '$uuid' AND client_address = '$client_address'", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Total traffic", + "type": "stat" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 3, + "options": { + "barRadius": 0, + "barWidth": 0.89, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": true + }, + "orientation": "horizontal", + "showValue": "always", + "stacking": "none", + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 100 + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT REPLACE(application, 'netify.', '') as application, SUM(bytes) AS BYTES FROM dpi_stats \nWHERE application!='' AND $__timeFilter(time) AND client_address like '$client_address' AND uuid = '$uuid'\nGROUP BY application\nORDER BY bytes desc\nLIMIT 10", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Top 10 applications", + "type": "barchart" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 12, + "x": 12, + "y": 9 + }, + "id": 7, + "options": { + "barRadius": 0, + "barWidth": 0.97, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right", + "showLegend": true + }, + "orientation": "horizontal", + "showValue": "always", + "stacking": "none", + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 100 + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT protocol, SUM(bytes) FROM dpi_stats \nWHERE protocol!='' AND $__timeFilter(time) AND client_address like '$client_address' AND uuid = '$uuid'\nGROUP BY protocol", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Top 10 protocols", + "type": "barchart" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 24, + "x": 0, + "y": 20 + }, + "id": 10, + "options": { + "barRadius": 0, + "barWidth": 0.88, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "orientation": "horizontal", + "showValue": "auto", + "stacking": "none", + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 100 + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT host, SUM(bytes) as bytes FROM dpi_stats \nWHERE host!='' AND $__timeFilter(time) AND uuid = '$uuid' AND client_address like '$client_address'\nGROUP BY host\nORDER BY bytes DESC\nLIMIT 10", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Top 10 remote hosts", + "type": "barchart" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 13, + "w": 12, + "x": 0, + "y": 32 + }, + "id": 8, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": true + }, + "showHeader": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT REPLACE(application, 'netify.', '') as application, SUM(bytes) as bytes FROM dpi_stats \nWHERE application!='' AND $__timeFilter(time) AND client_address like '$client_address' AND uuid = '$uuid'\nGROUP BY application\nORDER BY bytes DESC", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Traffic by application", + "type": "table" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 13, + "w": 12, + "x": 12, + "y": 32 + }, + "id": 9, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": true + }, + "showHeader": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT protocol, SUM(bytes) as bytes FROM dpi_stats \nWHERE protocol!='' AND $__timeFilter(time) AND client_address like '$client_address' AND uuid = '$uuid'\nGROUP BY protocol\nORDER BY bytes DESC", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Traffic by protocol", + "type": "table" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 0, + "y": 45 + }, + "id": 1, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": true + }, + "showHeader": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT host, SUM(bytes) as bytes FROM dpi_stats \nWHERE host!='' AND $__timeFilter(time) AND uuid = '$uuid' AND client_address like '$client_address'\nGROUP BY host\nORDER BY bytes DESC", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Traffic by host", + "type": "table" + } + ], + "refresh": "", + "schemaVersion": 39, + "tags": [ + "monitoring", + "unit", + "timescale" + ], + "templating": { + "list": [ + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "definition": "SELECT uuid AS __value, name AS __text FROM units", + "description": "", + "hide": 0, + "includeAll": false, + "label": "Unit", + "multi": false, + "name": "uuid", + "options": [], + "query": "SELECT uuid AS __value, name AS __text FROM units", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "", + "value": "" + }, + "hide": 0, + "name": "client_address", + "options": [ + { + "selected": true, + "text": "", + "value": "" + } + ], + "query": "%", + "skipUrlSync": false, + "type": "textbox" + }, + { + "current": {}, + "hide": 2, + "includeAll": false, + "label": "Local Timescale", + "multi": false, + "name": "DS_TIMESCALE", + "options": [], + "query": "grafana-postgresql-datasource", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Network traffic by client", + "uid": "b14a1181-a2ee-4df4-a732-888e0190037f", + "version": 25, + "weekStart": "" +} \ No newline at end of file diff --git a/imageroot/etc/dashboards/network_traffic_by_host.json b/imageroot/etc/dashboards/network_traffic_by_host.json new file mode 100644 index 0000000..82c7c8c --- /dev/null +++ b/imageroot/etc/dashboards/network_traffic_by_host.json @@ -0,0 +1,560 @@ +{ + "__inputs": [ + { + "name": "DS_LOCAL_TIMESCALE", + "label": "Local Timescale", + "description": "", + "type": "datasource", + "pluginId": "grafana-postgresql-datasource", + "pluginName": "PostgreSQL" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "panel", + "id": "barchart", + "name": "Bar chart", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.2.0" + }, + { + "type": "datasource", + "id": "grafana-postgresql-datasource", + "name": "PostgreSQL", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": false, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [ + { + "asDropdown": false, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "unit" + ], + "targetBlank": false, + "title": "New link", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], + "liveNow": false, + "panels": [ + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT bytes FROM ca_dpi_stats_hourly_host\nWHERE $__timeFilter(bucket) AND uuid = '$uuid' AND host like '$host'", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Total traffic", + "type": "stat" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 16, + "x": 8, + "y": 0 + }, + "id": 3, + "options": { + "barRadius": 0, + "barWidth": 0.97, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "orientation": "auto", + "showValue": "always", + "stacking": "none", + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 100 + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT bucket, sum(bytes) as bytes FROM ca_dpi_stats_hourly_host\nWHERE $__timeFilter(bucket) AND uuid = '$uuid' AND host like '$host'\nGROUP BY bucket\nORDER BY bucket", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Traffic by hour", + "type": "barchart" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 8 + }, + "id": 5, + "options": { + "barRadius": 0, + "barWidth": 0.97, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "orientation": "auto", + "showValue": "always", + "stacking": "none", + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 100 + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\n time_bucket('30m', time) AS time,\n client_address as client,\n SUM(bytes) AS value\nFROM dpi_stats\nWHERE $__timeFilter(time) AND host LIKE '$host' AND uuid = '$uuid'\nGROUP BY time, client\nORDER BY time", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Traffic by hour per client", + "transformations": [ + { + "id": "partitionByValues", + "options": { + "fields": [ + "client" + ], + "naming": { + "asLabels": true + } + } + } + ], + "type": "barchart" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 14, + "w": 24, + "x": 0, + "y": 17 + }, + "id": 4, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": true + }, + "showHeader": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT client_address, client_name, SUM(bytes) as bytes FROM dpi_stats \nWHERE $__timeFilter(time) AND uuid = '$uuid' AND host LIKE '$host'\nGROUP BY client_address, client_name\nORDER BY bytes DESC", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Total traffic by client", + "type": "table" + } + ], + "refresh": "", + "schemaVersion": 39, + "tags": [ + "monitoring", + "timescale", + "unit" + ], + "templating": { + "list": [ + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "definition": "SELECT uuid AS __value, name AS __text FROM units", + "hide": 0, + "includeAll": false, + "label": "Unit", + "multi": false, + "name": "uuid", + "options": [], + "query": "SELECT uuid AS __value, name AS __text FROM units", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "pod-031-2010-09.backblaze.com", + "value": "pod-031-2010-09.backblaze.com" + }, + "hide": 0, + "name": "host", + "options": [], + "query": "%", + "skipUrlSync": false, + "type": "textbox" + }, + { + "current": {}, + "hide": 2, + "includeAll": false, + "label": "Local Timescale", + "multi": false, + "name": "DS_TIMESCALE", + "options": [], + "query": "grafana-postgresql-datasource", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Network traffic by remote host", + "uid": "c8d43e5f-068e-4cac-9283-2318d9e1911b", + "version": 19, + "weekStart": "" +} \ No newline at end of file diff --git a/imageroot/etc/dashboards/security.json b/imageroot/etc/dashboards/security.json new file mode 100644 index 0000000..7835444 --- /dev/null +++ b/imageroot/etc/dashboards/security.json @@ -0,0 +1,1582 @@ +{ + "__inputs": [ + { + "name": "DS_LOCAL_TIMESCALE", + "label": "Local Timescale", + "description": "", + "type": "datasource", + "pluginId": "grafana-postgresql-datasource", + "pluginName": "PostgreSQL" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "panel", + "id": "barchart", + "name": "Bar chart", + "version": "" + }, + { + "type": "panel", + "id": "geomap", + "name": "Geomap", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.2.0" + }, + { + "type": "datasource", + "id": "grafana-postgresql-datasource", + "name": "PostgreSQL", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "piechart", + "name": "Pie chart", + "version": "" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": false, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [ + { + "asDropdown": false, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "unit" + ], + "targetBlank": false, + "title": "New link", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "description": "", + "gridPos": { + "h": 3, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 14, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "# Threats\n\nBlocked IPs based on loaded blocklist categories.", + "mode": "markdown" + }, + "pluginVersion": "11.2.0", + "type": "text" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 5, + "x": 0, + "y": 3 + }, + "id": 3, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT count(*) FROM ca_ts_malware_hourly_direction\nWHERE $__timeFilter(bucket) AND uuid = '$uuid'", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Blocked threats", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 7, + "x": 5, + "y": 3 + }, + "id": 6, + "options": { + "barRadius": 0, + "barWidth": 0.7, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "orientation": "horizontal", + "showValue": "always", + "stacking": "normal", + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 100 + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT src, count(*) AS count FROM ca_ts_malware_hourly_direction\nWHERE $__timeFilter(bucket) AND uuid = '$uuid'\nGROUP by src\nORDER by count DESC\nLIMIT 10", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Top 10 blocked threats by IPs", + "type": "barchart" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [] + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 12, + "y": 3 + }, + "id": 4, + "options": { + "legend": { + "displayMode": "list", + "placement": "right", + "showLegend": true, + "values": [ + "value" + ] + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^sum$/", + "values": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT chain, SUM(count) FROM ca_ts_malware_hourly_chain\nWHERE $__timeFilter(bucket) AND uuid = '$uuid'\nGROUP by chain", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Blocked threats by chain", + "type": "piechart" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [] + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 18, + "y": 3 + }, + "id": 8, + "options": { + "legend": { + "displayMode": "list", + "placement": "right", + "showLegend": true + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^sum$/", + "values": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT category, SUM(count) FROM ca_ts_malware_hourly_category\nWHERE $__timeFilter(bucket) AND uuid = '$uuid'\nGROUP by category", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Blocked threats by category", + "type": "piechart" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 13, + "w": 12, + "x": 0, + "y": 11 + }, + "id": 1, + "options": { + "basemap": { + "config": {}, + "name": "Layer 0", + "type": "default" + }, + "controls": { + "mouseWheelZoom": true, + "showAttribution": true, + "showDebug": false, + "showMeasure": false, + "showScale": false, + "showZoom": true + }, + "layers": [ + { + "config": { + "showLegend": true, + "style": { + "color": { + "field": "count", + "fixed": "dark-green" + }, + "opacity": 0.4, + "rotation": { + "fixed": 0, + "max": 360, + "min": -360, + "mode": "mod" + }, + "size": { + "fixed": 5, + "max": 15, + "min": 2 + }, + "symbol": { + "fixed": "img/icons/marker/circle.svg", + "mode": "fixed" + }, + "symbolAlign": { + "horizontal": "center", + "vertical": "center" + }, + "textConfig": { + "fontSize": 12, + "offsetX": 0, + "offsetY": 0, + "textAlign": "center", + "textBaseline": "middle" + } + } + }, + "location": { + "lookup": "lookup", + "mode": "auto" + }, + "name": "Blocked", + "tooltip": true, + "type": "markers" + } + ], + "tooltip": { + "mode": "details" + }, + "view": { + "allLayers": true, + "id": "fit", + "lat": 0, + "lon": 0, + "zoom": 15 + } + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT count(*) as count, country AS lookup FROM ca_ts_malware_hourly_country\nWHERE $__timeFilter(bucket) AND uuid = '$uuid'\nGROUP BY country", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Blocked threats", + "type": "geomap" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 13, + "w": 12, + "x": 12, + "y": 11 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT bucket, count(*) FROM ca_ts_malware_hourly_direction\nWHERE $__timeFilter(bucket) AND uuid = '$uuid'\nGROUP by bucket", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Blocked threats by time", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "description": "", + "gridPos": { + "h": 3, + "w": 24, + "x": 0, + "y": 24 + }, + "id": 15, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "# Attacks\n\nBlocked IPs based on brute force attacks.", + "mode": "markdown" + }, + "pluginVersion": "11.2.0", + "type": "text" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 5, + "x": 0, + "y": 27 + }, + "id": 9, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT count(*) FROM ts_attacks \nWHERE $__timeFilter(time) AND uuid = '$uuid'", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Blocked attacks", + "type": "stat" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 9, + "x": 5, + "y": 27 + }, + "id": 7, + "options": { + "barRadius": 0, + "barWidth": 0.88, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "orientation": "horizontal", + "showValue": "always", + "stacking": "none", + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 100 + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT country, count(*) as count FROM ts_attacks \nWHERE $__timeFilter(time) AND uuid = '$uuid'\nGROUP BY country\nORDER BY count DESC\nLIMIT 10\n", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Top 10 blocked attack by country", + "type": "barchart" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 10, + "x": 14, + "y": 27 + }, + "id": 16, + "options": { + "barRadius": 0, + "barWidth": 0.8, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "orientation": "horizontal", + "showValue": "always", + "stacking": "none", + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 100 + }, + "pluginVersion": "10.3.3", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT ip, count(*) as count FROM ts_attacks\nWHERE $__timeFilter(time) AND uuid = '$uuid'\nGROUP BY ip\nORDER BY count DESC\nLIMIT 10", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Top 10 blocked attacks by IP", + "type": "barchart" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 13, + "w": 12, + "x": 0, + "y": 38 + }, + "id": 11, + "options": { + "basemap": { + "config": {}, + "name": "Layer 0", + "type": "default" + }, + "controls": { + "mouseWheelZoom": true, + "showAttribution": true, + "showDebug": false, + "showMeasure": false, + "showScale": false, + "showZoom": true + }, + "layers": [ + { + "config": { + "showLegend": true, + "style": { + "color": { + "field": "count", + "fixed": "dark-green" + }, + "opacity": 0.4, + "rotation": { + "fixed": 0, + "max": 360, + "min": -360, + "mode": "mod" + }, + "size": { + "fixed": 5, + "max": 15, + "min": 2 + }, + "symbol": { + "fixed": "img/icons/marker/circle.svg", + "mode": "fixed" + }, + "symbolAlign": { + "horizontal": "center", + "vertical": "center" + }, + "textConfig": { + "fontSize": 12, + "offsetX": 0, + "offsetY": 0, + "textAlign": "center", + "textBaseline": "middle" + } + } + }, + "location": { + "lookup": "lookup", + "mode": "auto" + }, + "name": "Blocked", + "tooltip": true, + "type": "markers" + } + ], + "tooltip": { + "mode": "details" + }, + "view": { + "allLayers": true, + "id": "fit", + "lat": 0, + "lon": 0, + "zoom": 15 + } + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT count(*) as count, country AS lookup FROM ca_ts_attacks_hourly \nWHERE $__timeFilter(bucket) AND uuid = '$uuid'\nGROUP BY country", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Blocked attacks", + "type": "geomap" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 13, + "w": 12, + "x": 12, + "y": 38 + }, + "id": 12, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT bucket, count(*) FROM ca_ts_attacks_hourly\nWHERE $__timeFilter(bucket) AND uuid = '$uuid'\nGROUP by bucket", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Blocked attacks by hour", + "type": "timeseries" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 0, + "y": 51 + }, + "id": 13, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": true + }, + "showHeader": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT country, count(*) FROM ca_ts_malware_hourly_country\nWHERE $__timeFilter(bucket) AND uuid = '$uuid'\nGROUP BY country\nORDER BY count DESC", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Blocked by countries", + "type": "table" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 12, + "y": 51 + }, + "id": 17, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": true + }, + "showHeader": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT ip, count(*) as count FROM ts_attacks\nWHERE $__timeFilter(time) AND uuid = '$uuid'\nGROUP BY ip\nORDER BY count DESC\nLIMIT 20", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Blocked by IP", + "type": "table" + } + ], + "refresh": "", + "schemaVersion": 39, + "tags": [ + "monitoring", + "unit", + "timescale" + ], + "templating": { + "list": [ + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "definition": "SELECT uuid AS __value, name AS __text FROM units", + "description": "", + "hide": 0, + "includeAll": false, + "label": "Unit", + "multi": false, + "name": "uuid", + "options": [], + "query": "SELECT uuid AS __value, name AS __text FROM units", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "hide": 2, + "includeAll": false, + "label": "Local Timescale", + "multi": false, + "name": "DS_TIMESCALE", + "options": [], + "query": "grafana-postgresql-datasource", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Security", + "uid": "dd395331-5dc0-4172-b243-8646c0ca3ccd", + "version": 28, + "weekStart": "" +} \ No newline at end of file diff --git a/imageroot/etc/dashboards/vpn.json b/imageroot/etc/dashboards/vpn.json new file mode 100644 index 0000000..3330814 --- /dev/null +++ b/imageroot/etc/dashboards/vpn.json @@ -0,0 +1,1388 @@ +{ + "__inputs": [ + { + "name": "DS_LOCAL_TIMESCALE", + "label": "Local Timescale", + "description": "", + "type": "datasource", + "pluginId": "grafana-postgresql-datasource", + "pluginName": "PostgreSQL" + }, + { + "name": "DS_LOCAL_PROMETHUS", + "label": "Local Promethus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "panel", + "id": "barchart", + "name": "Bar chart", + "version": "" + }, + { + "type": "panel", + "id": "geomap", + "name": "Geomap", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.2.0" + }, + { + "type": "datasource", + "id": "grafana-postgresql-datasource", + "name": "PostgreSQL", + "version": "1.0.0" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": false, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [ + { + "asDropdown": false, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "unit" + ], + "targetBlank": false, + "title": "New link", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "panels": [], + "repeat": "instance", + "repeatDirection": "h", + "title": "OpenVPN Road Warrior instance: $rwinstance", + "type": "row" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 7, + "x": 0, + "y": 1 + }, + "id": 1, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT count(*) FROM ovpnrw_connections\nWHERE $__timeFilter(time) AND uuid = '$uuid' AND instance = $rwinstance", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Number of connections", + "type": "stat" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 17, + "x": 7, + "y": 1 + }, + "id": 3, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT time, count(*) FROM ovpnrw_connections\nWHERE $__timeFilter(time) AND uuid = '$uuid' AND instance = $rwinstance\nGROUP BY time", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Connections by time", + "type": "timeseries" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 7, + "x": 0, + "y": 9 + }, + "id": 5, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT SUM(bytes_sent) + SUM(bytes_received) as bytes FROM ca_ovpnrw_connections_hourly_bytes\nWHERE $__timeFilter(bucket) AND uuid = '$uuid' AND instance = $rwinstance\n", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Total traffic", + "type": "stat" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 17, + "x": 7, + "y": 9 + }, + "id": 6, + "options": { + "barRadius": 0, + "barWidth": 0.88, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "orientation": "horizontal", + "showValue": "always", + "stacking": "none", + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 100 + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT SUM(bytes_sent) + SUM(bytes_received) as bytes, common_name as user FROM ca_ovpnrw_connections_hourly_bytes\nWHERE $__timeFilter(bucket) AND uuid = '$uuid' AND instance = $rwinstance\nGROUP BY common_name\nORDER by bytes DESC\nLIMIT 20", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Top 20 user by traffic", + "type": "barchart" + }, + { + "datasource": { + "default": false, + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "Kbits" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 17 + }, + "id": 15, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_LOCAL_PROMETHUS}" + }, + "editorMode": "code", + "expr": "netdata_net_net_kilobits_persec_average{unit=~'$uuid',chart=~'net.$rwinterface'}", + "instant": false, + "legendFormat": "{{dimension}}", + "range": true, + "refId": "A" + } + ], + "title": "Interface $rwinterface traffic", + "type": "timeseries" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 11, + "x": 0, + "y": 25 + }, + "id": 4, + "options": { + "basemap": { + "config": {}, + "name": "Layer 0", + "type": "default" + }, + "controls": { + "mouseWheelZoom": true, + "showAttribution": true, + "showDebug": false, + "showMeasure": false, + "showScale": false, + "showZoom": true + }, + "layers": [ + { + "config": { + "showLegend": true, + "style": { + "color": { + "fixed": "dark-green" + }, + "opacity": 0.4, + "rotation": { + "fixed": 0, + "max": 360, + "min": -360, + "mode": "mod" + }, + "size": { + "fixed": 5, + "max": 15, + "min": 2 + }, + "symbol": { + "fixed": "img/icons/marker/circle.svg", + "mode": "fixed" + }, + "symbolAlign": { + "horizontal": "center", + "vertical": "center" + }, + "textConfig": { + "fontSize": 12, + "offsetX": 0, + "offsetY": 0, + "textAlign": "center", + "textBaseline": "middle" + } + } + }, + "location": { + "mode": "auto" + }, + "name": "Country", + "tooltip": true, + "type": "markers" + } + ], + "tooltip": { + "mode": "details" + }, + "view": { + "allLayers": true, + "id": "zero", + "lat": 0, + "lon": 0, + "zoom": 1 + } + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT count(*) AS count, country AS lookup FROM ovpnrw_connections\nWHERE $__timeFilter(time) AND uuid = '$uuid' AND instance = $rwinstance\nGROUP BY lookup", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Public IP connections", + "type": "geomap" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-GrYlRd" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 13, + "x": 11, + "y": 25 + }, + "id": 14, + "options": { + "barRadius": 0, + "barWidth": 0.97, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "orientation": "auto", + "showValue": "auto", + "stacking": "none", + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 100 + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT bucket, SUM(bytes_sent) + SUM(bytes_received) as bytes FROM ca_ovpnrw_connections_hourly_bytes\nWHERE $__timeFilter(bucket) AND uuid = '$uuid' AND instance = $rwinstance\nGROUP BY bucket\nORDER BY bucket \n", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Traffic by hour", + "type": "barchart" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 35 + }, + "id": 7, + "options": { + "barRadius": 0, + "barWidth": 0.97, + "fullHighlight": false, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "orientation": "vertical", + "showValue": "auto", + "stacking": "none", + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 0 + }, + "pluginVersion": "11.2.0", + "repeat": "user", + "repeatDirection": "h", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT bucket, SUM(bytes_sent) + SUM(bytes_received) as bytes FROM ca_ovpnrw_connections_hourly_bytes\nWHERE $__timeFilter(bucket) AND uuid = '$uuid' AND instance = $rwinstance AND common_name like $user\n AND (bytes_sent + bytes_received) > 0\nGROUP BY bucket\nORDER BY bucket", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Traffic by user: $user", + "type": "barchart" + }, + { + "datasource": { + "default": false, + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "bytes_received" + }, + "properties": [ + { + "id": "unit", + "value": "decbytes" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "bytes_sent" + }, + "properties": [ + { + "id": "unit", + "value": "decbytes" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "duration" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 43 + }, + "id": 23, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true + }, + "pluginVersion": "11.2.0", + "targets": [ + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT common_name, TO_TIMESTAMP(start_time) AS start_time, duration, TO_TIMESTAMP(start_time + duration) AS end_time, bytes_received, bytes_sent, virtual_ip_addr, remote_ip_addr\nFROM ovpnrw_connections\nWHERE uuid = '$uuid' AND instance = $rwinstance AND $__timeFilter(time) ", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Connection details: $rwinstance", + "type": "table" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 51 + }, + "id": 17, + "panels": [], + "title": "OpenVPN tunnels", + "type": "row" + }, + { + "datasource": { + "default": false, + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "Kbits" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 52 + }, + "id": 18, + "options": { + "legend": { + "calcs": [], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_LOCAL_PROMETHUS}" + }, + "editorMode": "code", + "expr": "netdata_net_net_kilobits_persec_average{unit=~'$uuid',chart=~'net.$tuninterface'}", + "instant": false, + "legendFormat": "{{dimension}}", + "range": true, + "refId": "A" + } + ], + "title": "Interface $tuninterface traffic", + "type": "timeseries" + } + ], + "refresh": "", + "schemaVersion": 39, + "tags": [ + "timescale", + "unit", + "monitoring" + ], + "templating": { + "list": [ + { + "current": {}, + "hide": 2, + "includeAll": false, + "label": "Local Timescale", + "multi": false, + "name": "DS_TIMESCALE", + "options": [], + "query": "grafana-postgresql-datasource", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "definition": "SELECT uuid AS __value, name AS __text FROM units", + "hide": 0, + "includeAll": false, + "label": "Unit", + "multi": false, + "name": "uuid", + "options": [], + "query": "SELECT uuid AS __value, name AS __text FROM units", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "definition": "SELECT instance AS __value, CONCAT(name,' (',instance,')') AS __text FROM openvpn_config WHERE uuid = '$uuid' AND type = 'rw'", + "description": "", + "hide": 0, + "includeAll": true, + "label": "Road Warrior server", + "multi": false, + "name": "rwinstance", + "options": [], + "query": "SELECT instance AS __value, CONCAT(name,' (',instance,')') AS __text FROM openvpn_config WHERE uuid = '$uuid' AND type = 'rw'", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "hide": 2, + "includeAll": false, + "label": "Local Prometheus", + "multi": false, + "name": "DS_PROMETHEUS", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "allValue": "%", + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "definition": "SELECT common_name as __value FROM ovpnrw_connections WHERE uuid = '$uuid'", + "hide": 0, + "includeAll": true, + "label": "User", + "multi": false, + "name": "user", + "options": [], + "query": "SELECT common_name as __value FROM ovpnrw_connections WHERE uuid = '$uuid'", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "definition": "SELECT device AS __value FROM openvpn_config WHERE uuid = '$uuid' AND instance = $rwinstance", + "hide": 2, + "includeAll": false, + "multi": false, + "name": "rwinterface", + "options": [], + "query": "SELECT device AS __value FROM openvpn_config WHERE uuid = '$uuid' AND instance = $rwinstance", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_TIMESCALE}" + }, + "definition": "SELECT instance AS __value, CONCAT(name,' (',instance,')') AS __text FROM openvpn_config WHERE uuid = '$uuid' AND type IN ('server', 'client')", + "description": "", + "hide": 0, + "includeAll": true, + "label": "Tunnels", + "multi": false, + "name": "tunnel", + "options": [], + "query": "SELECT instance AS __value, CONCAT(name,' (',instance,')') AS __text FROM openvpn_config WHERE uuid = '$uuid' AND type IN ('server', 'client')", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "${DS_LOCAL_TIMESCALE}" + }, + "definition": "SELECT device AS __value FROM openvpn_config WHERE uuid = '$uuid' AND instance = '$tunnel'", + "hide": 2, + "includeAll": false, + "multi": false, + "name": "tuninterface", + "options": [], + "query": "SELECT device AS __value FROM openvpn_config WHERE uuid = '$uuid' AND instance = '$tunnel'", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-7d", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "VPN", + "uid": "fdxlb58zxvpj4f", + "version": 69, + "weekStart": "" +} \ No newline at end of file diff --git a/imageroot/etc/state-include.conf b/imageroot/etc/state-include.conf index c2d26fe..3e12002 100644 --- a/imageroot/etc/state-include.conf +++ b/imageroot/etc/state-include.conf @@ -1,8 +1,9 @@ volumes/vpn-data volumes/grafana-data volumes/loki-data -volumns/prometheus-data +volumes/prometheus-data volumes/api-credentials volumes/api-data state/secret.env state/config.json +state/backup.sql diff --git a/imageroot/systemd/user/api.service b/imageroot/systemd/user/api.service index bb50911..f2b9125 100644 --- a/imageroot/systemd/user/api.service +++ b/imageroot/systemd/user/api.service @@ -25,6 +25,8 @@ ExecStart=/usr/bin/podman run \ --env-file=%S/state/config.env \ --env-file=%S/state/promtail.env \ --env-file=%S/state/subscription.env \ + --env-file=%S/state/db.env \ + --env 'GIN_MODE=release' \ ${NETHSECURITY_API_IMAGE} ExecStop=/usr/bin/podman stop --ignore --cidfile %t/api.ctr-id -t 10 ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/api.ctr-id diff --git a/imageroot/systemd/user/controller.service b/imageroot/systemd/user/controller.service index 8839724..7c1a94c 100644 --- a/imageroot/systemd/user/controller.service +++ b/imageroot/systemd/user/controller.service @@ -1,7 +1,7 @@ [Unit] Description=Podman controller.service -Requires=vpn.service api.service ui.service proxy.service promtail.service metrics-exporter.path loki.service prometheus.service grafana.service webssh.service -Before=vpn.service api.service ui.service proxy.service promtail.service metrics-exporter.path loki.service prometheus.service grafana.service webssh.service +Requires=vpn.service api.service ui.service proxy.service promtail.service metrics-exporter.path loki.service prometheus.service grafana.service webssh.service timescale.service +Before=vpn.service api.service ui.service proxy.service promtail.service metrics-exporter.path loki.service prometheus.service grafana.service webssh.service timescale.service ConditionPathExists=%S/state/environment ConditionPathExists=%S/state/network.env diff --git a/imageroot/systemd/user/timescale.service b/imageroot/systemd/user/timescale.service new file mode 100644 index 0000000..5e6157e --- /dev/null +++ b/imageroot/systemd/user/timescale.service @@ -0,0 +1,31 @@ +[Unit] +Description=Podman timescale.service +BindsTo=controller.service +Before=api.service + +[Service] +Environment=PODMAN_SYSTEMD_UNIT=%n +EnvironmentFile=%S/state/environment +EnvironmentFile=%S/state/secret.env +EnvironmentFile=%S/state/db.env +WorkingDirectory=%S/state +Restart=always +TimeoutStopSec=70 +ExecStartPre=/bin/rm -f %t/timescale.pid %t/timescale.ctr-id +ExecStart=/usr/bin/podman run \ + --conmon-pidfile %t/timescale.pid \ + --cidfile %t/timescale.ctr-id \ + --cgroups=no-conmon \ + --pod-id-file %t/controller.pod-id \ + --replace -d --name timescale \ + --volume=timescale-data:/var/lib/postgresql/data:z \ + --env-file=%S/state/db.env \ + --network=host \ + ${TIMESCALEDB_IMAGE} -p ${POSTGRES_PORT} -h 127.0.0.1 +ExecStop=/usr/bin/podman stop --ignore --cidfile %t/timescale.ctr-id -t 10 +ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/timescale.ctr-id +PIDFile=%t/timescale.pid +Type=forking + +[Install] +WantedBy=default.target diff --git a/imageroot/systemd/user/webssh.service b/imageroot/systemd/user/webssh.service index 733216f..bdb0c8f 100644 --- a/imageroot/systemd/user/webssh.service +++ b/imageroot/systemd/user/webssh.service @@ -2,7 +2,7 @@ [Unit] Description=Podman webssh.service BindsTo=controller.service -After=vpm.service +After=vpn.service [Service] Environment=PODMAN_SYSTEMD_UNIT=%n diff --git a/ui/public/i18n/en/translation.json b/ui/public/i18n/en/translation.json index c7ca787..26c1818 100644 --- a/ui/public/i18n/en/translation.json +++ b/ui/public/i18n/en/translation.json @@ -38,7 +38,8 @@ "loki_retention": "Logs retention", "loki_retention_helper": "Days to keep logs in Loki", "prometheus_retention": "Metrics retention", - "prometheus_retention_helper": "Days to keep metrics in Prometheus", + "prometheus_retention_helper": "Days to keep metrics in Prometheus and Timescale", + "prometheus_retention_tooltip": "Timescale is a time-series database used to store metrics. It is used by the controller to store and aggregate additional metrics on top of the metrics provided by Prometheus.", "cn_helper": "The name of the controller, used to create the VPN certification authority", "network_helper": "The VPN network used to connect the units to the controller.", "user_helper": "This is the only user that can create and manage other users inside the controller", @@ -53,7 +54,9 @@ "password_placeholder": "Password can be modified from the controller webapp", "password_information_title": "Default password", "password_information_description": "The default administrator password is displayed only once, please store it in a safe place", - "vpn_port_description": "Units will connect to controller using a VPN connection. Make sure the units can reach the controller on UDP port {port}" + "vpn_port_description": "Units will connect to controller using a VPN connection. Make sure the units can reach the controller on UDP port {port}", + "maxmind_license": "MaxMind license key", + "maxmind_license_helper": "The license key is required to use the MaxMind GeoIP2 database" }, "about": { "title": "About" diff --git a/ui/src/views/Settings.vue b/ui/src/views/Settings.vue index 674514a..e2f2189 100644 --- a/ui/src/views/Settings.vue +++ b/ui/src/views/Settings.vue @@ -96,6 +96,19 @@ :invalid-message="$t(error.prometheus_retention)" type="number" :label="$t('settings.prometheus_retention')" :helper-text="$t('settings.prometheus_retention_helper')" :disabled="loading.configureModule"> + + + @@ -151,6 +164,7 @@ export default { firstConfig: true, loki_retention: "180", prometheus_retention: "15", + maxmind_license: "", passwordPlaceholder: "", loading: { getConfiguration: false, @@ -168,6 +182,7 @@ export default { cn: "", loki_retention: "", prometheus_retention: "", + maxmind_license: "", }, }; }, @@ -249,6 +264,7 @@ export default { this.password = config.api_password; this.loki_retention = config.loki_retention.toString(); this.prometheus_retention = config.prometheus_retention.toString(); + this.maxmind_license = config.maxmind_license; this.vpn_port = config.vpn_port; this.focusElement("host"); @@ -386,6 +402,7 @@ export default { api_user: this.user, loki_retention: parseInt(this.loki_retention), prometheus_retention: parseInt(this.prometheus_retention), + maxmind_license: this.maxmind_license, }; if (this.password) { params.api_password = this.password;