Update dash. Add smartmon to readme.

main
mathan 2024-02-25 18:04:06 -08:00
parent 95ca4f0eef
commit 067be8ec83
3 changed files with 819 additions and 607 deletions

View File

@ -214,7 +214,7 @@
"uid": "PBFA97CFB590B2093" "uid": "PBFA97CFB590B2093"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "repos_seen{job=\"db\"}", "expr": "repos_fully_indexed{job=\"db\"}",
"instant": false, "instant": false,
"legendFormat": "__auto", "legendFormat": "__auto",
"range": true, "range": true,
@ -236,26 +236,85 @@
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
{ {
"color": "green", "color": "blue",
"value": null "value": null
},
{
"color": "red",
"value": 80
} }
] ]
}, },
"unit": "h", "unit": "s",
"unitScale": true "unitScale": true
}, },
"overrides": [] "overrides": []
}, },
"gridPos": { "gridPos": {
"h": 10, "h": 10,
"w": 7, "w": 3,
"x": 17, "x": 17,
"y": 0 "y": 0
}, },
"id": 27,
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showPercentChange": true,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "10.3.3",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"expr": "(6000000-repos_fully_indexed{job=\"db\"})/rate(repos_fully_indexed{job=\"db\"}[$rate_interval])",
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "Time to 6 milion users",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "purple",
"value": null
}
]
},
"unit": "s",
"unitScale": true
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 4,
"x": 20,
"y": 0
},
"id": 24, "id": 24,
"options": { "options": {
"colorMode": "background", "colorMode": "background",
@ -281,7 +340,7 @@
"uid": "PBFA97CFB590B2093" "uid": "PBFA97CFB590B2093"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "10000000/(rate(repos_fully_indexed{job=\"db\"}[$rate_interval])*60*60)", "expr": "(10000000-repos_fully_indexed{job=\"db\"})/rate(repos_fully_indexed{job=\"db\"}[$rate_interval])",
"instant": false, "instant": false,
"legendFormat": "__auto", "legendFormat": "__auto",
"range": true, "range": true,
@ -1062,6 +1121,6 @@
"timezone": "", "timezone": "",
"title": "Bsky Statistics", "title": "Bsky Statistics",
"uid": "aXw6dQhSas", "uid": "aXw6dQhSas",
"version": 3, "version": 6,
"weekStart": "" "weekStart": ""
} }

File diff suppressed because it is too large Load Diff

View File

@ -56,7 +56,7 @@ After=network-online.target
User=node_exporter User=node_exporter
Group=node_exporter Group=node_exporter
Type=simple Type=simple
ExecStart=/usr/local/bin/node_exporter ExecStart=/usr/local/bin/node_exporter --collector.textfile.directory=/var/lib/prometheus/node-exporter/
Restart=always Restart=always
RestartSec=3 RestartSec=3
@ -99,6 +99,38 @@ Check if your SSD is compatible (your device name may differ, mine is /dev/sda)
Enable SMART on your SSD Enable SMART on your SSD
`sudo smartctl -s on /dev/sda` `sudo smartctl -s on /dev/sda`
Check smartmon is configured correctly
`sudo nano /lib/systemd/system/prometheus-node-exporter-smartmon.service`
It should be like this:
```
[Unit]
Description=Collect SMART metrics for prometheus-node-exporter
[Service]
Type=oneshot
Environment=TMPDIR=/var/lib/prometheus/node-exporter
ExecStart=/bin/bash -c "/usr/share/prometheus-node-exporter-collectors/smartmon.sh | sponge /var/lib/prometheus/node-exporter/smartmon.prom"
```
Start the service
`systemctl start prometheus-node-exporter-smartmon.service`
Open node exporter
`sudo nano /etc/systemd/system/node_exporter.service`
Check it contains the `--collector.textfile.directory` parameter
```
ExecStart=/usr/local/bin/node_exporter --collector.textfile.directory=/var/lib/prometheus/node-exporter/
```
Start the smartmon service
`systemctl start prometheus-node-exporter-smartmon.service`
Check the file contains correct metrics
`nano /var/lib/prometheus/node-exporter/smartmon.prom`
Restart the node exporter
`sudo systemctl restart node_exporter` `sudo systemctl restart node_exporter`
`systemctl start prometheus-node-exporter-smartmon.service` Metrics should display on `http://localhost:9100/metrics`