Prometheus exporter for HomeHub 4000 router

This commit is contained in:
Isaac Mallampati
2026-01-05 20:47:00 -05:00
commit cf3a73d38c
24 changed files with 2933 additions and 0 deletions

7
deploy/.env.example Normal file
View File

@@ -0,0 +1,7 @@
# Router settings
ROUTER_PASSWORD=your_router_password_here
ROUTER_IP=192.168.2.1
# Grafana credentials (defaults to admin/admin if not set)
GRAFANA_ADMIN_USER=admin
GRAFANA_ADMIN_PASSWORD=changeme

55
deploy/docker-compose.yml Normal file
View File

@@ -0,0 +1,55 @@
services:
exporter:
build:
context: ..
dockerfile: Dockerfile
container_name: homehub-exporter
ports:
- "9100:9100"
environment:
- ROUTER_IP=${ROUTER_IP:-192.168.2.1}
- ROUTER_PASSWORD=${ROUTER_PASSWORD}
- EXPORTER_PORT=9100
- HEADLESS_BROWSER=true
- SCRAPE_INTERVAL=60
- LOG_POLL_INTERVAL=75
- DB_PATH=/app/data/virgin_monitor.db
volumes:
- exporter-data:/app/data
restart: unless-stopped
# For accessing router on host network
extra_hosts:
- "host.docker.internal:host-gateway"
prometheus:
image: prom/prometheus:latest
container_name: homehub-prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
depends_on:
- exporter
restart: unless-stopped
grafana:
image: grafana/grafana:latest
container_name: homehub-grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD:-admin}
- GF_USERS_ALLOW_SIGN_UP=false
volumes:
- grafana-data:/var/lib/grafana
- ./grafana:/etc/grafana/provisioning:ro
depends_on:
- prometheus
restart: unless-stopped
volumes:
exporter-data:
prometheus-data:
grafana-data:

View File

@@ -0,0 +1,11 @@
apiVersion: 1
providers:
- name: 'Virgin Router'
orgId: 1
folder: ''
type: file
disableDeletion: false
editable: true
options:
path: /etc/grafana/provisioning/dashboards

View File

@@ -0,0 +1,710 @@
{
"annotations": {
"list": []
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 1,
"id": null,
"links": [],
"panels": [
{
"collapsed": false,
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 0},
"id": 101,
"panels": [],
"title": "Devices",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "short"
},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 0, "y": 1},
"id": 1,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
"textMode": "auto"
},
"pluginVersion": "10.0.0",
"targets": [{"expr": "homehub_connected_devices", "refId": "A"}],
"title": "Connected",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "yellow", "value": null}]},
"unit": "short"
},
"overrides": []
},
"gridPos": {"h": 4, "w": 4, "x": 4, "y": 1},
"id": 2,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
"textMode": "auto"
},
"pluginVersion": "10.0.0",
"targets": [{"expr": "homehub_disconnected_devices", "refId": "A"}],
"title": "Disconnected",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {
"axisCenteredZero": false,
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {"type": "linear"},
"showPoints": "never",
"spanNulls": true
},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "short"
},
"overrides": []
},
"gridPos": {"h": 4, "w": 8, "x": 0, "y": 5},
"id": 5,
"options": {
"legend": {"calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false},
"tooltip": {"mode": "multi", "sort": "none"}
},
"pluginVersion": "10.0.0",
"targets": [
{"expr": "homehub_connected_devices", "legendFormat": "Connected", "refId": "A"},
{"expr": "homehub_disconnected_devices", "legendFormat": "Disconnected", "refId": "B"}
],
"title": "Device History",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"custom": {"align": "auto", "cellOptions": {"type": "auto"}, "inspect": false},
"mappings": [
{"options": {"0": {"color": "red", "index": 0, "text": "Offline"}}, "type": "value"},
{"options": {"1": {"color": "green", "index": 1, "text": "Online"}}, "type": "value"}
],
"thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "green", "value": 1}]}
},
"overrides": [
{"matcher": {"id": "byName", "options": "Status"}, "properties": [{"id": "custom.cellOptions", "value": {"type": "color-background"}}]},
{"matcher": {"id": "byName", "options": "Uptime"}, "properties": [{"id": "unit", "value": "s"}]}
]
},
"gridPos": {"h": 8, "w": 16, "x": 8, "y": 1},
"id": 7,
"options": {"cellHeight": "sm", "footer": {"countRows": false, "fields": "", "reducer": ["sum"], "show": false}, "showHeader": true},
"pluginVersion": "10.0.0",
"targets": [
{"expr": "homehub_device_connected", "format": "table", "instant": true, "refId": "A"},
{"expr": "homehub_device_uptime_seconds", "format": "table", "instant": true, "refId": "B"}
],
"title": "Device Status",
"transformations": [
{"id": "joinByField", "options": {"byField": "device_name", "mode": "outer"}},
{"id": "groupBy", "options": {"fields": {"device_name": {"aggregations": [], "operation": "groupby"}, "mac_address": {"aggregations": ["firstNotNull"], "operation": "aggregate"}, "mac_address 1": {"aggregations": ["firstNotNull"], "operation": "aggregate"}, "Value #A": {"aggregations": ["firstNotNull"], "operation": "aggregate"}, "Value #B": {"aggregations": ["firstNotNull"], "operation": "aggregate"}}}},
{"id": "organize", "options": {"excludeByName": {"Time": true, "Time 1": true, "Time 2": true, "__name__": true, "__name__ 1": true, "__name__ 2": true, "instance": true, "instance 1": true, "instance 2": true, "job": true, "job 1": true, "job 2": true, "mac_address 1 (firstNotNull)": true}, "indexByName": {"device_name": 0, "mac_address (firstNotNull)": 1, "Value #A (firstNotNull)": 2, "Value #B (firstNotNull)": 3}, "renameByName": {"Value #A (firstNotNull)": "Status", "Value #B (firstNotNull)": "Uptime", "device_name": "Device", "mac_address (firstNotNull)": "mac_address"}}}
],
"type": "table"
},
{
"collapsed": false,
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 9},
"id": 100,
"panels": [],
"title": "System Health",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [],
"max": 100,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{"color": "green", "value": null},
{"color": "yellow", "value": 60},
{"color": "red", "value": 85}
]
},
"unit": "percent"
},
"overrides": []
},
"gridPos": {"h": 5, "w": 4, "x": 0, "y": 10},
"id": 11,
"options": {
"orientation": "auto",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
"showThresholdLabels": false,
"showThresholdMarkers": true
},
"pluginVersion": "10.0.0",
"targets": [{"expr": "homehub_cpu_usage_ratio * 100", "refId": "A"}],
"title": "CPU Usage",
"type": "gauge"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [],
"max": 100,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{"color": "green", "value": null},
{"color": "yellow", "value": 70},
{"color": "red", "value": 90}
]
},
"unit": "percent"
},
"overrides": []
},
"gridPos": {"h": 5, "w": 4, "x": 4, "y": 10},
"id": 12,
"options": {
"orientation": "auto",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
"showThresholdLabels": false,
"showThresholdMarkers": true
},
"pluginVersion": "10.0.0",
"targets": [{"expr": "100 - (homehub_memory_free_bytes / homehub_memory_total_bytes * 100)", "refId": "A"}],
"title": "Memory Usage",
"type": "gauge"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {
"axisCenteredZero": false,
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 20,
"lineInterpolation": "smooth",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {"type": "linear"},
"showPoints": "never",
"spanNulls": true
},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "short"
},
"overrides": []
},
"gridPos": {"h": 5, "w": 6, "x": 11, "y": 10},
"id": 13,
"options": {
"legend": {"calcs": ["mean", "lastNotNull"], "displayMode": "list", "placement": "bottom", "showLegend": true},
"tooltip": {"mode": "multi", "sort": "desc"}
},
"pluginVersion": "10.0.0",
"targets": [
{"expr": "homehub_load_average_1m", "legendFormat": "1m", "refId": "A"},
{"expr": "homehub_load_average_5m", "legendFormat": "5m", "refId": "B"},
{"expr": "homehub_load_average_15m", "legendFormat": "15m", "refId": "C"}
],
"title": "Load Average",
"type": "timeseries"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "decbytes"
},
"overrides": []
},
"gridPos": {"h": 5, "w": 5, "x": 17, "y": 10},
"id": 14,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
"textMode": "value_and_name"
},
"pluginVersion": "10.0.0",
"targets": [
{"expr": "homehub_memory_free_bytes", "legendFormat": "Free", "refId": "A"},
{"expr": "homehub_memory_total_bytes - homehub_memory_free_bytes", "legendFormat": "Used", "refId": "B"}
],
"title": "Memory",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [
{"options": {"0": {"color": "red", "index": 0, "text": "Down"}}, "type": "value"},
{"options": {"1": {"color": "green", "index": 1, "text": "OK"}}, "type": "value"}
],
"thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "green", "value": 1}]},
"unit": "short"
},
"overrides": []
},
"gridPos": {"h": 5, "w": 2, "x": 22, "y": 10},
"id": 15,
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
"textMode": "value"
},
"pluginVersion": "10.0.0",
"targets": [{"expr": "homehub_scrape_success", "refId": "A"}],
"title": "Scraper",
"type": "stat"
},
{
"collapsed": false,
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 15},
"id": 102,
"panels": [],
"title": "Network Interfaces",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"custom": {"align": "auto", "cellOptions": {"type": "auto"}, "inspect": false},
"mappings": [
{"options": {"0": {"color": "red", "index": 0, "text": "Down"}}, "type": "value"},
{"options": {"1": {"color": "green", "index": 1, "text": "Up"}}, "type": "value"}
],
"thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "green", "value": 1}]}
},
"overrides": [
{"matcher": {"id": "byName", "options": "Status"}, "properties": [{"id": "custom.cellOptions", "value": {"type": "color-background"}}]},
{"matcher": {"id": "byName", "options": "Sent"}, "properties": [{"id": "unit", "value": "decbytes"}]},
{"matcher": {"id": "byName", "options": "Received"}, "properties": [{"id": "unit", "value": "decbytes"}]}
]
},
"gridPos": {"h": 8, "w": 10, "x": 2, "y": 16},
"id": 16,
"options": {"cellHeight": "sm", "footer": {"countRows": false, "fields": "", "reducer": ["sum"], "show": false}, "showHeader": true, "sortBy": [{"desc": true, "displayName": "Status"}]},
"pluginVersion": "10.0.0",
"targets": [
{"expr": "homehub_interface_up", "format": "table", "instant": true, "refId": "A"},
{"expr": "homehub_interface_bytes_sent", "format": "table", "instant": true, "refId": "B"},
{"expr": "homehub_interface_bytes_received", "format": "table", "instant": true, "refId": "C"}
],
"title": "Interface Status",
"transformations": [
{"id": "seriesToColumns", "options": {"byField": "interface"}},
{"id": "organize", "options": {"excludeByName": {"Time": true, "Time 1": true, "Time 2": true, "Time 3": true, "__name__": true, "__name__ 1": true, "__name__ 2": true, "__name__ 3": true, "instance": true, "instance 1": true, "instance 2": true, "instance 3": true, "job": true, "job 1": true, "job 2": true, "job 3": true}, "renameByName": {"Value #A": "Status", "Value #B": "Sent", "Value #C": "Received", "interface": "Interface"}}}
],
"type": "table"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {
"axisCenteredZero": false,
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 20,
"lineInterpolation": "smooth",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {"type": "linear"},
"showPoints": "never",
"spanNulls": true
},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "Bps"
},
"overrides": []
},
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 16},
"id": 17,
"options": {
"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true},
"tooltip": {"mode": "multi", "sort": "desc"}
},
"pluginVersion": "10.0.0",
"targets": [
{"expr": "rate(homehub_interface_bytes_sent{interface=~\"fibre|10g|lan_1\"}[5m])", "legendFormat": "{{interface}} TX", "refId": "A"},
{"expr": "rate(homehub_interface_bytes_received{interface=~\"fibre|10g|lan_1\"}[5m])", "legendFormat": "{{interface}} RX", "refId": "B"}
],
"title": "Interface Throughput (Active)",
"type": "timeseries"
},
{
"collapsed": false,
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 24},
"id": 103,
"panels": [],
"title": "Logs & Events",
"type": "row"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"hideFrom": {"legend": false, "tooltip": false, "viz": false}},
"mappings": []
},
"overrides": []
},
"gridPos": {"h": 3, "w": 4, "x": 0, "y": 25},
"id": 4,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
"textMode": "auto"
},
"pluginVersion": "10.0.0",
"targets": [{"expr": "homehub_logs_total", "refId": "A"}],
"title": "Total Logs",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "orange", "value": null}]},
"unit": "short"
},
"overrides": []
},
"gridPos": {"h": 3, "w": 4, "x": 4, "y": 25},
"id": 18,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
"textMode": "auto"
},
"pluginVersion": "10.0.0",
"targets": [{"expr": "homehub_logs_last_hour", "refId": "A"}],
"title": "Logs (Last Hour)",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "purple", "value": null}]},
"unit": "short"
},
"overrides": []
},
"gridPos": {"h": 3, "w": 4, "x": 8, "y": 25},
"id": 19,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
"textMode": "auto"
},
"pluginVersion": "10.0.0",
"targets": [{"expr": "homehub_wifi_connects_total", "refId": "A"}],
"title": "Total Connects",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "semi-dark-red", "value": null}]},
"unit": "short"
},
"overrides": []
},
"gridPos": {"h": 3, "w": 4, "x": 12, "y": 25},
"id": 20,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
"textMode": "auto"
},
"pluginVersion": "10.0.0",
"targets": [{"expr": "homehub_wifi_disconnects_total", "refId": "A"}],
"title": "Total Disconnects",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "s"
},
"overrides": []
},
"gridPos": {"h": 5, "w": 3, "x": 8, "y": 10},
"id": 21,
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
"textMode": "value"
},
"pluginVersion": "10.0.0",
"targets": [{"expr": "homehub_router_uptime_seconds", "refId": "A"}],
"title": "Router Uptime",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "blue", "value": null}]},
"unit": "decbytes"
},
"overrides": []
},
"gridPos": {"h": 4, "w": 2, "x": 0, "y": 16},
"id": 22,
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
"textMode": "value"
},
"pluginVersion": "10.0.0",
"targets": [{"expr": "homehub_interface_bytes_received{interface=\"fibre\"}", "refId": "A"}],
"title": "Data In",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "thresholds"},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "orange", "value": null}]},
"unit": "decbytes"
},
"overrides": []
},
"gridPos": {"h": 4, "w": 2, "x": 0, "y": 20},
"id": 23,
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
"textMode": "value"
},
"pluginVersion": "10.0.0",
"targets": [{"expr": "homehub_interface_bytes_sent{interface=\"fibre\"}", "refId": "A"}],
"title": "Data Out",
"type": "stat"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"hideFrom": {"legend": false, "tooltip": false, "viz": false}},
"mappings": []
},
"overrides": []
},
"gridPos": {"h": 6, "w": 6, "x": 0, "y": 28},
"id": 6,
"options": {
"legend": {"displayMode": "list", "placement": "right", "showLegend": true},
"pieType": "donut",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
"tooltip": {"mode": "single", "sort": "none"}
},
"pluginVersion": "10.0.0",
"targets": [{"expr": "homehub_logs_by_module", "legendFormat": "{{module}}", "refId": "A"}],
"title": "Logs by Module",
"type": "piechart"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {"hideFrom": {"legend": false, "tooltip": false, "viz": false}},
"mappings": []
},
"overrides": [
{"matcher": {"id": "byName", "options": "Error"}, "properties": [{"id": "color", "value": {"fixedColor": "red", "mode": "fixed"}}]},
{"matcher": {"id": "byName", "options": "Warning"}, "properties": [{"id": "color", "value": {"fixedColor": "yellow", "mode": "fixed"}}]},
{"matcher": {"id": "byName", "options": "Info"}, "properties": [{"id": "color", "value": {"fixedColor": "green", "mode": "fixed"}}]}
]
},
"gridPos": {"h": 6, "w": 6, "x": 6, "y": 28},
"id": 9,
"options": {
"legend": {"displayMode": "list", "placement": "right", "showLegend": true},
"pieType": "donut",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
"tooltip": {"mode": "single", "sort": "none"}
},
"pluginVersion": "10.0.0",
"targets": [
{"expr": "homehub_logs_by_level{level=\"INF\"}", "legendFormat": "Info", "refId": "A"},
{"expr": "homehub_logs_by_level{level=\"ERR\"}", "legendFormat": "Error", "refId": "B"},
{"expr": "homehub_logs_by_level{level=\"WRN\"}", "legendFormat": "Warning", "refId": "C"}
],
"title": "Logs by Level",
"type": "piechart"
},
{
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
"fieldConfig": {
"defaults": {
"color": {"mode": "palette-classic"},
"custom": {
"axisCenteredZero": false,
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 50,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {"type": "linear"},
"showPoints": "never",
"spanNulls": false,
"stacking": {"group": "A", "mode": "none"}
},
"mappings": [],
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
"unit": "short"
},
"overrides": [
{"matcher": {"id": "byName", "options": "Connections"}, "properties": [{"id": "color", "value": {"fixedColor": "green", "mode": "fixed"}}]},
{"matcher": {"id": "byName", "options": "Disconnections"}, "properties": [{"id": "color", "value": {"fixedColor": "red", "mode": "fixed"}}]}
]
},
"gridPos": {"h": 6, "w": 12, "x": 12, "y": 28},
"id": 8,
"options": {
"legend": {"calcs": ["sum"], "displayMode": "list", "placement": "bottom", "showLegend": true},
"tooltip": {"mode": "multi", "sort": "none"}
},
"pluginVersion": "10.0.0",
"targets": [
{"expr": "increase(homehub_wifi_connects_total[5m])", "legendFormat": "Connections", "refId": "A"},
{"expr": "increase(homehub_wifi_disconnects_total[5m])", "legendFormat": "Disconnections", "refId": "B"}
],
"title": "WiFi Events (5m)",
"type": "timeseries"
}
],
"refresh": "30s",
"schemaVersion": 38,
"tags": ["vincent", "homehub-4000", "router"],
"templating": {
"list": [
{
"current": {"selected": false, "text": "Prometheus", "value": "PBFA97CFB590B2093"},
"hide": 0,
"includeAll": false,
"multi": false,
"name": "DS_PROMETHEUS",
"options": [],
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
}
]
},
"time": {"from": "now-6h", "to": "now"},
"timepicker": {},
"timezone": "",
"title": "Vincent / HomeHub 4000 Router Monitor",
"uid": "vincent-homehub-4000-router-monitor",
"version": 3
}

View File

@@ -0,0 +1,9 @@
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
editable: false

14
deploy/prometheus.yml Normal file
View File

@@ -0,0 +1,14 @@
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'homehub'
static_configs:
- targets: ['exporter:9100']
scrape_interval: 30s
scrape_timeout: 15s