{ "title": "Drive Health (SMART)", "uid": "drive-health-smart", "description": "Per-drive SMART health in the style of CrystalDiskInfo: a Good/Caution/Bad verdict, full raw attribute tables for SATA, SCSI error counters for SAS, and self-test history.", "tags": [ "smart", "storage", "hardware" ], "timezone": "browser", "schemaVersion": 41, "version": 1, "editable": true, "graphTooltip": 1, "refresh": "1m", "time": { "from": "now-24h", "to": "now" }, "templating": { "list": [ { "name": "host", "label": "Host", "type": "query", "datasource": { "type": "prometheus", "uid": "prometheus" }, "query": { "qryType": 1, "query": "label_values(smartctl_device_smart_status, host)", "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 1, "includeAll": false, "multi": false, "options": [], "sort": 1, "hide": 0, "regex": "" }, { "name": "ata_device", "label": "SATA drive", "type": "query", "datasource": { "type": "prometheus", "uid": "prometheus" }, "query": { "qryType": 1, "query": "label_values(smartctl:row{bus=\"ata\", host=~\"$host\"}, row)", "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 1, "includeAll": true, "multi": true, "options": [], "sort": 1, "hide": 0, "regex": "/^(?(?\\S+)\\s.*)$/", "allValue": ".*", "current": { "text": [ "All" ], "value": [ "$__all" ] } }, { "name": "sas_device", "label": "SAS drive", "type": "query", "datasource": { "type": "prometheus", "uid": "prometheus" }, "query": { "qryType": 1, "query": "label_values(smartctl:row{bus=\"sas\", host=~\"$host\"}, row)", "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 1, "includeAll": true, "multi": true, "options": [], "sort": 1, "hide": 0, "regex": "/^(?(?\\S+)\\s.*)$/", "allValue": ".*", "current": { "text": [ "All" ], "value": [ "$__all" ] } } ] }, "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "datasource", "uid": "grafana" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "type": "dashboard" } ] }, "panels": [ { "type": "row", "title": "Fleet Overview", "id": 1, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, "collapsed": false, "panels": [] }, { "type": "stat", "title": "Healthy", "description": "Drives with no failing attribute, no SCSI uncorrected errors and a passing SMART self-assessment.", "id": 2, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 4, "x": 0, "y": 1 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "count(smartctl:health_code{host=~\"$host\"} == 0) or vector(0)", "refId": "A", "instant": true, "range": false, "legendFormat": "drives" } ] }, { "type": "stat", "title": "Caution", "description": "Reallocated / pending / uncorrectable sectors on SATA, or a non-empty grown defect list on SAS. Not failing yet \u2014 worth watching the trend.", "id": 3, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 4, "x": 4, "y": 1 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "orange", "value": 1 } ] } }, "overrides": [] }, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "count(smartctl:health_code{host=~\"$host\"} == 1) or vector(0)", "refId": "A", "instant": true, "range": false, "legendFormat": "drives" } ] }, { "type": "stat", "title": "Failing", "description": "SMART self-assessment failed, an attribute is at or below its threshold, or the drive reported errors it could not correct. Replace these.", "id": 4, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 4, "x": 8, "y": 1 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 1 } ] } }, "overrides": [] }, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "count(smartctl:health_code{host=~\"$host\"} == 2) or vector(0)", "refId": "A", "instant": true, "range": false, "legendFormat": "drives" } ] }, { "type": "stat", "title": "Drives", "description": "", "id": 5, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 4, "x": 12, "y": 1 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "count(smartctl_device_smart_status{host=~\"$host\"})", "refId": "A", "instant": true, "range": false, "legendFormat": "total" } ] }, { "type": "stat", "title": "Hottest Drive", "description": "", "id": 6, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 4, "x": 16, "y": 1 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "yellow", "value": 45 }, { "color": "red", "value": 55 } ] }, "unit": "celsius" }, "overrides": [] }, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max(smartctl_device_temperature{host=~\"$host\", temperature_type=\"current\"})", "refId": "A", "instant": true, "range": false, "legendFormat": "max" } ] }, { "type": "stat", "title": "Longest Powered On", "description": "", "id": 7, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 4, "x": 20, "y": 1 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "s" }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max(max by (device) (smartctl_device_power_on_seconds{host=~\"$host\"} or (smart_selftest_last_lifetime_hours{host=~\"$host\"} * 3600)))", "refId": "A", "instant": true, "range": false, "legendFormat": "max" } ] }, { "type": "table", "title": "All Drives", "description": "Every drive, worst first. Health is computed by rules/smartctl.yml.", "id": 8, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 10, "w": 16, "x": 0, "y": 5 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "inspect": false, "filterable": true }, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Health" }, "properties": [ { "id": "mappings", "value": [ { "type": "value", "options": { "0": { "text": "GOOD", "color": "green", "index": 0 }, "1": { "text": "CAUTION", "color": "orange", "index": 1 }, "2": { "text": "BAD", "color": "red", "index": 2 } } } ] }, { "id": "thresholds", "value": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "orange", "value": 1 }, { "color": "red", "value": 2 } ] } }, { "id": "custom.cellOptions", "value": { "type": "color-background", "mode": "basic" } } ] }, { "matcher": { "id": "byName", "options": "Temp" }, "properties": [ { "id": "unit", "value": "celsius" } ] }, { "matcher": { "id": "byName", "options": "Powered On" }, "properties": [ { "id": "unit", "value": "s" } ] }, { "matcher": { "id": "byName", "options": "Capacity" }, "properties": [ { "id": "unit", "value": "bytes" } ] } ] }, "options": { "showHeader": true, "cellHeight": "sm", "footer": { "show": false, "reducer": [ "sum" ], "countRows": false, "fields": "" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl:health_code{host=~\"$host\"} * on(device) group_left(model_name, serial_number, protocol) smartctl_device{host=~\"$host\"}", "refId": "A", "instant": true, "range": false, "format": "table" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max by (device) (smartctl_device_temperature{host=~\"$host\", temperature_type=\"current\"})", "refId": "B", "instant": true, "range": false, "format": "table" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max by (device) (smartctl_device_power_on_seconds{host=~\"$host\"} or (smart_selftest_last_lifetime_hours{host=~\"$host\"} * 3600))", "refId": "C", "instant": true, "range": false, "format": "table" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max by (device) (smartctl_device_capacity_bytes{host=~\"$host\"})", "refId": "D", "instant": true, "range": false, "format": "table" } ], "transformations": [ { "id": "filterFieldsByName", "options": { "include": { "pattern": "device|model_name|serial_number|protocol|Value.*" } } }, { "id": "joinByField", "options": { "byField": "device", "mode": "outer" } }, { "id": "organize", "options": { "excludeByName": {}, "indexByName": { "device": 0, "model_name": 1, "serial_number": 2, "protocol": 3, "Value #A": 4, "Value #B": 5, "Value #C": 6, "Value #D": 7 }, "renameByName": { "device": "Device", "model_name": "Model", "serial_number": "Serial", "protocol": "Bus", "Value #A": "Health", "Value #B": "Temp", "Value #C": "Powered On", "Value #D": "Capacity" } } }, { "id": "sortBy", "options": { "fields": {}, "sort": [ { "field": "Health", "desc": true } ] } } ] }, { "type": "timeseries", "title": "Temperatures", "description": "Sustained operation above ~45C measurably shortens drive life.", "id": 9, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 10, "w": 8, "x": 16, "y": 5 }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "lineInterpolation": "linear", "lineWidth": 1, "fillOpacity": 15, "showPoints": "never", "spanNulls": true, "axisBorderShow": false, "axisCenteredZero": false, "gradientMode": "none", "pointSize": 5, "scaleDistribution": { "type": "linear" }, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "celsius" }, "overrides": [] }, "options": { "legend": { "calcs": [ "lastNotNull", "max" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_device_temperature{host=~\"$host\", temperature_type=\"current\"}", "refId": "A", "instant": false, "range": true, "legendFormat": "{{device}}" } ] }, { "type": "row", "title": "${ata_device:text}", "id": 10, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 15 }, "collapsed": false, "panels": [], "repeat": "ata_device", "repeatDirection": "h" }, { "type": "stat", "title": "Health", "description": "", "id": 11, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 6, "x": 0, "y": 16 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "type": "value", "options": { "0": { "text": "GOOD", "color": "green", "index": 0 }, "1": { "text": "CAUTION", "color": "orange", "index": 1 }, "2": { "text": "BAD", "color": "red", "index": 2 } } } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "orange", "value": 1 }, { "color": "red", "value": 2 } ] } }, "overrides": [] }, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl:health_code{host=~\"$host\", device=~\"$ata_device\"}", "refId": "A", "instant": true, "range": false, "legendFormat": "{{device}}" } ] }, { "type": "stat", "title": "Temperature", "description": "", "id": 12, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 3, "x": 6, "y": 16 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "yellow", "value": 45 }, { "color": "red", "value": 55 } ] }, "unit": "celsius" }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_device_temperature{host=~\"$host\", device=~\"$ata_device\", temperature_type=\"current\"}", "refId": "A", "instant": true, "range": false, "legendFormat": "temp" } ] }, { "type": "stat", "title": "Powered On", "description": "", "id": 13, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 3, "x": 9, "y": 16 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "s" }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max by (device) (smartctl_device_power_on_seconds{host=~\"$host\", host=~\"$host\", device=~\"$ata_device\"} or (smart_selftest_last_lifetime_hours{host=~\"$host\", host=~\"$host\", device=~\"$ata_device\"} * 3600))", "refId": "A", "instant": true, "range": false, "legendFormat": "hours" } ] }, { "type": "stat", "title": "Capacity", "description": "", "id": 14, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 3, "x": 12, "y": 16 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "bytes" }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_device_capacity_bytes{host=~\"$host\", device=~\"$ata_device\"}", "refId": "A", "instant": true, "range": false, "legendFormat": "bytes" } ] }, { "type": "stat", "title": "Power Cycles", "description": "", "id": 15, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 3, "x": 15, "y": 16 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_device_power_cycle_count{host=~\"$host\", device=~\"$ata_device\"}", "refId": "A", "instant": true, "range": false, "legendFormat": "cycles" } ] }, { "type": "stat", "title": "Reallocated Sectors", "description": "Attribute 5 raw. Sectors the drive has already retired. Any growth here is the single most predictive sign of impending failure.", "id": 16, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 3, "x": 18, "y": 16 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 1 } ] } }, "overrides": [] }, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_device_attribute{host=~\"$host\", device=~\"$ata_device\", attribute_id=\"5\", attribute_value_type=\"raw\"}", "refId": "A", "instant": true, "range": false, "legendFormat": "sectors" } ] }, { "type": "stat", "title": "Pending Sectors", "description": "Attribute 197 raw. Sectors that failed to read and are waiting to be reallocated on next write. Often precedes reallocations.", "id": 17, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 3, "x": 21, "y": 16 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 1 } ] } }, "overrides": [] }, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_device_attribute{host=~\"$host\", device=~\"$ata_device\", attribute_id=\"197\", attribute_value_type=\"raw\"}", "refId": "A", "instant": true, "range": false, "legendFormat": "sectors" } ] }, { "type": "table", "title": "Drive \u2014 $ata_device", "description": "Identity of this drive. RPM shows SSD when the drive reports no rotation rate.", "id": 18, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 24, "x": 0, "y": 20 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "inspect": false, "filterable": true }, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Capacity" }, "properties": [ { "id": "unit", "value": "bytes" } ] }, { "matcher": { "id": "byName", "options": "RPM" }, "properties": [ { "id": "unit", "value": "rotrpm" }, { "id": "noValue", "value": "SSD" } ] } ] }, "options": { "showHeader": true, "cellHeight": "sm", "footer": { "show": false, "reducer": [ "sum" ], "countRows": false, "fields": "" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_device{host=~\"$host\", device=~\"$ata_device\"}", "refId": "A", "instant": true, "range": false, "format": "table" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max by (device) (smartctl_device_rotation_rate{host=~\"$host\", device=~\"$ata_device\"})", "refId": "B", "instant": true, "range": false, "format": "table" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max by (device) (smartctl_device_capacity_bytes{host=~\"$host\", device=~\"$ata_device\"})", "refId": "C", "instant": true, "range": false, "format": "table" } ], "transformations": [ { "id": "filterFieldsByName", "options": { "include": { "pattern": "device|model_family|model_name|serial_number|firmware_version|interface|sata_version|form_factor|Value.*" } } }, { "id": "joinByField", "options": { "byField": "device", "mode": "outer" } }, { "id": "organize", "options": { "excludeByName": { "Value #A": true }, "indexByName": { "device": 0, "model_family": 1, "model_name": 2, "serial_number": 3, "firmware_version": 4, "interface": 5, "sata_version": 6, "form_factor": 7, "Value #B": 8, "Value #C": 9 }, "renameByName": { "device": "Device", "Value #B": "RPM", "Value #C": "Capacity", "model_family": "Family", "model_name": "Model", "serial_number": "Serial", "firmware_version": "Firmware", "interface": "Interface", "sata_version": "SATA", "form_factor": "Form" } } } ] }, { "type": "table", "title": "SMART Attributes \u2014 $ata_device", "description": "Every attribute the drive reports, with its raw value. Current/Worst are normalised 0-253 scores (higher is better); Threshold is where the vendor declares failure; Margin is Current minus Threshold. ID sorts as text, so the table is ordered by attribute name.", "id": 19, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 12, "w": 24, "x": 0, "y": 24 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "inspect": false, "filterable": true }, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Margin" }, "properties": [ { "id": "thresholds", "value": { "mode": "absolute", "steps": [ { "color": "red", "value": null }, { "color": "orange", "value": 1 }, { "color": "yellow", "value": 10 }, { "color": "green", "value": 25 } ] } }, { "id": "custom.cellOptions", "value": { "type": "color-background", "mode": "basic" } } ] } ] }, "options": { "showHeader": true, "cellHeight": "sm", "footer": { "show": false, "reducer": [ "sum" ], "countRows": false, "fields": "" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_device_attribute{host=~\"$host\", device=~\"$ata_device\", attribute_value_type=\"value\"}", "refId": "A", "instant": true, "range": false, "format": "table" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max by (attribute_id) (smartctl_device_attribute{host=~\"$host\", device=~\"$ata_device\", attribute_value_type=\"worst\"})", "refId": "B", "instant": true, "range": false, "format": "table" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max by (attribute_id) (smartctl_device_attribute{host=~\"$host\", device=~\"$ata_device\", attribute_value_type=\"thresh\"})", "refId": "C", "instant": true, "range": false, "format": "table" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max by (attribute_id) (smartctl_device_attribute{host=~\"$host\", device=~\"$ata_device\", attribute_value_type=\"raw\"})", "refId": "D", "instant": true, "range": false, "format": "table" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max by (attribute_id) (smartctl_device_attribute{host=~\"$host\", device=~\"$ata_device\", attribute_value_type=\"value\"} - on(device, attribute_id) smartctl_device_attribute{host=~\"$host\", device=~\"$ata_device\", attribute_value_type=\"thresh\"})", "refId": "E", "instant": true, "range": false, "format": "table" } ], "transformations": [ { "id": "filterFieldsByName", "options": { "include": { "pattern": "attribute_id|attribute_name|Value.*" } } }, { "id": "joinByField", "options": { "byField": "attribute_id", "mode": "outer" } }, { "id": "organize", "options": { "excludeByName": {}, "indexByName": { "attribute_id": 0, "attribute_name": 1, "Value #A": 2, "Value #B": 3, "Value #C": 4, "Value #D": 5, "Value #E": 6 }, "renameByName": { "attribute_id": "ID", "attribute_name": "Attribute", "Value #A": "Current", "Value #B": "Worst", "Value #C": "Threshold", "Value #D": "Raw", "Value #E": "Margin" } } }, { "id": "sortBy", "options": { "fields": {}, "sort": [ { "field": "Attribute", "desc": false } ] } } ] }, { "type": "row", "title": "${sas_device:text}", "id": 20, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 36 }, "collapsed": false, "panels": [], "repeat": "sas_device", "repeatDirection": "h" }, { "type": "stat", "title": "Health", "description": "", "id": 21, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 6, "x": 0, "y": 37 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "type": "value", "options": { "0": { "text": "GOOD", "color": "green", "index": 0 }, "1": { "text": "CAUTION", "color": "orange", "index": 1 }, "2": { "text": "BAD", "color": "red", "index": 2 } } } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "orange", "value": 1 }, { "color": "red", "value": 2 } ] } }, "overrides": [] }, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl:health_code{host=~\"$host\", device=~\"$sas_device\"}", "refId": "A", "instant": true, "range": false, "legendFormat": "{{device}}" } ] }, { "type": "stat", "title": "Temperature", "description": "", "id": 22, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 3, "x": 6, "y": 37 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "yellow", "value": 45 }, { "color": "red", "value": 55 } ] }, "unit": "celsius" }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_device_temperature{host=~\"$host\", device=~\"$sas_device\", temperature_type=\"current\"}", "refId": "A", "instant": true, "range": false, "legendFormat": "temp" } ] }, { "type": "stat", "title": "Powered On", "description": "SAS drives have no ATA attribute 9, so smartctl reports power_on_time from the Background Scan Results log page \u2014 a counter the background-scan subsystem maintains, not the drive's lifetime meter, and one that commonly reads far too low. This tile takes the larger of that counter and the lifetime-hours stamp in the drive's own self-test log, which is why it can exceed what `smartctl -x` prints as 'Accumulated power on time'.", "id": 23, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 3, "x": 9, "y": 37 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "s" }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max by (device) (smartctl_device_power_on_seconds{host=~\"$host\", host=~\"$host\", device=~\"$sas_device\"} or (smart_selftest_last_lifetime_hours{host=~\"$host\", host=~\"$host\", device=~\"$sas_device\"} * 3600))", "refId": "A", "instant": true, "range": false, "legendFormat": "hours" } ] }, { "type": "stat", "title": "Capacity", "description": "", "id": 24, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 3, "x": 12, "y": 37 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "bytes" }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_device_capacity_bytes{host=~\"$host\", device=~\"$sas_device\"}", "refId": "A", "instant": true, "range": false, "legendFormat": "bytes" } ] }, { "type": "stat", "title": "Link Speed", "description": "Negotiated SAS link rate. A drive that has fallen back to a lower rate is worth investigating \u2014 usually a cable or expander.", "id": 25, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 3, "x": 15, "y": 37 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "bps" }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_device_interface_speed{host=~\"$host\", device=~\"$sas_device\", speed_type=\"current\"} * 1000", "refId": "A", "instant": true, "range": false, "legendFormat": "bps" } ] }, { "type": "stat", "title": "Grown Defects", "description": "Sectors reallocated since the drive left the factory \u2014 the SAS equivalent of ATA attribute 5. A stable non-zero count is tolerable; growth is not.", "id": 26, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 3, "x": 18, "y": 37 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 1 } ] } }, "overrides": [] }, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_scsi_grown_defect_list{host=~\"$host\", device=~\"$sas_device\"}", "refId": "A", "instant": true, "range": false, "legendFormat": "defects" } ] }, { "type": "stat", "title": "Uncorrected Errors", "description": "Errors the drive could not correct with ECC or retries, which means data was lost. Should be zero.", "id": 27, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 3, "x": 21, "y": 37 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 1 } ] } }, "overrides": [] }, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_read_total_uncorrected_errors{host=~\"$host\", device=~\"$sas_device\"} + smartctl_write_total_uncorrected_errors{host=~\"$host\", device=~\"$sas_device\"}", "refId": "A", "instant": true, "range": false, "legendFormat": "errors" } ] }, { "type": "table", "title": "Drive \u2014 $sas_device", "description": "Identity of this drive. SAS drives leave firmware_version empty and report their revision in scsi_revision instead.", "id": 28, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 4, "w": 24, "x": 0, "y": 41 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "inspect": false, "filterable": true }, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Capacity" }, "properties": [ { "id": "unit", "value": "bytes" } ] }, { "matcher": { "id": "byName", "options": "RPM" }, "properties": [ { "id": "unit", "value": "rotrpm" }, { "id": "noValue", "value": "SSD" } ] } ] }, "options": { "showHeader": true, "cellHeight": "sm", "footer": { "show": false, "reducer": [ "sum" ], "countRows": false, "fields": "" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_device{host=~\"$host\", device=~\"$sas_device\"}", "refId": "A", "instant": true, "range": false, "format": "table" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max by (device) (smartctl_device_rotation_rate{host=~\"$host\", device=~\"$sas_device\"})", "refId": "B", "instant": true, "range": false, "format": "table" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max by (device) (smartctl_device_capacity_bytes{host=~\"$host\", device=~\"$sas_device\"})", "refId": "C", "instant": true, "range": false, "format": "table" } ], "transformations": [ { "id": "filterFieldsByName", "options": { "include": { "pattern": "device|scsi_vendor|model_name|serial_number|scsi_revision|scsi_version|protocol|form_factor|Value.*" } } }, { "id": "joinByField", "options": { "byField": "device", "mode": "outer" } }, { "id": "organize", "options": { "excludeByName": { "Value #A": true }, "indexByName": { "device": 0, "scsi_vendor": 1, "model_name": 2, "serial_number": 3, "scsi_revision": 4, "scsi_version": 5, "protocol": 6, "form_factor": 7, "Value #B": 8, "Value #C": 9 }, "renameByName": { "device": "Device", "Value #B": "RPM", "Value #C": "Capacity", "scsi_vendor": "Vendor", "model_name": "Model", "serial_number": "Serial", "scsi_revision": "Revision", "scsi_version": "SCSI", "protocol": "Bus", "form_factor": "Form" } } } ] }, { "type": "timeseries", "title": "Corrected Errors \u2014 $sas_device", "description": "Errors the drive fixed on its own. ECC-fast corrections are routine and grow constantly. Delayed corrections and especially rewrites/retries climbing is the signal worth watching.", "id": 29, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 45 }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "lineInterpolation": "linear", "lineWidth": 1, "fillOpacity": 15, "showPoints": "never", "spanNulls": true, "axisBorderShow": false, "axisCenteredZero": false, "gradientMode": "none", "pointSize": 5, "scaleDistribution": { "type": "linear" }, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "min": 0 }, "overrides": [] }, "options": { "legend": { "calcs": [ "lastNotNull", "max" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_read_errors_corrected_by_eccfast{host=~\"$host\", device=~\"$sas_device\"}", "refId": "A", "instant": false, "range": true, "legendFormat": "read ECC fast" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_read_errors_corrected_by_eccdelayed{host=~\"$host\", device=~\"$sas_device\"}", "refId": "B", "instant": false, "range": true, "legendFormat": "read ECC delayed" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_read_errors_corrected_by_rereads_rewrites{host=~\"$host\", device=~\"$sas_device\"}", "refId": "C", "instant": false, "range": true, "legendFormat": "read retries" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_write_errors_corrected_by_eccfast{host=~\"$host\", device=~\"$sas_device\"}", "refId": "D", "instant": false, "range": true, "legendFormat": "write ECC fast" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_write_errors_corrected_by_eccdelayed{host=~\"$host\", device=~\"$sas_device\"}", "refId": "E", "instant": false, "range": true, "legendFormat": "write ECC delayed" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_write_errors_corrected_by_rereads_rewrites{host=~\"$host\", device=~\"$sas_device\"}", "refId": "F", "instant": false, "range": true, "legendFormat": "write retries" } ] }, { "type": "timeseries", "title": "Defects & Uncorrected \u2014 $sas_device", "description": "Flat lines are good. Any upward step here is a real event.", "id": 30, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 45 }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "lineInterpolation": "linear", "lineWidth": 2, "fillOpacity": 0, "showPoints": "auto", "spanNulls": true, "axisBorderShow": false, "axisCenteredZero": false, "gradientMode": "none", "pointSize": 5, "scaleDistribution": { "type": "linear" }, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "min": 0 }, "overrides": [] }, "options": { "legend": { "calcs": [ "lastNotNull", "max" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_scsi_grown_defect_list{host=~\"$host\", device=~\"$sas_device\"}", "refId": "A", "instant": false, "range": true, "legendFormat": "grown defects" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_read_total_uncorrected_errors{host=~\"$host\", device=~\"$sas_device\"}", "refId": "B", "instant": false, "range": true, "legendFormat": "read uncorrected" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_write_total_uncorrected_errors{host=~\"$host\", device=~\"$sas_device\"}", "refId": "C", "instant": false, "range": true, "legendFormat": "write uncorrected" } ] }, { "type": "row", "title": "Self-Tests", "id": 31, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 53 }, "collapsed": false, "panels": [] }, { "type": "stat", "title": "Drives Never Tested", "description": "Drives with no self-test log entries at all. smartd only runs tests if its config includes an -s schedule; merely enabling the service does not.", "id": 32, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 5, "w": 4, "x": 0, "y": 54 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 1 } ] } }, "overrides": [] }, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "count(smartctl_device_smart_status{host=~\"$host\"}) - count(count by (device) (smart_selftest_last_lifetime_hours{host=~\"$host\"})) or count(smartctl_device_smart_status{host=~\"$host\"})", "refId": "A", "instant": true, "range": false, "legendFormat": "drives" } ] }, { "type": "stat", "title": "Failed Self-Tests", "description": "", "id": 33, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 5, "w": 4, "x": 4, "y": 54 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 1 } ] } }, "overrides": [] }, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "count(smart_selftest_last_passed{host=~\"$host\"} == 0) or vector(0)", "refId": "A", "instant": true, "range": false, "legendFormat": "tests" } ] }, { "type": "stat", "title": "Oldest Long Test", "description": "Powered-on hours since the least recently tested drive last completed an extended (long) self-test. Shows 'never run' when no drive has ever completed one \u2014 which is the default state, since smartd schedules no tests unless its config carries an -s directive.", "id": 34, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 5, "w": 4, "x": 8, "y": 54 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "yellow", "value": 336 }, { "color": "red", "value": 1080 } ] }, "unit": "h", "noValue": "never run" }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "textMode": "auto", "wideLayout": true, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max(max by (device) (smartctl_device_power_on_seconds{host=~\"$host\"} or (smart_selftest_last_lifetime_hours{host=~\"$host\"} * 3600)) / 3600 - on(device) group_right() smart_selftest_last_lifetime_hours{host=~\"$host\", test_type=\"extended\"})", "refId": "A", "instant": true, "range": false, "legendFormat": "hours ago" } ] }, { "type": "table", "title": "Self-Test History", "description": "Short and extended self-test results per drive, from collectors/smart-selftest.py. 'At Hours' is the drive's powered-on hour count when the test ran, straight from the log. 'Hours Ago' subtracts it from the drive's current powered-on hours; on SAS that figure already falls back to this log, so 0 means the newest log entry is also the highest hour count the drive has ever reported \u2014 not that the test ran just now.", "id": 35, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 10, "w": 12, "x": 12, "y": 54 }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "inspect": false, "filterable": true }, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Last Result" }, "properties": [ { "id": "mappings", "value": [ { "type": "value", "options": { "0": { "text": "FAILED", "color": "red", "index": 0 }, "1": { "text": "passed", "color": "green", "index": 1 } } } ] }, { "id": "custom.cellOptions", "value": { "type": "color-background", "mode": "basic" } } ] } ] }, "options": { "showHeader": true, "cellHeight": "sm", "footer": { "show": false, "reducer": [ "sum" ], "countRows": false, "fields": "" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "label_join(smart_selftest_last_passed{host=~\"$host\"}, \"drive_test\", \"/\", \"device\", \"test_type\")", "refId": "A", "instant": true, "range": false, "format": "table" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max by (drive_test) (label_join(smart_selftest_last_lifetime_hours{host=~\"$host\"}, \"drive_test\", \"/\", \"device\", \"test_type\"))", "refId": "B", "instant": true, "range": false, "format": "table" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max by (drive_test) (label_join(smart_selftest_count{host=~\"$host\"}, \"drive_test\", \"/\", \"device\", \"test_type\"))", "refId": "C", "instant": true, "range": false, "format": "table" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max by (drive_test) (label_join(max by (device) (smartctl_device_power_on_seconds{host=~\"$host\"} or (smart_selftest_last_lifetime_hours{host=~\"$host\"} * 3600)) / 3600 - on(device) group_right() smart_selftest_last_lifetime_hours{host=~\"$host\"}, \"drive_test\", \"/\", \"device\", \"test_type\"))", "refId": "D", "instant": true, "range": false, "format": "table" } ], "transformations": [ { "id": "filterFieldsByName", "options": { "include": { "pattern": "drive_test|device|test_type|Value.*" } } }, { "id": "joinByField", "options": { "byField": "drive_test", "mode": "outer" } }, { "id": "organize", "options": { "excludeByName": { "drive_test": true }, "indexByName": { "device": 0, "test_type": 1, "Value #A": 2, "Value #B": 3, "Value #C": 4, "Value #D": 5 }, "renameByName": { "device": "Device", "test_type": "Test", "Value #A": "Last Result", "Value #B": "At Hours", "Value #C": "Logged", "Value #D": "Hours Ago" } } }, { "id": "sortBy", "options": { "fields": {}, "sort": [ { "field": "Device", "desc": false } ] } } ] }, { "type": "row", "title": "Attribute Trends", "id": 41, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 64 }, "collapsed": true, "panels": [ { "type": "timeseries", "title": "Reallocated Sectors (all SATA drives)", "description": "", "id": 36, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 8, "x": 0, "y": 65 }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "lineInterpolation": "linear", "lineWidth": 2, "fillOpacity": 0, "showPoints": "auto", "spanNulls": true, "axisBorderShow": false, "axisCenteredZero": false, "gradientMode": "none", "pointSize": 5, "scaleDistribution": { "type": "linear" }, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "min": 0 }, "overrides": [] }, "options": { "legend": { "calcs": [ "lastNotNull", "max" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_device_attribute{host=~\"$host\", attribute_id=\"5\", attribute_value_type=\"raw\"}", "refId": "A", "instant": false, "range": true, "legendFormat": "{{device}}" } ] }, { "type": "timeseries", "title": "Pending & Uncorrectable Sectors", "description": "", "id": 37, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 8, "x": 8, "y": 65 }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "lineInterpolation": "linear", "lineWidth": 2, "fillOpacity": 0, "showPoints": "auto", "spanNulls": true, "axisBorderShow": false, "axisCenteredZero": false, "gradientMode": "none", "pointSize": 5, "scaleDistribution": { "type": "linear" }, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "min": 0 }, "overrides": [] }, "options": { "legend": { "calcs": [ "lastNotNull", "max" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_device_attribute{host=~\"$host\", attribute_id=~\"197|198\", attribute_value_type=\"raw\"}", "refId": "A", "instant": false, "range": true, "legendFormat": "{{device}} {{attribute_name}}" } ] }, { "type": "timeseries", "title": "CRC Errors (cabling)", "description": "Attribute 199 counts errors on the SATA link rather than the platters. Growth here usually means a cable or backplane, not a dying disk.", "id": 38, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 8, "x": 16, "y": 65 }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "lineInterpolation": "linear", "lineWidth": 2, "fillOpacity": 0, "showPoints": "auto", "spanNulls": true, "axisBorderShow": false, "axisCenteredZero": false, "gradientMode": "none", "pointSize": 5, "scaleDistribution": { "type": "linear" }, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "min": 0 }, "overrides": [] }, "options": { "legend": { "calcs": [ "lastNotNull", "max" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_device_attribute{host=~\"$host\", attribute_id=\"199\", attribute_value_type=\"raw\"}", "refId": "A", "instant": false, "range": true, "legendFormat": "{{device}}" } ] }, { "type": "timeseries", "title": "Data Written / Read (SAS)", "description": "", "id": 39, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 72 }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "lineInterpolation": "linear", "lineWidth": 1, "fillOpacity": 15, "showPoints": "never", "spanNulls": true, "axisBorderShow": false, "axisCenteredZero": false, "gradientMode": "none", "pointSize": 5, "scaleDistribution": { "type": "linear" }, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "bytes", "min": 0 }, "overrides": [] }, "options": { "legend": { "calcs": [ "lastNotNull", "max" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_device_bytes_written{host=~\"$host\"}", "refId": "A", "instant": false, "range": true, "legendFormat": "{{device}} written" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_device_bytes_read{host=~\"$host\"}", "refId": "B", "instant": false, "range": true, "legendFormat": "{{device}} read" } ] }, { "type": "timeseries", "title": "Health Code History", "description": "", "id": 40, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 72 }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "lineInterpolation": "stepAfter", "lineWidth": 2, "fillOpacity": 0, "showPoints": "never", "spanNulls": true, "axisBorderShow": false, "axisCenteredZero": false, "gradientMode": "none", "pointSize": 5, "scaleDistribution": { "type": "linear" }, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [ { "type": "value", "options": { "0": { "text": "GOOD", "color": "green", "index": 0 }, "1": { "text": "CAUTION", "color": "orange", "index": 1 }, "2": { "text": "BAD", "color": "red", "index": 2 } } } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "min": 0, "max": 2 }, "overrides": [] }, "options": { "legend": { "calcs": [ "lastNotNull", "max" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl:health_code{host=~\"$host\"}", "refId": "A", "instant": false, "range": true, "legendFormat": "{{device}}" } ] } ] }, { "type": "row", "title": "Collector Health", "id": 45, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 65 }, "collapsed": true, "panels": [ { "type": "timeseries", "title": "smartctl Exit Status", "description": "Non-zero means smartctl itself had trouble reading the device. Bit 0 is a command-line problem, bit 1 a device-open failure, bit 3 a failing drive.", "id": 42, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 8, "x": 0, "y": 66 }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "lineInterpolation": "linear", "lineWidth": 1, "fillOpacity": 15, "showPoints": "never", "spanNulls": true, "axisBorderShow": false, "axisCenteredZero": false, "gradientMode": "none", "pointSize": 5, "scaleDistribution": { "type": "linear" }, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "min": 0 }, "overrides": [] }, "options": { "legend": { "calcs": [ "lastNotNull", "max" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_device_smartctl_exit_status{host=~\"$host\"}", "refId": "A", "instant": false, "range": true, "legendFormat": "{{device}}" } ] }, { "type": "timeseries", "title": "Self-Test Collector Duration", "description": "", "id": 43, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 8, "x": 8, "y": 66 }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "lineInterpolation": "linear", "lineWidth": 1, "fillOpacity": 15, "showPoints": "never", "spanNulls": true, "axisBorderShow": false, "axisCenteredZero": false, "gradientMode": "none", "pointSize": 5, "scaleDistribution": { "type": "linear" }, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "s", "min": 0 }, "overrides": [] }, "options": { "legend": { "calcs": [ "lastNotNull", "max" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smart_selftest_collection_duration_seconds{host=~\"$host\"}", "refId": "A", "instant": false, "range": true, "legendFormat": "collection" } ] }, { "type": "timeseries", "title": "Devices Seen", "description": "These should agree. A divergence means one of the two cannot see some drives.", "id": 44, "datasource": { "type": "prometheus", "uid": "prometheus" }, "gridPos": { "h": 7, "w": 8, "x": 16, "y": 66 }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "lineInterpolation": "linear", "lineWidth": 1, "fillOpacity": 15, "showPoints": "never", "spanNulls": true, "axisBorderShow": false, "axisCenteredZero": false, "gradientMode": "none", "pointSize": 5, "scaleDistribution": { "type": "linear" }, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "min": 0 }, "overrides": [] }, "options": { "legend": { "calcs": [ "lastNotNull", "max" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smartctl_devices{host=~\"$host\"}", "refId": "A", "instant": false, "range": true, "legendFormat": "exporter" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "smart_selftest_devices{host=~\"$host\"}", "refId": "B", "instant": false, "range": true, "legendFormat": "self-test collector" } ] } ] } ] }