Skip to content

Instantly share code, notes, and snippets.

@asciipip
Last active February 20, 2022 17:53
Show Gist options
  • Save asciipip/3d221851ff945d49f68d9577d007a691 to your computer and use it in GitHub Desktop.
Save asciipip/3d221851ff945d49f68d9577d007a691 to your computer and use it in GitHub Desktop.
ZFS collectd plugin

Put zfs.py into a directory (e.g. /opt/collectd-plugins). Load with, e.g.:

LoadPlugin python
<Plugin "python">
  ModulePath "/opt/collectd-plugins"
  Import "zfs"
</Plugin>

Load zfs.json and zfs_arc.json into Grafana. They assume the data is saved in a Grafana dataset named collectd.

{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 1,
"id": 38,
"iteration": 1627312358052,
"links": [
{
"icon": "external link",
"includeVars": true,
"keepTime": true,
"tags": [
"zfs"
],
"type": "dashboards"
},
{
"asDropdown": true,
"icon": "external link",
"includeVars": true,
"keepTime": true,
"tags": [
"plugin"
],
"type": "dashboards"
}
],
"panels": [
{
"collapsed": false,
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 21,
"panels": [],
"repeat": null,
"title": "Dashboard Row",
"type": "row"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 1
},
"hiddenSeries": false,
"id": 1,
"legend": {
"avg": false,
"current": true,
"max": false,
"min": false,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.4.3",
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$tag_instance",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"instance"
],
"type": "tag"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"measurement": "zfs_value",
"orderByTime": "ASC",
"policy": "$grain",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mean_value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "compression_ratio"
},
{
"condition": "AND",
"key": "type_instance",
"operator": "=",
"value": "compressratio"
},
{
"condition": "AND",
"key": "instance",
"operator": "=~",
"value": "/^$dataset$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Compression Ratios",
"tooltip": {
"shared": true,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:145",
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": "1",
"show": true
},
{
"$$hashKey": "object:146",
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"collapsed": false,
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 8
},
"id": 22,
"panels": [],
"repeat": "dataset",
"scopedVars": {
"dataset": {
"selected": false,
"text": "tank-barley",
"value": "tank-barley"
}
},
"title": "Dashboard Row",
"type": "row"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 9
},
"hiddenSeries": false,
"id": 2,
"legend": {
"avg": false,
"current": true,
"hideEmpty": true,
"hideZero": true,
"max": false,
"min": false,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.4.3",
"pointradius": 5,
"points": false,
"renderer": "flot",
"scopedVars": {
"dataset": {
"selected": false,
"text": "tank-barley",
"value": "tank-barley"
}
},
"seriesOverrides": [
{
"$$hashKey": "object:149",
"alias": "/^usedby/",
"fill": 3,
"linewidth": 0,
"stack": true
},
{
"$$hashKey": "object:150",
"alias": "available",
"hiddenSeries": true,
"stack": true,
"zindex": 2
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$tag_type_instance",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"type_instance"
],
"type": "tag"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"measurement": "zfs_value",
"orderByTime": "ASC",
"policy": "$grain",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mean_value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "bytes"
},
{
"condition": "AND",
"key": "instance",
"operator": "=~",
"value": "/^$dataset$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "$dataset Usage",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:129",
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"$$hashKey": "object:130",
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"collapsed": false,
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 16
},
"id": 23,
"panels": [],
"repeatIteration": 1627312358052,
"repeatPanelId": 22,
"scopedVars": {
"dataset": {
"selected": false,
"text": "tank-barley_home",
"value": "tank-barley_home"
}
},
"title": "Dashboard Row",
"type": "row"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 17
},
"hiddenSeries": false,
"id": 24,
"legend": {
"avg": false,
"current": true,
"hideEmpty": true,
"hideZero": true,
"max": false,
"min": false,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.4.3",
"pointradius": 5,
"points": false,
"renderer": "flot",
"repeatIteration": 1627312358052,
"repeatPanelId": 2,
"repeatedByRow": true,
"scopedVars": {
"dataset": {
"selected": false,
"text": "tank-barley_home",
"value": "tank-barley_home"
}
},
"seriesOverrides": [
{
"$$hashKey": "object:149",
"alias": "/^usedby/",
"fill": 3,
"linewidth": 0,
"stack": true
},
{
"$$hashKey": "object:150",
"alias": "available",
"hiddenSeries": true,
"stack": true,
"zindex": 2
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$tag_type_instance",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"type_instance"
],
"type": "tag"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"measurement": "zfs_value",
"orderByTime": "ASC",
"policy": "$grain",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mean_value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "bytes"
},
{
"condition": "AND",
"key": "instance",
"operator": "=~",
"value": "/^$dataset$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "$dataset Usage",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:129",
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"$$hashKey": "object:130",
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"collapsed": false,
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 24
},
"id": 25,
"panels": [],
"repeatIteration": 1627312358052,
"repeatPanelId": 22,
"scopedVars": {
"dataset": {
"selected": false,
"text": "tank-blaze",
"value": "tank-blaze"
}
},
"title": "Dashboard Row",
"type": "row"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 25
},
"hiddenSeries": false,
"id": 26,
"legend": {
"avg": false,
"current": true,
"hideEmpty": true,
"hideZero": true,
"max": false,
"min": false,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.4.3",
"pointradius": 5,
"points": false,
"renderer": "flot",
"repeatIteration": 1627312358052,
"repeatPanelId": 2,
"repeatedByRow": true,
"scopedVars": {
"dataset": {
"selected": false,
"text": "tank-blaze",
"value": "tank-blaze"
}
},
"seriesOverrides": [
{
"$$hashKey": "object:149",
"alias": "/^usedby/",
"fill": 3,
"linewidth": 0,
"stack": true
},
{
"$$hashKey": "object:150",
"alias": "available",
"hiddenSeries": true,
"stack": true,
"zindex": 2
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$tag_type_instance",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"type_instance"
],
"type": "tag"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"measurement": "zfs_value",
"orderByTime": "ASC",
"policy": "$grain",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mean_value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "bytes"
},
{
"condition": "AND",
"key": "instance",
"operator": "=~",
"value": "/^$dataset$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "$dataset Usage",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:129",
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"$$hashKey": "object:130",
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"collapsed": false,
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 32
},
"id": 27,
"panels": [],
"repeatIteration": 1627312358052,
"repeatPanelId": 22,
"scopedVars": {
"dataset": {
"selected": false,
"text": "tank-blaze_mail",
"value": "tank-blaze_mail"
}
},
"title": "Dashboard Row",
"type": "row"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 33
},
"hiddenSeries": false,
"id": 28,
"legend": {
"avg": false,
"current": true,
"hideEmpty": true,
"hideZero": true,
"max": false,
"min": false,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.4.3",
"pointradius": 5,
"points": false,
"renderer": "flot",
"repeatIteration": 1627312358052,
"repeatPanelId": 2,
"repeatedByRow": true,
"scopedVars": {
"dataset": {
"selected": false,
"text": "tank-blaze_mail",
"value": "tank-blaze_mail"
}
},
"seriesOverrides": [
{
"$$hashKey": "object:149",
"alias": "/^usedby/",
"fill": 3,
"linewidth": 0,
"stack": true
},
{
"$$hashKey": "object:150",
"alias": "available",
"hiddenSeries": true,
"stack": true,
"zindex": 2
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$tag_type_instance",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"type_instance"
],
"type": "tag"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"measurement": "zfs_value",
"orderByTime": "ASC",
"policy": "$grain",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mean_value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "bytes"
},
{
"condition": "AND",
"key": "instance",
"operator": "=~",
"value": "/^$dataset$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "$dataset Usage",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:129",
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"$$hashKey": "object:130",
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"collapsed": false,
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 40
},
"id": 29,
"panels": [],
"repeatIteration": 1627312358052,
"repeatPanelId": 22,
"scopedVars": {
"dataset": {
"selected": false,
"text": "tank-rtfm",
"value": "tank-rtfm"
}
},
"title": "Dashboard Row",
"type": "row"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 41
},
"hiddenSeries": false,
"id": 30,
"legend": {
"avg": false,
"current": true,
"hideEmpty": true,
"hideZero": true,
"max": false,
"min": false,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.4.3",
"pointradius": 5,
"points": false,
"renderer": "flot",
"repeatIteration": 1627312358052,
"repeatPanelId": 2,
"repeatedByRow": true,
"scopedVars": {
"dataset": {
"selected": false,
"text": "tank-rtfm",
"value": "tank-rtfm"
}
},
"seriesOverrides": [
{
"$$hashKey": "object:149",
"alias": "/^usedby/",
"fill": 3,
"linewidth": 0,
"stack": true
},
{
"$$hashKey": "object:150",
"alias": "available",
"hiddenSeries": true,
"stack": true,
"zindex": 2
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$tag_type_instance",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"type_instance"
],
"type": "tag"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"measurement": "zfs_value",
"orderByTime": "ASC",
"policy": "$grain",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mean_value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "bytes"
},
{
"condition": "AND",
"key": "instance",
"operator": "=~",
"value": "/^$dataset$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "$dataset Usage",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:129",
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"$$hashKey": "object:130",
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"collapsed": false,
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 48
},
"id": 31,
"panels": [],
"repeatIteration": 1627312358052,
"repeatPanelId": 22,
"scopedVars": {
"dataset": {
"selected": false,
"text": "tank-rtfm_cirlshare",
"value": "tank-rtfm_cirlshare"
}
},
"title": "Dashboard Row",
"type": "row"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 49
},
"hiddenSeries": false,
"id": 32,
"legend": {
"avg": false,
"current": true,
"hideEmpty": true,
"hideZero": true,
"max": false,
"min": false,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.4.3",
"pointradius": 5,
"points": false,
"renderer": "flot",
"repeatIteration": 1627312358052,
"repeatPanelId": 2,
"repeatedByRow": true,
"scopedVars": {
"dataset": {
"selected": false,
"text": "tank-rtfm_cirlshare",
"value": "tank-rtfm_cirlshare"
}
},
"seriesOverrides": [
{
"$$hashKey": "object:149",
"alias": "/^usedby/",
"fill": 3,
"linewidth": 0,
"stack": true
},
{
"$$hashKey": "object:150",
"alias": "available",
"hiddenSeries": true,
"stack": true,
"zindex": 2
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$tag_type_instance",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"type_instance"
],
"type": "tag"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"measurement": "zfs_value",
"orderByTime": "ASC",
"policy": "$grain",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mean_value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "bytes"
},
{
"condition": "AND",
"key": "instance",
"operator": "=~",
"value": "/^$dataset$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "$dataset Usage",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:129",
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"$$hashKey": "object:130",
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"collapsed": false,
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 56
},
"id": 33,
"panels": [],
"repeatIteration": 1627312358052,
"repeatPanelId": 22,
"scopedVars": {
"dataset": {
"selected": false,
"text": "tank-rtfm_encrypted",
"value": "tank-rtfm_encrypted"
}
},
"title": "Dashboard Row",
"type": "row"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 57
},
"hiddenSeries": false,
"id": 34,
"legend": {
"avg": false,
"current": true,
"hideEmpty": true,
"hideZero": true,
"max": false,
"min": false,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.4.3",
"pointradius": 5,
"points": false,
"renderer": "flot",
"repeatIteration": 1627312358052,
"repeatPanelId": 2,
"repeatedByRow": true,
"scopedVars": {
"dataset": {
"selected": false,
"text": "tank-rtfm_encrypted",
"value": "tank-rtfm_encrypted"
}
},
"seriesOverrides": [
{
"$$hashKey": "object:149",
"alias": "/^usedby/",
"fill": 3,
"linewidth": 0,
"stack": true
},
{
"$$hashKey": "object:150",
"alias": "available",
"hiddenSeries": true,
"stack": true,
"zindex": 2
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$tag_type_instance",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"type_instance"
],
"type": "tag"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"measurement": "zfs_value",
"orderByTime": "ASC",
"policy": "$grain",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mean_value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "bytes"
},
{
"condition": "AND",
"key": "instance",
"operator": "=~",
"value": "/^$dataset$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "$dataset Usage",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:129",
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"$$hashKey": "object:130",
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"collapsed": false,
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 64
},
"id": 35,
"panels": [],
"repeatIteration": 1627312358052,
"repeatPanelId": 22,
"scopedVars": {
"dataset": {
"selected": false,
"text": "tank-rtfm_encrypted_samba",
"value": "tank-rtfm_encrypted_samba"
}
},
"title": "Dashboard Row",
"type": "row"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 65
},
"hiddenSeries": false,
"id": 36,
"legend": {
"avg": false,
"current": true,
"hideEmpty": true,
"hideZero": true,
"max": false,
"min": false,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.4.3",
"pointradius": 5,
"points": false,
"renderer": "flot",
"repeatIteration": 1627312358052,
"repeatPanelId": 2,
"repeatedByRow": true,
"scopedVars": {
"dataset": {
"selected": false,
"text": "tank-rtfm_encrypted_samba",
"value": "tank-rtfm_encrypted_samba"
}
},
"seriesOverrides": [
{
"$$hashKey": "object:149",
"alias": "/^usedby/",
"fill": 3,
"linewidth": 0,
"stack": true
},
{
"$$hashKey": "object:150",
"alias": "available",
"hiddenSeries": true,
"stack": true,
"zindex": 2
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$tag_type_instance",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"type_instance"
],
"type": "tag"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"measurement": "zfs_value",
"orderByTime": "ASC",
"policy": "$grain",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mean_value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "bytes"
},
{
"condition": "AND",
"key": "instance",
"operator": "=~",
"value": "/^$dataset$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "$dataset Usage",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:129",
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"$$hashKey": "object:130",
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"collapsed": false,
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 72
},
"id": 37,
"panels": [],
"repeatIteration": 1627312358052,
"repeatPanelId": 22,
"scopedVars": {
"dataset": {
"selected": false,
"text": "tank-rtfm_users",
"value": "tank-rtfm_users"
}
},
"title": "Dashboard Row",
"type": "row"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 73
},
"hiddenSeries": false,
"id": 38,
"legend": {
"avg": false,
"current": true,
"hideEmpty": true,
"hideZero": true,
"max": false,
"min": false,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.4.3",
"pointradius": 5,
"points": false,
"renderer": "flot",
"repeatIteration": 1627312358052,
"repeatPanelId": 2,
"repeatedByRow": true,
"scopedVars": {
"dataset": {
"selected": false,
"text": "tank-rtfm_users",
"value": "tank-rtfm_users"
}
},
"seriesOverrides": [
{
"$$hashKey": "object:149",
"alias": "/^usedby/",
"fill": 3,
"linewidth": 0,
"stack": true
},
{
"$$hashKey": "object:150",
"alias": "available",
"hiddenSeries": true,
"stack": true,
"zindex": 2
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$tag_type_instance",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"type_instance"
],
"type": "tag"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"measurement": "zfs_value",
"orderByTime": "ASC",
"policy": "$grain",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mean_value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "bytes"
},
{
"condition": "AND",
"key": "instance",
"operator": "=~",
"value": "/^$dataset$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "$dataset Usage",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:129",
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"$$hashKey": "object:130",
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"refresh": "1m",
"schemaVersion": 27,
"style": "dark",
"tags": [
"plugin",
"zfs"
],
"templating": {
"list": [
{
"allValue": null,
"current": {
"selected": false,
"text": "5m",
"value": "5m"
},
"datasource": "collectd",
"definition": "",
"description": null,
"error": null,
"hide": 0,
"includeAll": false,
"label": null,
"multi": false,
"name": "grain",
"options": [
{
"selected": false,
"text": "3h",
"value": "3h"
},
{
"selected": false,
"text": "30m",
"value": "30m"
},
{
"selected": true,
"text": "5m",
"value": "5m"
},
{
"selected": false,
"text": "1m",
"value": "1m"
},
{
"selected": false,
"text": "10s",
"value": "10s"
}
],
"query": "SHOW RETENTION POLICIES",
"refresh": 0,
"regex": "/^\\d/",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"allValue": null,
"current": {
"selected": false,
"text": "host.example.com",
"value": "host.example.com"
},
"datasource": "collectd",
"definition": "",
"description": null,
"error": null,
"hide": 0,
"includeAll": false,
"label": null,
"multi": false,
"name": "host",
"options": [],
"query": "SHOW TAG VALUES FROM zfs_value WITH key = \"host\"",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"allValue": null,
"current": {
"selected": false,
"text": "All",
"value": "$__all"
},
"datasource": "collectd",
"definition": "",
"description": null,
"error": null,
"hide": 0,
"includeAll": true,
"label": null,
"multi": true,
"name": "dataset",
"options": [],
"query": "SHOW TAG VALUES FROM zfs_value WITH key = \"instance\" WHERE host =~ /^$host$/",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {
"from": "now-24h",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "browser",
"title": "Plugin: zfs",
"uid": "000000038",
"version": 11
}
#!/usr/bin/env python
import collectd
import subprocess
collectd.info('zfs: loading Python plugin: zfs')
FIELDS = [
'available',
'compressratio',
'logicalreferenced',
'logicalused',
'referenced',
'used',
'usedbydataset',
'usedbysnapshots',
'usedbychildren',
'usedbyrefreservation',
'quota',
'refquota',
'reservation',
'refreservation',
]
def submit_data(vl, plugin_instance, type_instance, value):
if plugin_instance is not None:
vl.plugin_instance = plugin_instance
if type_instance is not None:
vl.type_instance = type_instance
vl.dispatch(values=[value])
def read(data=None):
vl_bytes = collectd.Values(plugin='zfs', type='bytes')
vl_compression = collectd.Values(plugin='zfs', type='compression_ratio')
zfs_get = subprocess.Popen(['zfs', 'get', '-Hp', '-r', '-t', 'filesystem,volume', ','.join(FIELDS)], stdout=subprocess.PIPE)
(stdout, stderr) = zfs_get.communicate()
for line in stdout.splitlines():
ds_name, prop, value_str, source = line.split()
if value_str == '-':
continue
if prop == 'compressratio':
vl = vl_compression
value = float(value_str.strip('x'))
else:
vl = vl_bytes
value = int(value_str)
submit_data(vl, ds_name, prop, value)
collectd.register_read(read)
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 1,
"id": 27,
"iteration": 1627312348645,
"links": [
{
"icon": "external link",
"includeVars": true,
"keepTime": true,
"tags": [
"zfs"
],
"type": "dashboards"
},
{
"asDropdown": true,
"icon": "external link",
"includeVars": true,
"keepTime": true,
"tags": [
"plugin"
],
"type": "dashboards"
}
],
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"description": "Field meanings are as follow:\n\n * **L2** - Size of the L2ARC.\n * **arc** - Current size of the ARC\n * **c** - Target ARC size. (How big ZFS thinks the ARC ought to be.)\n * **p** - Target size for the MRU part of the ARC.\n * **metadata_size** - How much RAM is used for ARC metadata.\n * **anon_size**/**hdr_size**/**mfu_size**/**mru_size**/**other_size** - Divisions within the ARC.\n\nNot shown:\n\n * **c_min**/**c_max** - Minimum and maximum ARC size, as set by kernel module parameters.\n* **mfu_ghost_size**/**mru_ghost_size** - Amount of data pointed to by the MFU and MRU ghost entries.\n\nFor more information, see [The Adjustable Replacement Cache](https://pthree.org/2012/12/07/zfs-administration-part-iv-the-adjustable-replacement-cache/).",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 0
},
"hiddenSeries": false,
"id": 1,
"legend": {
"avg": false,
"current": true,
"max": false,
"min": false,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.4.3",
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [
{
"$$hashKey": "object:108",
"alias": "/size/",
"fill": 3,
"linewidth": 0,
"stack": true
},
{
"$$hashKey": "object:109",
"alias": "/ghost_size/",
"legend": false,
"lines": false,
"stack": false
},
{
"$$hashKey": "object:110",
"alias": "metadata_size",
"fill": 0,
"linewidth": 1,
"stack": false
},
{
"$$hashKey": "object:111",
"alias": "/^c_(min|max)/",
"legend": false,
"lines": false,
"stack": false,
"yaxis": 2
},
{
"$$hashKey": "object:112",
"alias": "mru_size",
"zindex": -3
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$tag_type_instance",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"type_instance"
],
"type": "tag"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"measurement": "zfs_arc_value",
"orderByTime": "ASC",
"policy": "$grain",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mean_value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "cache_size"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "ARC Size",
"tooltip": {
"shared": true,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:161",
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"$$hashKey": "object:162",
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": false
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 0
},
"hiddenSeries": false,
"id": 2,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.4.3",
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [
{
"alias": "tx",
"transform": "negative-Y"
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$tag_type_instance read",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"type_instance"
],
"type": "tag"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"measurement": "zfs_arc_rx",
"policy": "$grain",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mean_value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
},
{
"params": [
"1s"
],
"type": "non_negative_derivative"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "io_octets"
}
]
},
{
"alias": "$tag_type_instance write",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"type_instance"
],
"type": "tag"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"measurement": "zfs_arc_rx",
"policy": "$grain",
"refId": "B",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mean_value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
},
{
"params": [
"1s"
],
"type": "non_negative_derivative"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "io_octets"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "L2ARC I/O",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"description": "Cache hits and misses are in two groups.\n\nThe first group is the four values represented by {prefetch,demand}_{data,metadata}. Every I/O request falls into one of those four categories. Data versus metadata should be reasonably obvious. \"Demand\" means the OS requested a block and ZFS responded to the request. \"Prefetch\" means that ZFS thinks that something is reading sequential blocks from the filesystem (e.g. reading a large file from start to finish) so it is preemptively fetching blocks it think it's going to need.\n\nThe other four categories are _mfu-hit_, _mfu_ghost-hit_, _mru-hit_, and _mru_ghost-hit_. Those tell which part of the ARC yielded the hit. (Note that ghost \"hit\"s are really cache misses, since they result in fetches from disk. They inform the operation of the ARC, though.)\n\nFor more information, see [Activity of the ZFS ARC](http://dtrace.org/blogs/brendan/2012/01/09/activity-of-the-zfs-arc/).",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 3,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 7
},
"hiddenSeries": false,
"id": 3,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 0,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.4.3",
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [
{
"alias": "/miss/",
"stack": "B",
"transform": "negative-Y"
},
{
"alias": "/^m[fr]u/",
"linewidth": 1,
"stack": false
},
{
"alias": "/_ghost/",
"transform": "negative-Y"
}
],
"spaceLength": 10,
"stack": true,
"steppedLine": false,
"targets": [
{
"alias": "$tag_type_instance",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"type_instance"
],
"type": "tag"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"measurement": "zfs_arc_value",
"policy": "$grain",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mean_value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
},
{
"params": [
"1s"
],
"type": "non_negative_derivative"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "cache_result"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Cache Request Results",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "ops",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"description": "Cache hits and misses as a percentage of the total I/O load.\n\nCache hits are good, of course. Prefetch misses aren't bad because they're not delaying any real data requests (and in the best case they turn into cache hits later). Demand misses are the \"worst\" of these categories, since they represent a request that had to wait for data to be retrieved from disk.\n\nNote that there _should_ be a metric here for the average cache hit ratio, but Grafana doesn't like combining the second Y-axis with a stacked percentage on the first Y-axis.",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 6,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 7
},
"hiddenSeries": false,
"id": 4,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 0,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": true,
"pluginVersion": "7.4.3",
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [
{
"alias": "ratio",
"fill": 0,
"linewidth": 1,
"yaxis": 2,
"zindex": -3
},
{
"alias": "/hit/",
"zindex": -3
},
{
"alias": "/prefetch/",
"zindex": -2
}
],
"spaceLength": 10,
"stack": true,
"steppedLine": false,
"targets": [
{
"alias": "$tag_type_instance",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"type_instance"
],
"type": "tag"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"hide": false,
"measurement": "zfs_arc_value",
"policy": "$grain",
"refId": "B",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mean_value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
},
{
"params": [
"1s"
],
"type": "non_negative_derivative"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "cache_result"
},
{
"condition": "AND",
"key": "type_instance",
"operator": "=~",
"value": "/^m[fr]u-hit$/"
}
]
},
{
"alias": "$tag_type_instance",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"type_instance"
],
"type": "tag"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"hide": false,
"measurement": "zfs_arc_value",
"policy": "$grain",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mean_value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
},
{
"params": [
"1s"
],
"type": "non_negative_derivative"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "cache_result"
},
{
"condition": "AND",
"key": "type_instance",
"operator": "=~",
"value": "/-miss$/"
}
]
},
{
"alias": "ratio",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"type_instance"
],
"type": "tag"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"hide": true,
"measurement": "zfs_arc_value",
"policy": "$grain",
"refId": "C",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mean_value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "cache_ratio"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Cache Hit Ratio",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": "100",
"min": null,
"show": true
},
{
"format": "percentunit",
"label": null,
"logBase": 1,
"max": "1",
"min": "0",
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"description": "This shows the relation of ARC evictions to the L2ARC. The overall height of the graph shows the rate at which blocks are being evicted from the cache. Every eviction falls into one of the following categories:\n\n * **cached** - Block evicted from ARC and already in the L2ARC.\n * **eligible** - Block evicted from the ARC and eligible to be moved to the L2ARC.\n * **ineligible** - Block evicted from the ARC but it can't moved to the L2ARC.\n\nThe numbers here correspond to ARC entries moving from the MFU and MRU lists to their associated ghost lists.",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 6,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 14
},
"hiddenSeries": false,
"id": 5,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 0,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.4.3",
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": true,
"steppedLine": false,
"targets": [
{
"alias": "$tag_type_instance",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"type_instance"
],
"type": "tag"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"measurement": "zfs_arc_value",
"orderByTime": "ASC",
"policy": "$grain",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mean_value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
},
{
"params": [
"1s"
],
"type": "non_negative_derivative"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "cache_eviction"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "ARC Evictions in Relation to the L2ARC",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "Bps",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"description": "**deleted** tracks the number of times an entry is completely deleted from the cache. This corresponds to the entry being removed from either the MRU or MFU ghost list.\n\nIt does _not_ include block data being removed from the cache (which corresponds to the entry being moved from the MRU or MFU list to the affiliated ghost list).",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 14
},
"hiddenSeries": false,
"id": 6,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.4.3",
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"alias": "$tag_type_instance",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"type_instance"
],
"type": "tag"
},
{
"params": [
"none"
],
"type": "fill"
}
],
"measurement": "zfs_arc_value",
"policy": "$grain",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"mean_value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
},
{
"params": [
"1s"
],
"type": "non_negative_derivative"
}
]
],
"tags": [
{
"key": "host",
"operator": "=~",
"value": "/^$host$/"
},
{
"condition": "AND",
"key": "type",
"operator": "=",
"value": "cache_operation"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "ARC Deletions",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "ops",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"refresh": "1m",
"schemaVersion": 27,
"style": "dark",
"tags": [
"plugin",
"zfs"
],
"templating": {
"list": [
{
"allValue": null,
"current": {
"selected": false,
"text": "5m",
"value": "5m"
},
"datasource": "collectd",
"definition": "",
"description": null,
"error": null,
"hide": 0,
"includeAll": false,
"label": null,
"multi": false,
"name": "grain",
"options": [
{
"selected": false,
"text": "3h",
"value": "3h"
},
{
"selected": false,
"text": "30m",
"value": "30m"
},
{
"selected": false,
"text": "5m",
"value": "5m"
},
{
"selected": false,
"text": "1m",
"value": "1m"
},
{
"selected": true,
"text": "10s",
"value": "10s"
}
],
"query": "SHOW RETENTION POLICIES",
"refresh": 0,
"regex": "/^\\d/",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"allValue": null,
"current": {
"selected": true,
"text": "host.example.com",
"value": "host.example.com"
},
"datasource": "collectd",
"definition": "",
"description": null,
"error": null,
"hide": 0,
"includeAll": false,
"label": null,
"multi": false,
"name": "host",
"options": [],
"query": "SHOW TAG VALUES FROM zfs_arc_value WITH KEY = \"host\"",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {
"from": "now-24h",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "browser",
"title": "Plugin: zfs_arc",
"uid": "000000027",
"version": 6
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment