Skip to content

Commit 2be8d70

Browse files
committed
feat(node): zfs monitor and grafana ui
## Installation Add parameters: - `zfs_exporter_enabled`: setup zfs_exporter on this node, false by default - `zfs_exporter_version`: current `3.8.0` - `zfs_exporter_port`: zfs exporter listen port, 9134 by default - `zfs_exporter_options`: see "/roles/node_monitor/defaults/main.yml" ## Prometheus Add [node_exporter] (forked from [pdf-node_exporter]) with more metrics: - `node:zfs:pool_metrics` - `node:zfs:dataset_metrics` Add alert rules: - `ZPoolDegraded` - `ZPoolFaulted` - `ZPoolOffline` - `ZPoolUnavail` - `ZPoolRemoved` - `ZPoolSuspended` - `ZPoolReadonly` - `ZPoolSpaceFull` - `ZDatasetSpaceFull` Update alert rule: - `NodeFsSpaceFull` with `fstype!="zfs"` ## Grafana Add panels: - [node-zfs.json] - list ZFS Pools and Datasets - unhealthy pool list fisrt - ability search with `Node ID`, `Pool`, `Dataset` - alert summary about zfs Update panels: - [node-overview.json](http://g.pigsty/d/node-overview/node-overview) - add `ZFS Pools` Row - unhealthy pool list fisrt - [node-alert.json](http://g.pigsty/d/node-alert/node-alert) - show zfs alerts - cell link to [node-overview.json] page with pool name and/or dataset name filter [node_exporter]: https://github.com/waitingsong/zfs_exporter [pdf-node_exporter]: https://github.com/pdf/zfs_exporter [node-overview.json]: http://g.pigsty/d/node-overview/node-overview
1 parent eb6fd0e commit 2be8d70

File tree

7 files changed

+4423
-46
lines changed

7 files changed

+4423
-46
lines changed

files/grafana/node/node-alert.json

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
"textMode": "auto",
172172
"wideLayout": true
173173
},
174-
"pluginVersion": "11.1.3",
174+
"pluginVersion": "11.5.2",
175175
"targets": [
176176
{
177177
"datasource": {
@@ -278,7 +278,7 @@
278278
"textMode": "auto",
279279
"wideLayout": true
280280
},
281-
"pluginVersion": "11.1.3",
281+
"pluginVersion": "11.5.2",
282282
"targets": [
283283
{
284284
"datasource": {
@@ -420,6 +420,7 @@
420420
"sort": "none"
421421
}
422422
},
423+
"pluginVersion": "11.5.2",
423424
"targets": [
424425
{
425426
"datasource": {
@@ -827,6 +828,48 @@
827828
]
828829
}
829830
]
831+
},
832+
{
833+
"matcher": {
834+
"id": "byName",
835+
"options": "ZFS_Pool"
836+
},
837+
"properties": [
838+
{
839+
"id": "links",
840+
"value": [
841+
{
842+
"title": "Node Instance: ${__data.fields.IP}",
843+
"url": "/d/zfs-overview/node-zfs?var-id=${__data.fields.IP}&${__url_time_range}&var-pool=${__data.fields.ZFS_Pool}"
844+
}
845+
]
846+
},
847+
{
848+
"id": "custom.width",
849+
"value": 100
850+
}
851+
]
852+
},
853+
{
854+
"matcher": {
855+
"id": "byName",
856+
"options": "ZFS_Dataset"
857+
},
858+
"properties": [
859+
{
860+
"id": "links",
861+
"value": [
862+
{
863+
"title": "",
864+
"url": "/d/zfs-overview/node-zfs?var-id=${__data.fields.IP}&${__url_time_range}&var-pool=${__data.fields.ZFS_Pool}&var-dataset=${__data.fields.ZFS_Dataset}\r\n"
865+
}
866+
]
867+
},
868+
{
869+
"id": "custom.minWidth",
870+
"value": 120
871+
}
872+
]
830873
}
831874
]
832875
},
@@ -855,7 +898,7 @@
855898
}
856899
]
857900
},
858-
"pluginVersion": "11.1.3",
901+
"pluginVersion": "11.5.2",
859902
"targets": [
860903
{
861904
"datasource": {
@@ -880,7 +923,9 @@
880923
"Time": true,
881924
"Value": false,
882925
"__name__": true,
883-
"job": true
926+
"job": true,
927+
"metric_type": true,
928+
"type": true
884929
},
885930
"indexByName": {
886931
"Time": 11,
@@ -901,6 +946,7 @@
901946
"renameByName": {
902947
"Value": "Silence",
903948
"Value #A": "Silence",
949+
"__name__": "",
904950
"alertname": "Alert",
905951
"alertstate": "State",
906952
"category": "Category",
@@ -911,7 +957,11 @@
911957
"ip": "IP",
912958
"job": "",
913959
"level": "Level",
914-
"severity": "Severity"
960+
"metric_type": "ZFS_Metric_Type",
961+
"name": "ZFS_Dataset",
962+
"pool": "ZFS_Pool",
963+
"severity": "Severity",
964+
"type": "ZFS_Type"
915965
}
916966
}
917967
}
@@ -2740,7 +2790,7 @@
27402790
}
27412791
],
27422792
"revision": 1,
2743-
"schemaVersion": 39,
2793+
"schemaVersion": 40,
27442794
"tags": [
27452795
"Pigsty",
27462796
"NODE",

0 commit comments

Comments
 (0)