Files
infra/stacks/monitoring/grafana/provisioning/dashboards/rpi-disk.json
T

1294 lines
30 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"uid": "rpi-disk",
"title": "RPi — диск и бэкап OneDrive",
"tags": [
"rpi",
"smart",
"backup"
],
"timezone": "browser",
"schemaVersion": 39,
"refresh": "5m",
"time": {
"from": "now-7d",
"to": "now"
},
"editable": true,
"templating": {
"list": [
{
"name": "instance",
"type": "query",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"query": {
"query": "label_values(smart_health_passed, instance)",
"refId": "i"
},
"refresh": 2,
"current": {}
},
{
"name": "serial",
"type": "query",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"query": {
"query": "label_values(smart_health_passed{instance=\"$instance\"}, serial)",
"refId": "s"
},
"refresh": 2,
"includeAll": true,
"multi": true,
"current": {
"text": "All",
"value": "$__all"
}
}
]
},
"panels": [
{
"type": "row",
"title": "Диск — состояние SMART",
"collapsed": false,
"gridPos": {
"x": 0,
"y": 0,
"w": 24,
"h": 1
},
"id": 100,
"panels": []
},
{
"id": 1,
"type": "stat",
"title": "SMART health",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 1,
"w": 6,
"h": 4
},
"targets": [
{
"refId": "A",
"expr": "smart_health_passed{instance=\"$instance\",serial=~\"$serial\"}",
"legendFormat": "{{model}}",
"instant": true,
"range": false
}
],
"fieldConfig": {
"defaults": {
"mappings": [
{
"type": "value",
"options": {
"1": {
"text": "PASSED",
"color": "green"
},
"0": {
"text": "FAILED",
"color": "red"
}
}
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"value": null,
"color": "red"
},
{
"value": 1,
"color": "green"
}
]
}
},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "none",
"textMode": "value_and_name",
"justifyMode": "center"
},
"description": "Общий вердикт прошивки диска. FAILED — менять немедленно."
},
{
"id": 2,
"type": "stat",
"title": "Температура",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 6,
"y": 1,
"w": 4,
"h": 4
},
"targets": [
{
"refId": "A",
"expr": "smart_temperature_celsius{instance=\"$instance\",serial=~\"$serial\"}",
"legendFormat": "{{model}}",
"instant": true,
"range": false
}
],
"fieldConfig": {
"defaults": {
"unit": "celsius",
"thresholds": {
"mode": "absolute",
"steps": [
{
"value": null,
"color": "green"
},
{
"value": 50,
"color": "orange"
},
{
"value": 55,
"color": "red"
}
]
}
},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "none",
"textMode": "value_and_name",
"justifyMode": "center"
}
},
{
"id": 3,
"type": "stat",
"title": "Переназначенные / ожидающие / нечитаемые сектора",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 10,
"y": 1,
"w": 10,
"h": 4
},
"targets": [
{
"refId": "A",
"expr": "smart_attribute_raw{instance=\"$instance\",serial=~\"$serial\",id=~\"5|197|198\"}",
"legendFormat": "{{name}}",
"instant": true,
"range": false
}
],
"fieldConfig": {
"defaults": {
"thresholds": {
"mode": "absolute",
"steps": [
{
"value": null,
"color": "green"
},
{
"value": 1,
"color": "red"
}
]
}
},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "none",
"textMode": "value_and_name",
"justifyMode": "center"
},
"description": "Любое значение > 0 — диск начал сыпаться. Рост — срочно делать вторую копию."
},
{
"id": 4,
"type": "stat",
"title": "Последний самотест",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 20,
"y": 1,
"w": 4,
"h": 4
},
"targets": [
{
"refId": "A",
"expr": "smart_selftest_last_passed{instance=\"$instance\",serial=~\"$serial\"}",
"legendFormat": "",
"instant": true,
"range": false
}
],
"fieldConfig": {
"defaults": {
"mappings": [
{
"type": "value",
"options": {
"1": {
"text": "OK",
"color": "green"
},
"0": {
"text": "FAILED",
"color": "red"
}
}
},
{
"type": "special",
"options": {
"match": "null",
"result": {
"text": "ещё не было",
"color": "text"
}
}
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"value": null,
"color": "red"
},
{
"value": 1,
"color": "green"
}
]
}
},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "none",
"textMode": "value_and_name",
"justifyMode": "center"
},
"description": "Короткий — по субботам 03:00, длинный — 1-го числа 05:00 (smartd)."
},
{
"id": 5,
"type": "stat",
"title": "Наработка",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 5,
"w": 4,
"h": 4
},
"targets": [
{
"refId": "A",
"expr": "smart_power_on_hours{instance=\"$instance\",serial=~\"$serial\"}*3600",
"legendFormat": "",
"instant": true,
"range": false
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"decimals": 1
},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "none",
"graphMode": "none",
"textMode": "value_and_name",
"justifyMode": "center"
}
},
{
"id": 6,
"type": "stat",
"title": "Старт/стоп (раскрутки)",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 4,
"y": 5,
"w": 5,
"h": 4
},
"targets": [
{
"refId": "A",
"expr": "smart_attribute_raw{instance=\"$instance\",serial=~\"$serial\",id=\"4\"}",
"legendFormat": "",
"instant": true,
"range": false
}
],
"fieldConfig": {
"defaults": {},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "none",
"graphMode": "none",
"textMode": "value_and_name",
"justifyMode": "center"
}
},
{
"id": 7,
"type": "stat",
"title": "Парковки головок",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 9,
"y": 5,
"w": 5,
"h": 4
},
"targets": [
{
"refId": "A",
"expr": "smart_attribute_raw{instance=\"$instance\",serial=~\"$serial\",id=\"193\"}",
"legendFormat": "",
"instant": true,
"range": false
}
],
"fieldConfig": {
"defaults": {},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "none",
"graphMode": "none",
"textMode": "value_and_name",
"justifyMode": "center"
},
"description": "Типичный ресурс 2.5\" — ~300 000."
},
{
"id": 8,
"type": "stat",
"title": "CRC-ошибки USB",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 14,
"y": 5,
"w": 4,
"h": 4
},
"targets": [
{
"refId": "A",
"expr": "smart_attribute_raw{instance=\"$instance\",serial=~\"$serial\",id=\"199\"}",
"legendFormat": "",
"instant": true,
"range": false
}
],
"fieldConfig": {
"defaults": {
"thresholds": {
"mode": "absolute",
"steps": [
{
"value": null,
"color": "green"
},
{
"value": 1,
"color": "orange"
}
]
}
},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "none",
"textMode": "value_and_name",
"justifyMode": "center"
},
"description": "Растут — кабель, USB-мост или питание."
},
{
"id": 9,
"type": "stat",
"title": "Диск сейчас",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 18,
"y": 5,
"w": 6,
"h": 4
},
"targets": [
{
"refId": "A",
"expr": "smart_disk_standby{instance=\"$instance\",serial=~\"$serial\"}",
"legendFormat": "",
"instant": true,
"range": false
}
],
"fieldConfig": {
"defaults": {
"mappings": [
{
"type": "value",
"options": {
"0": {
"text": "крутится",
"color": "blue"
},
"1": {
"text": "спит (standby)",
"color": "purple"
}
}
}
]
},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "none",
"textMode": "value_and_name",
"justifyMode": "center"
},
"description": "Спящий диск не будим: SMART-значения выше — с последнего опроса, когда он крутился."
},
{
"type": "row",
"title": "Бэкап OneDrive",
"collapsed": false,
"gridPos": {
"x": 0,
"y": 9,
"w": 24,
"h": 1
},
"id": 109,
"panels": []
},
{
"id": 10,
"type": "stat",
"title": "С последнего успешного sync",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 10,
"w": 5,
"h": 4
},
"targets": [
{
"refId": "A",
"expr": "time() - backup_last_success_timestamp{instance=\"$instance\",job=\"backup_onedrive\"}",
"legendFormat": "",
"instant": true,
"range": false
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"thresholds": {
"mode": "absolute",
"steps": [
{
"value": null,
"color": "green"
},
{
"value": 28800,
"color": "orange"
},
{
"value": 43200,
"color": "red"
}
]
},
"noValue": "ещё не было"
},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "none",
"textMode": "value_and_name",
"justifyMode": "center"
}
},
{
"id": 11,
"type": "stat",
"title": "С последней проверки целостности",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 5,
"y": 10,
"w": 5,
"h": 4
},
"targets": [
{
"refId": "A",
"expr": "time() - backup_last_success_timestamp{instance=\"$instance\",job=\"backup_onedrive_verify\"}",
"legendFormat": "",
"instant": true,
"range": false
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"thresholds": {
"mode": "absolute",
"steps": [
{
"value": null,
"color": "green"
},
{
"value": 648000.0,
"color": "orange"
},
{
"value": 691200,
"color": "red"
}
]
},
"noValue": "ещё не было"
},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "none",
"textMode": "value_and_name",
"justifyMode": "center"
}
},
{
"id": 99,
"type": "stat",
"title": "С последнего бэкапа серверов (fr1, ru1)",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 10,
"y": 10,
"w": 5,
"h": 4
},
"targets": [
{
"refId": "A",
"expr": "time() - backup_last_success_timestamp{instance=\"$instance\",job=\"backup_servers\"}",
"legendFormat": "",
"instant": true,
"range": false
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"noValue": "ещё не было",
"thresholds": {
"mode": "absolute",
"steps": [
{
"value": null,
"color": "green"
},
{
"value": 90000,
"color": "orange"
},
{
"value": 93600,
"color": "red"
}
]
}
},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "none",
"textMode": "value",
"justifyMode": "center"
},
"description": "Ежедневно 02:15: малина забирает зашифрованные (age) выгрузки fr1 и ru1. Расшифровать на малине нельзя — ключ у владельца."
},
{
"id": 12,
"type": "stat",
"title": "Код последнего прогона",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 15,
"y": 10,
"w": 5,
"h": 4
},
"targets": [
{
"refId": "A",
"expr": "backup_last_exit_code{instance=\"$instance\"}",
"legendFormat": "{{job}}",
"instant": true,
"range": false
}
],
"fieldConfig": {
"defaults": {
"thresholds": {
"mode": "absolute",
"steps": [
{
"value": null,
"color": "green"
},
{
"value": 1,
"color": "red"
}
]
},
"mappings": [
{
"type": "value",
"options": {
"0": {
"text": "OK"
},
"2": {
"text": "диск >90%"
}
}
}
]
},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "none",
"textMode": "value_and_name",
"justifyMode": "center"
}
},
{
"id": 13,
"type": "stat",
"title": "Свежесть метрик",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 20,
"y": 10,
"w": 4,
"h": 4
},
"targets": [
{
"refId": "A",
"expr": "time() - push_time_seconds{instance=\"$instance\"}",
"legendFormat": "{{job}}",
"instant": true,
"range": false
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"thresholds": {
"mode": "absolute",
"steps": [
{
"value": null,
"color": "green"
},
{
"value": 3600,
"color": "orange"
},
{
"value": 10800,
"color": "red"
}
]
}
},
"overrides": []
},
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "none",
"textMode": "value_and_name",
"justifyMode": "center"
},
"description": "Сколько назад малина последний раз пушила. Больше 3 ч — малина или канал лежат."
},
{
"type": "row",
"title": "Динамика",
"collapsed": false,
"gridPos": {
"x": 0,
"y": 14,
"w": 24,
"h": 1
},
"id": 114,
"panels": []
},
{
"id": 14,
"type": "timeseries",
"title": "Температура",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 15,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "smart_temperature_celsius{instance=\"$instance\",serial=~\"$serial\"}",
"legendFormat": "{{model}}",
"instant": false,
"range": true
}
],
"fieldConfig": {
"defaults": {
"custom": {
"lineWidth": 2,
"fillOpacity": 10,
"spanNulls": true,
"thresholdsStyle": {
"mode": "line"
}
},
"unit": "celsius",
"thresholds": {
"mode": "absolute",
"steps": [
{
"value": null,
"color": "green"
},
{
"value": 55,
"color": "red"
}
]
}
},
"overrides": []
},
"options": {}
},
{
"id": 15,
"type": "timeseries",
"title": "Износ: прирост за сутки",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 15,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "increase(smart_attribute_raw{instance=\"$instance\",serial=~\"$serial\",id=\"4\"}[1d])",
"legendFormat": "раскрутки",
"instant": false,
"range": true
},
{
"refId": "B",
"expr": "increase(smart_attribute_raw{instance=\"$instance\",serial=~\"$serial\",id=\"193\"}[1d])",
"legendFormat": "парковки головок",
"instant": false,
"range": true
}
],
"fieldConfig": {
"defaults": {
"custom": {
"lineWidth": 2,
"fillOpacity": 10,
"spanNulls": true
}
},
"overrides": []
},
"options": {},
"description": "Для прогноза ресурса: раскруток в сутки × 365 против запаса."
},
{
"id": 16,
"type": "timeseries",
"title": "Плохие сектора",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 23,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "smart_attribute_raw{instance=\"$instance\",serial=~\"$serial\",id=~\"5|197|198\"}",
"legendFormat": "{{name}}",
"instant": false,
"range": true
}
],
"fieldConfig": {
"defaults": {
"custom": {
"lineWidth": 2,
"fillOpacity": 10,
"spanNulls": true
}
},
"overrides": []
},
"options": {}
},
{
"id": 17,
"type": "timeseries",
"title": "Заполнение диска бэкапа",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 23,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "1 - backup_disk_avail_bytes{instance=\"$instance\"} / backup_disk_size_bytes{instance=\"$instance\"}",
"legendFormat": "{{mountpoint}}",
"instant": false,
"range": true
}
],
"fieldConfig": {
"defaults": {
"custom": {
"lineWidth": 2,
"fillOpacity": 10,
"spanNulls": true,
"thresholdsStyle": {
"mode": "line"
}
},
"unit": "percentunit",
"min": 0,
"max": 1,
"thresholds": {
"mode": "absolute",
"steps": [
{
"value": null,
"color": "green"
},
{
"value": 0.9,
"color": "red"
}
]
}
},
"overrides": []
},
"options": {}
},
{
"type": "row",
"title": "Вторая копия — диск в роутере",
"collapsed": false,
"gridPos": {
"x": 0,
"y": 31,
"w": 24,
"h": 1
},
"id": 200,
"panels": []
},
{
"id": 201,
"type": "stat",
"title": "Диск в роутере (SFTP)",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 32,
"w": 6,
"h": 4
},
"targets": [
{
"refId": "A",
"expr": "router_mount_up{instance=\"$instance\"}",
"instant": true,
"range": false
}
],
"fieldConfig": {
"defaults": {
"mappings": [
{
"type": "value",
"options": {
"1": {
"text": "доступен",
"color": "green"
},
"0": {
"text": "НЕДОСТУПЕН",
"color": "red"
}
}
}
]
},
"overrides": []
},
"description": "rclone-монтирование /mnt/router (Huawei SFTP :8022). Диск питается от роутера, не от малины.",
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "none",
"textMode": "value",
"justifyMode": "center"
}
},
{
"id": 202,
"type": "stat",
"title": "С последней копии на роутер",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 6,
"y": 32,
"w": 9,
"h": 4
},
"targets": [
{
"refId": "A",
"expr": "time() - backup_last_success_timestamp{instance=\"$instance\",job=\"backup_router\"}",
"instant": true,
"range": false
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"noValue": "ещё не было",
"thresholds": {
"mode": "absolute",
"steps": [
{
"value": null,
"color": "green"
},
{
"value": 93600,
"color": "orange"
},
{
"value": 108000,
"color": "red"
}
]
}
},
"overrides": []
},
"description": "Ежедневно 06:00: OneDrive (архив — copy, current — зеркало с --max-delete) и зашифрованные бэкапы серверов.",
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "none",
"textMode": "value",
"justifyMode": "center"
}
},
{
"id": 203,
"type": "stat",
"title": "Заполнение диска в роутере",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 15,
"y": 32,
"w": 9,
"h": 4
},
"targets": [
{
"refId": "A",
"expr": "1 - backup_disk_avail_bytes{instance=\"$instance\",mountpoint=\"/mnt/router\"} / backup_disk_size_bytes{instance=\"$instance\",mountpoint=\"/mnt/router\"}",
"instant": true,
"range": false
}
],
"fieldConfig": {
"defaults": {
"unit": "percentunit",
"min": 0,
"max": 1,
"thresholds": {
"mode": "absolute",
"steps": [
{
"value": null,
"color": "green"
},
{
"value": 0.8,
"color": "orange"
},
{
"value": 0.9,
"color": "red"
}
]
}
},
"overrides": []
},
"description": "",
"options": {
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"colorMode": "background",
"graphMode": "none",
"textMode": "value",
"justifyMode": "center"
}
}
]
}