Skip to content

Commit

Permalink
prometheus grafana
Browse files Browse the repository at this point in the history
  • Loading branch information
altendky committed Jul 17, 2021
1 parent d29b55c commit 79f98f4
Show file tree
Hide file tree
Showing 4 changed files with 359 additions and 2 deletions.
11 changes: 10 additions & 1 deletion boot_server
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,14 @@ done
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

for d in $(df | grep ' /farm/sites/' | sed -E 's;^/dev/([a-z]+).*;\1;'); do
echo 'bfq' | sudo tee /sys/block/$d/queue/scheduler
echo 'bfq' | tee /sys/block/$d/queue/scheduler
done

#mount -t tmpfs -o size=220G tmpfs /farm/porches/700
for node in 0 1; do
mount -t tmpfs -o size=110G,mpol=bind:${node},noatime,nodiratime tmpfs /farm/porches/70${node}
done

mkdir -p /var/lib/prometheus/node-exporter
sudo chown altendky.altendky /var/lib/prometheus/node-exporter
#prometheus-node-exporter --collector.textfile.directory="/tmp/metrics"
3 changes: 2 additions & 1 deletion create_mounts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ HERE=$(realpath "${BASH_SOURCE%/*}")
SITES="${HERE}/sites/"
BACK40="${HERE}/back40/"
YARDS="${HERE}/yards/"
PORCHES="${HERE}/porches/"
WAGONS="${HERE}/wagons/"

mkdir --parents "${SITES}/"{001..37} "${BACK40}/"{001..37} "${WAGONS}/"{800..806} "${YARDS}/"{900..908}
mkdir --parents "${SITES}/"{001..37} "${BACK40}/"{001..37} "${WAGONS}/"{800..806} "${YARDS}/"{900..908} "${PORCHES}/"{700..701}
3 changes: 3 additions & 0 deletions exporter
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

/home/altendky/.local/bin/plotman prometheus > /var/lib/prometheus/node-exporter/plotman.prom
344 changes: 344 additions & 0 deletions grafana_dash.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,344 @@
{
"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": 0,
"id": 2,
"links": [],
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"hiddenSeries": false,
"id": 8,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "sum by (plot_id) (plotman_plot_phase_major_minor)",
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Panel Title",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"decimals": 0,
"format": "short",
"label": "",
"logBase": 1,
"max": "4.2",
"min": "0",
"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,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 8
},
"hiddenSeries": false,
"id": 4,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "node_filesystem_size_bytes{mountpoint=\"/farm/yards/907\"} - node_filesystem_free_bytes{mountpoint=\"/farm/yards/907\"}\n",
"interval": "",
"legendFormat": "",
"refId": "A"
},
{
"expr": "node_filesystem_size_bytes{mountpoint=\"/farm/porches/700\"} - node_filesystem_free_bytes{mountpoint=\"/farm/porches/700\"}\n",
"interval": "",
"legendFormat": "",
"refId": "B"
},
{
"expr": "node_filesystem_size_bytes{mountpoint=\"/farm/porches/701\"} - node_filesystem_free_bytes{mountpoint=\"/farm/porches/701\"}",
"interval": "",
"legendFormat": "",
"refId": "C"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Panel Title",
"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": 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,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 16
},
"hiddenSeries": false,
"id": 2,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "avg by (instance,mode) (irate(node_cpu_seconds_total{mode!='idle'}[1m]))",
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Panel Title",
"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": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"schemaVersion": 25,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
]
},
"timezone": "",
"title": "New dashboard Copy",
"uid": "CQRSBlmnz",
"version": 11
}

0 comments on commit 79f98f4

Please sign in to comment.