In dieser Anleitung zeige ich, wie ihr die Metrics eurer Nextcloud-Installation in Grafana über ein grafisches Dashboard darstellen könnt.
0. Grundvoraussetzungen
- Docker & Docker Compose v2 (Debian / Ubuntu)
- NEXTCLOUD SERVER – MIT DOCKER COMPOSE UND TRAEFIK INSTALLIEREN
- GRAFANA – MIT DOCKER COMPOSE UND TRAEFIK INSTALLIEREN
1. Nextcloud vorbereiten
1.1 Docker-compose.yml anpassen
Wir werden den Container “nextcloud-exporter” einsetzen, um die Metrics-Daten der Nextcloud auszulesen. Daher erstellen wir ein monitoring-Netzwerk, über das dieser Container mit der Nextcloud-App kommunizieren kann.
nano /opt/containers/nextcloud/docker-compose.yml
Füge die markierten Zeilen hinzu:
nextcloud-app: image: nextcloud . . . networks: - proxy - default - monitoring # <=== Diese Zeile hinzufügen networks: proxy: external: true monitoring: # <=== Diese Zeile hinzufügen name: monitoring # <=== Diese Zeile hinzufügen driver: bridge # <=== Diese Zeile hinzufügen attachable: true # <=== Diese Zeile hinzufügen
1.2 Nextcloud config.php anpassen
sudo nano /opt/containers/nextcloud/app/config/config.php
Nach der Zeile ‘trusted domains =>’ suchen und die folgende Zeile hinzufügen:
'trusted_domains' => array ( 0 => 'cloud.mgfportal.de', 1 => 'nextcloud-app', # <==== Diese Zeile hinzufügen ),
1.3 Nextcloud Authentifizierung
Nextcloud in der Version 22 und höher unterstützen “Token-Authentifikation” für die Server-Infos.
Generiere zunächst einen Zufalls-Wert:
TOKEN=$(openssl rand -hex 32)
Setze den Token mittels OCC-Command:
docker exec -it --user www-data nextcloud-app /var/www/html/occ config:app:set serverinfo token --value "$TOKEN"
Mögliche Ausgabe:
Config value token for app serverinfo set to 8cdbfxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Wichtig: Ausgegebenen Token in einen Texteditor kopieren!
2. Nextcloud-exporter zur docker-compose.yml von Grafana hinzufügen
Ergänze den Grafana-Stack um einen weiteren Container:
nano /opt/containers/grafana/docker-compose.yml
mon_nextcloud-exporter: image: xperimental/nextcloud-exporter:latest container_name: mon_nextcloud-exporter restart: unless-stopped environment: - NEXTCLOUD_SERVER=http://nextcloud-app - NEXTCLOUD_AUTH_TOKEN=8cdbfxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx networks: - default - monitoring
Passe den Token in Zeile 7 entsprechend deiner Ausgabe an!
Weitere Anpassungen in der Datei:
mon_prometheus: image: prom/prometheus:latest container_name: mon_prometheus restart: unless-stopped volumes: - ./prometheus:/etc/prometheus - prometheus_data:/prometheus # <=== Diese Zeile hinzufügen command: - --config.file=/etc/prometheus/prometheus.yml depends_on: - mon_node-exporter - mon_cadvisor - mon_nextcloud-exporter # <=== Diese Zeile hinzufügen networks: - default - crowdsec . . . volumes: # <=== Diese Zeile hinzufügen prometheus_data: # <=== Diese Zeile hinzufügen networks: proxy: external: true crowdsec: external: true monitoring: # <=== Diese Zeile hinzufügen external: true # <=== Diese Zeile hinzufügen
3. Prometheus Konfigurationsdatei anpassen
Prometheus anweisen, die Daten vom Nextcloud-exporter zu holen:
nano /opt/containers/grafana/prometheus/prometheus.yml
Am Ende der Datei folgendes einfügen:
- job_name: 'nextcloud' scrape_interval: 90s static_configs: - targets: ['mon_nextcloud-exporter:9205']
5. Container neu starten
docker compose -f /opt/containers/nextcloud/docker-compose.yml down docker compose -f /opt/containers/nextcloud/docker-compose.yml up -d
docker compose -f /opt/containers/grafana/docker-compose.yml down docker compose -f /opt/containers/grafana/docker-compose.yml up -d
6. Grafana Dashboard(s) hinzufügen
Ich habe zwei fertige Dashboards gefunden, die ihr genauso, wie Christian es in seinem Grafana-Artikel beschrieben hat, einfügen könnt.
6.1 Dashboard No. 1
{ "__inputs": [], "__requires": [ { "type": "panel", "id": "gauge", "name": "Gauge", "version": "" }, { "type": "grafana", "id": "grafana", "name": "Grafana", "version": "6.2.5" }, { "type": "panel", "id": "graph", "name": "Graph", "version": "" }, { "type": "panel", "id": "singlestat", "name": "Singlestat", "version": "" } ], "annotations": { "list": [ { "builtIn": 1, "datasource": "-- Grafana --", "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "type": "dashboard" } ] }, "editable": true, "gnetId": 11033, "graphTooltip": 0, "id": null, "links": [], "panels": [ { "cacheTimeout": null, "gridPos": { "h": 5, "w": 11, "x": 0, "y": 0 }, "id": 14, "links": [], "options": { "fieldOptions": { "calcs": [ "last" ], "defaults": { "decimals": 0, "max": 100, "min": 0 }, "mappings": [], "override": {}, "thresholds": [ { "color": "green", "index": 0, "value": null }, { "color": "red", "index": 1, "value": 20 } ], "values": false }, "orientation": "auto", "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "6.2.5", "targets": [ { "expr": "nextcloud_shares_total{type=\"authlink\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "authlink", "refId": "A" }, { "expr": "nextcloud_shares_total{type=\"link\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "link", "refId": "B" }, { "expr": "nextcloud_shares_total{type=\"group\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "group", "refId": "C" }, { "expr": "nextcloud_shares_total{type=\"user\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "user", "refId": "D" } ], "timeFrom": null, "timeShift": null, "title": "Total Shared Links By Type", "type": "gauge" }, { "gridPos": { "h": 6, "w": 5, "x": 11, "y": 0 }, "id": 2, "links": [], "options": { "fieldOptions": { "calcs": [ "last" ], "defaults": { "decimals": 2, "max": 1099511627776, "min": 0, "unit": "bytes" }, "mappings": [], "override": {}, "thresholds": [ { "color": "red", "index": 0, "value": null }, { "color": "orange", "index": 1, "value": 68719476736 }, { "color": "green", "index": 2, "value": 188978561024 } ], "values": false }, "orientation": "auto", "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "6.2.5", "targets": [ { "expr": "nextcloud_free_space_bytes - 1099511627776", "format": "time_series", "intervalFactor": 1, "refId": "A" } ], "timeFrom": null, "timeShift": null, "title": "Free Space Remaining", "type": "gauge" }, { "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ "#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a" ], "decimals": 0, "format": "bytes", "gauge": { "maxValue": 100, "minValue": 0, "show": false, "thresholdLabels": false, "thresholdMarkers": true }, "gridPos": { "h": 3, "w": 5, "x": 16, "y": 0 }, "id": 10, "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ { "name": "value to text", "value": 1 }, { "name": "range to text", "value": 2 } ], "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, "options": {}, "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", "rangeMaps": [ { "from": "null", "text": "N/A", "to": "null" } ], "sparkline": { "fillColor": "rgba(31, 118, 189, 0.18)", "full": false, "lineColor": "rgb(31, 120, 193)", "show": false }, "tableColumn": "", "targets": [ { "expr": "nextcloud_php_upload_max_size_bytes", "format": "time_series", "intervalFactor": 1, "refId": "A" } ], "thresholds": "", "timeFrom": null, "timeShift": null, "title": "PHP Max Upload File Size", "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ { "op": "=", "text": "N/A", "value": "null" } ], "valueName": "current" }, { "cacheTimeout": null, "colorBackground": true, "colorValue": false, "colors": [ "#d44a3a", "#F2495C", "#299c46" ], "format": "none", "gauge": { "maxValue": 100, "minValue": 0, "show": false, "thresholdLabels": false, "thresholdMarkers": true }, "gridPos": { "h": 4, "w": 3, "x": 21, "y": 0 }, "id": 4, "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ { "name": "value to text", "value": 1 }, { "name": "range to text", "value": 2 } ], "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, "options": {}, "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", "rangeMaps": [ { "from": "null", "text": "N/A", "to": "null" } ], "sparkline": { "fillColor": "rgba(31, 118, 189, 0.18)", "full": false, "lineColor": "rgb(31, 120, 193)", "show": false }, "tableColumn": "", "targets": [ { "expr": "nextcloud_up", "format": "time_series", "intervalFactor": 1, "refId": "A" } ], "thresholds": "0,1,2", "timeFrom": null, "timeShift": null, "title": "App Status", "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ { "op": "=", "text": "N/A", "value": "null" }, { "op": "=", "text": "Up", "value": "1" }, { "op": "=", "text": "Down", "value": "0" } ], "valueName": "current" }, { "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ "#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a" ], "format": "bytes", "gauge": { "maxValue": 100, "minValue": 0, "show": false, "thresholdLabels": false, "thresholdMarkers": true }, "gridPos": { "h": 3, "w": 5, "x": 16, "y": 3 }, "id": 16, "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ { "name": "value to text", "value": 1 }, { "name": "range to text", "value": 2 } ], "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, "options": {}, "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", "rangeMaps": [ { "from": "null", "text": "N/A", "to": "null" } ], "sparkline": { "fillColor": "rgba(31, 118, 189, 0.18)", "full": false, "lineColor": "rgb(31, 120, 193)", "show": false }, "tableColumn": "", "targets": [ { "expr": "nextcloud_php_memory_limit_bytes", "format": "time_series", "intervalFactor": 1, "refId": "A" } ], "thresholds": "", "timeFrom": null, "timeShift": null, "title": "PHP Max Memory Size", "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ { "op": "=", "text": "N/A", "value": "null" } ], "valueName": "current" }, { "cacheTimeout": null, "colorBackground": true, "colorValue": false, "colors": [ "#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a" ], "format": "none", "gauge": { "maxValue": 100, "minValue": 0, "show": false, "thresholdLabels": false, "thresholdMarkers": true }, "gridPos": { "h": 4, "w": 3, "x": 21, "y": 4 }, "id": 6, "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ { "name": "value to text", "value": 1 }, { "name": "range to text", "value": 2 } ], "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, "options": {}, "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", "rangeMaps": [ { "from": "null", "text": "N/A", "to": "null" } ], "sparkline": { "fillColor": "rgba(31, 118, 189, 0.18)", "full": false, "lineColor": "#73BF69", "show": true }, "tableColumn": "", "targets": [ { "expr": "nextcloud_active_users_total", "format": "time_series", "intervalFactor": 1, "refId": "A" } ], "thresholds": "1,2", "timeFrom": null, "timeShift": null, "title": "Current Active Users", "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ { "op": "=", "text": "N/A", "value": "null" } ], "valueName": "current" }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "fill": 1, "gridPos": { "h": 7, "w": 11, "x": 0, "y": 5 }, "id": 20, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", "options": {}, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "nextcloud_shares_federated_total{direction=\"received\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "recieved", "refId": "A" }, { "expr": "nextcloud_shares_federated_total{direction=\"sent\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "sent", "refId": "B" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Federated Nextcloud Data Exchange Total", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "gridPos": { "h": 5, "w": 5, "x": 11, "y": 6 }, "id": 18, "links": [], "options": { "fieldOptions": { "calcs": [ "last" ], "defaults": { "max": 40000000, "min": 0, "unit": "bytes" }, "mappings": [], "override": {}, "thresholds": [ { "color": "green", "index": 0, "value": null }, { "color": "red", "index": 1, "value": 30000000 } ], "values": false }, "orientation": "auto", "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "6.2.5", "targets": [ { "expr": "nextcloud_database_size_bytes", "format": "time_series", "intervalFactor": 1, "refId": "A" } ], "timeFrom": null, "timeShift": null, "title": "Database Size", "type": "gauge" }, { "cacheTimeout": null, "colorBackground": true, "colorValue": false, "colors": [ "#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a" ], "format": "none", "gauge": { "maxValue": 100, "minValue": 0, "show": false, "thresholdLabels": false, "thresholdMarkers": true }, "gridPos": { "h": 4, "w": 5, "x": 16, "y": 6 }, "id": 8, "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ { "name": "value to text", "value": 1 }, { "name": "range to text", "value": 2 } ], "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, "options": {}, "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", "rangeMaps": [ { "from": "null", "text": "N/A", "to": "null" } ], "sparkline": { "fillColor": "rgba(31, 118, 189, 0.18)", "full": false, "lineColor": "rgb(31, 120, 193)", "show": true }, "tableColumn": "", "targets": [ { "expr": "nextcloud_auth_errors_total", "format": "time_series", "intervalFactor": 1, "refId": "A" } ], "thresholds": "3,5", "timeFrom": null, "timeShift": null, "title": "Total Authorization Errors", "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ { "op": "=", "text": "N/A", "value": "null" } ], "valueName": "current" }, { "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ "#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a" ], "format": "none", "gauge": { "maxValue": 100, "minValue": 0, "show": false, "thresholdLabels": false, "thresholdMarkers": true }, "gridPos": { "h": 3, "w": 5, "x": 16, "y": 10 }, "id": 12, "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ { "name": "value to text", "value": 1 }, { "name": "range to text", "value": 2 } ], "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, "options": {}, "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", "rangeMaps": [ { "from": "null", "text": "N/A", "to": "null" } ], "sparkline": { "fillColor": "rgba(31, 118, 189, 0.18)", "full": false, "lineColor": "rgb(31, 120, 193)", "show": true }, "tableColumn": "", "targets": [ { "expr": "nextcloud_files_total", "format": "time_series", "intervalFactor": 1, "refId": "A" } ], "thresholds": "", "timeFrom": null, "timeShift": null, "title": "Total File Count", "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ { "op": "=", "text": "N/A", "value": "null" } ], "valueName": "current" } ], "schemaVersion": 18, "style": "dark", "tags": [], "templating": { "list": [] }, "time": { "from": "now-6h", "to": "now" }, "timepicker": { "refresh_intervals": [ "5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d" ], "time_options": [ "5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d" ] }, "timezone": "", "title": "Nextcloud Exporter Prometheus Dashboard", "uid": "D1j1gqTZk", "version": 8, "description": "Dashboard for Nextcloud Prometheus data" }
6.2 Dashboard No. 2
So sieht dieses Dashboard aus:
{ "__inputs": [], "__requires": [ { "type": "panel", "id": "gauge", "name": "Gauge", "version": "" }, { "type": "grafana", "id": "grafana", "name": "Grafana", "version": "6.2.5" }, { "type": "panel", "id": "graph", "name": "Graph", "version": "" }, { "type": "panel", "id": "singlestat", "name": "Singlestat", "version": "" } ], "annotations": { "list": [ { "builtIn": 1, "datasource": "-- Grafana --", "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "type": "dashboard" } ] }, "editable": true, "gnetId": 11033, "graphTooltip": 0, "id": null, "links": [], "panels": [ { "cacheTimeout": null, "gridPos": { "h": 5, "w": 11, "x": 0, "y": 0 }, "id": 14, "links": [], "options": { "fieldOptions": { "calcs": [ "last" ], "defaults": { "decimals": 0, "max": 100, "min": 0 }, "mappings": [], "override": {}, "thresholds": [ { "color": "green", "index": 0, "value": null }, { "color": "red", "index": 1, "value": 20 } ], "values": false }, "orientation": "auto", "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "6.2.5", "targets": [ { "expr": "nextcloud_shares_total{type=\"authlink\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "authlink", "refId": "A" }, { "expr": "nextcloud_shares_total{type=\"link\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "link", "refId": "B" }, { "expr": "nextcloud_shares_total{type=\"group\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "group", "refId": "C" }, { "expr": "nextcloud_shares_total{type=\"user\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "user", "refId": "D" } ], "timeFrom": null, "timeShift": null, "title": "Total Shared Links By Type", "type": "gauge" }, { "gridPos": { "h": 6, "w": 5, "x": 11, "y": 0 }, "id": 2, "links": [], "options": { "fieldOptions": { "calcs": [ "last" ], "defaults": { "decimals": 2, "max": 1099511627776, "min": 0, "unit": "bytes" }, "mappings": [], "override": {}, "thresholds": [ { "color": "red", "index": 0, "value": null }, { "color": "orange", "index": 1, "value": 68719476736 }, { "color": "green", "index": 2, "value": 188978561024 } ], "values": false }, "orientation": "auto", "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "6.2.5", "targets": [ { "expr": "nextcloud_free_space_bytes - 1099511627776", "format": "time_series", "intervalFactor": 1, "refId": "A" } ], "timeFrom": null, "timeShift": null, "title": "Free Space Remaining", "type": "gauge" }, { "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ "#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a" ], "decimals": 0, "format": "bytes", "gauge": { "maxValue": 100, "minValue": 0, "show": false, "thresholdLabels": false, "thresholdMarkers": true }, "gridPos": { "h": 3, "w": 5, "x": 16, "y": 0 }, "id": 10, "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ { "name": "value to text", "value": 1 }, { "name": "range to text", "value": 2 } ], "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, "options": {}, "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", "rangeMaps": [ { "from": "null", "text": "N/A", "to": "null" } ], "sparkline": { "fillColor": "rgba(31, 118, 189, 0.18)", "full": false, "lineColor": "rgb(31, 120, 193)", "show": false }, "tableColumn": "", "targets": [ { "expr": "nextcloud_php_upload_max_size_bytes", "format": "time_series", "intervalFactor": 1, "refId": "A" } ], "thresholds": "", "timeFrom": null, "timeShift": null, "title": "PHP Max Upload File Size", "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ { "op": "=", "text": "N/A", "value": "null" } ], "valueName": "current" }, { "cacheTimeout": null, "colorBackground": true, "colorValue": false, "colors": [ "#d44a3a", "#F2495C", "#299c46" ], "format": "none", "gauge": { "maxValue": 100, "minValue": 0, "show": false, "thresholdLabels": false, "thresholdMarkers": true }, "gridPos": { "h": 4, "w": 3, "x": 21, "y": 0 }, "id": 4, "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ { "name": "value to text", "value": 1 }, { "name": "range to text", "value": 2 } ], "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, "options": {}, "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", "rangeMaps": [ { "from": "null", "text": "N/A", "to": "null" } ], "sparkline": { "fillColor": "rgba(31, 118, 189, 0.18)", "full": false, "lineColor": "rgb(31, 120, 193)", "show": false }, "tableColumn": "", "targets": [ { "expr": "nextcloud_up", "format": "time_series", "intervalFactor": 1, "refId": "A" } ], "thresholds": "0,1,2", "timeFrom": null, "timeShift": null, "title": "App Status", "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ { "op": "=", "text": "N/A", "value": "null" }, { "op": "=", "text": "Up", "value": "1" }, { "op": "=", "text": "Down", "value": "0" } ], "valueName": "current" }, { "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ "#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a" ], "format": "bytes", "gauge": { "maxValue": 100, "minValue": 0, "show": false, "thresholdLabels": false, "thresholdMarkers": true }, "gridPos": { "h": 3, "w": 5, "x": 16, "y": 3 }, "id": 16, "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ { "name": "value to text", "value": 1 }, { "name": "range to text", "value": 2 } ], "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, "options": {}, "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", "rangeMaps": [ { "from": "null", "text": "N/A", "to": "null" } ], "sparkline": { "fillColor": "rgba(31, 118, 189, 0.18)", "full": false, "lineColor": "rgb(31, 120, 193)", "show": false }, "tableColumn": "", "targets": [ { "expr": "nextcloud_php_memory_limit_bytes", "format": "time_series", "intervalFactor": 1, "refId": "A" } ], "thresholds": "", "timeFrom": null, "timeShift": null, "title": "PHP Max Memory Size", "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ { "op": "=", "text": "N/A", "value": "null" } ], "valueName": "current" }, { "cacheTimeout": null, "colorBackground": true, "colorValue": false, "colors": [ "#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a" ], "format": "none", "gauge": { "maxValue": 100, "minValue": 0, "show": false, "thresholdLabels": false, "thresholdMarkers": true }, "gridPos": { "h": 4, "w": 3, "x": 21, "y": 4 }, "id": 6, "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ { "name": "value to text", "value": 1 }, { "name": "range to text", "value": 2 } ], "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, "options": {}, "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", "rangeMaps": [ { "from": "null", "text": "N/A", "to": "null" } ], "sparkline": { "fillColor": "rgba(31, 118, 189, 0.18)", "full": false, "lineColor": "#73BF69", "show": true }, "tableColumn": "", "targets": [ { "expr": "nextcloud_active_users_total", "format": "time_series", "intervalFactor": 1, "refId": "A" } ], "thresholds": "1,2", "timeFrom": null, "timeShift": null, "title": "Current Active Users", "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ { "op": "=", "text": "N/A", "value": "null" } ], "valueName": "current" }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "fill": 1, "gridPos": { "h": 7, "w": 11, "x": 0, "y": 5 }, "id": 20, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "links": [], "nullPointMode": "null", "options": {}, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "nextcloud_shares_federated_total{direction=\"received\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "recieved", "refId": "A" }, { "expr": "nextcloud_shares_federated_total{direction=\"sent\"}", "format": "time_series", "intervalFactor": 1, "legendFormat": "sent", "refId": "B" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Federated Nextcloud Data Exchange Total", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "gridPos": { "h": 5, "w": 5, "x": 11, "y": 6 }, "id": 18, "links": [], "options": { "fieldOptions": { "calcs": [ "last" ], "defaults": { "max": 40000000, "min": 0, "unit": "bytes" }, "mappings": [], "override": {}, "thresholds": [ { "color": "green", "index": 0, "value": null }, { "color": "red", "index": 1, "value": 30000000 } ], "values": false }, "orientation": "auto", "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "6.2.5", "targets": [ { "expr": "nextcloud_database_size_bytes", "format": "time_series", "intervalFactor": 1, "refId": "A" } ], "timeFrom": null, "timeShift": null, "title": "Database Size", "type": "gauge" }, { "cacheTimeout": null, "colorBackground": true, "colorValue": false, "colors": [ "#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a" ], "format": "none", "gauge": { "maxValue": 100, "minValue": 0, "show": false, "thresholdLabels": false, "thresholdMarkers": true }, "gridPos": { "h": 4, "w": 5, "x": 16, "y": 6 }, "id": 8, "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ { "name": "value to text", "value": 1 }, { "name": "range to text", "value": 2 } ], "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, "options": {}, "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", "rangeMaps": [ { "from": "null", "text": "N/A", "to": "null" } ], "sparkline": { "fillColor": "rgba(31, 118, 189, 0.18)", "full": false, "lineColor": "rgb(31, 120, 193)", "show": true }, "tableColumn": "", "targets": [ { "expr": "nextcloud_auth_errors_total", "format": "time_series", "intervalFactor": 1, "refId": "A" } ], "thresholds": "3,5", "timeFrom": null, "timeShift": null, "title": "Total Authorization Errors", "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ { "op": "=", "text": "N/A", "value": "null" } ], "valueName": "current" }, { "cacheTimeout": null, "colorBackground": false, "colorValue": false, "colors": [ "#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a" ], "format": "none", "gauge": { "maxValue": 100, "minValue": 0, "show": false, "thresholdLabels": false, "thresholdMarkers": true }, "gridPos": { "h": 3, "w": 5, "x": 16, "y": 10 }, "id": 12, "interval": null, "links": [], "mappingType": 1, "mappingTypes": [ { "name": "value to text", "value": 1 }, { "name": "range to text", "value": 2 } ], "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, "options": {}, "postfix": "", "postfixFontSize": "50%", "prefix": "", "prefixFontSize": "50%", "rangeMaps": [ { "from": "null", "text": "N/A", "to": "null" } ], "sparkline": { "fillColor": "rgba(31, 118, 189, 0.18)", "full": false, "lineColor": "rgb(31, 120, 193)", "show": true }, "tableColumn": "", "targets": [ { "expr": "nextcloud_files_total", "format": "time_series", "intervalFactor": 1, "refId": "A" } ], "thresholds": "", "timeFrom": null, "timeShift": null, "title": "Total File Count", "type": "singlestat", "valueFontSize": "80%", "valueMaps": [ { "op": "=", "text": "N/A", "value": "null" } ], "valueName": "current" } ], "schemaVersion": 18, "style": "dark", "tags": [], "templating": { "list": [] }, "time": { "from": "now-6h", "to": "now" }, "timepicker": { "refresh_intervals": [ "5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d" ], "time_options": [ "5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d" ] }, "timezone": "", "title": "Nextcloud Exporter Prometheus Dashboard", "uid": "D1j1gqTZk", "version": 8, "description": "Dashboard for Nextcloud Prometheus data" }
7. Quellen
- nextcloud-exporter/README.md at master · xperimental/nextcloud-exporter · GitHub
- Grafana Dashboard · Issue #36 · xperimental/nextcloud-exporter · GitHub