Grafana----硬件资源监控大盘
一、 硬件资源监控大盘展示(主机名、CPU、内存、磁盘、服务应用类型)
二、 数据流程展示
三、 Telegraf
参考《Telegraf 自动部署脚本》
四、 Nightingale、Prometheus
五、 Grafana
query配置:
panels 代码如下:
"panels": [ { "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "center", "displayMode": "auto", "filterable": true }, "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "#EAB839", "value": 65 }, { "color": "red", "value": 85 } ] }, "unit": "percent" }, "overrides": [ { "matcher": { "id": "byName", "options": "CPU使用(%)" }, "properties": [ { "id": "custom.displayMode", "value": "lcd-gauge" } ] }, { "matcher": { "id": "byName", "options": "内存使用(%)" }, "properties": [ { "id": "custom.displayMode", "value": "lcd-gauge" } ] }, { "matcher": { "id": "byName", "options": "磁盘使用(%)" }, "properties": [ { "id": "custom.displayMode", "value": "lcd-gauge" } ] }, { "matcher": { "id": "byName", "options": "主机名" }, "properties": [ { "id": "color", "value": { "fixedColor": "dark-green", "mode": "continuous-BlPu" } }, { "id": "custom.displayMode", "value": "color-background" }, { "id": "custom.align", "value": "center" } ] } ] }, "gridPos": { "h": 22, "w": 24, "x": 0, "y": 0 }, "id": 7, "options": { "footer": { "fields": [], "reducer": [ "lastNotNull" ], "show": false }, "frameIndex": 0, "showHeader": true, "sortBy": [ { "desc": true, "displayName": "CPU使用(%)" } ] }, "pluginVersion": "8.4.5", "targets": [ { "datasource": { "type": "prometheus", "uid": "CHsKN4Unz" }, "exemplar": false, "expr": "disk_used_percent{application=~\"$application\"} - 0", "format": "table", "instant": true, "interval": "", "intervalFactor": 1, "legendFormat": "", "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "CHsKN4Unz" }, "exemplar": false, "expr": "mem_used_percent{application=~\"$application\"} - 0", "format": "table", "hide": false, "instant": true, "interval": "", "legendFormat": "", "refId": "B" }, { "datasource": { "type": "prometheus", "uid": "CHsKN4Unz" }, "exemplar": false, "expr": "100 - cpu_usage_idle{cpu=\"cpu-total\",application=~\"$application\"}", "format": "table", "hide": false, "instant": true, "interval": "", "legendFormat": "", "refId": "C" } ], "title": "磁盘使用概览", "transformations": [ { "id": "merge", "options": {} }, { "id": "organize", "options": { "excludeByName": { "Time": true, "Value #C": false, "application": true, "cpu": true, "device": true, "fstype": true, "mode": true, "path": true }, "indexByName": { "Time": 0, "Value #A": 9, "Value #B": 8, "Value #C": 7, "application": 1, "cpu": 10, "device": 2, "fstype": 3, "ident": 4, "mode": 5, "path": 6 }, "renameByName": { "Value #A": "磁盘使用(%)", "Value #B": "内存使用(%)", "Value #C": "CPU使用(%)", "ident": "主机名" } } } ], "type": "table" } ],
本文来自博客园,作者:ヾ(o◕∀◕)ノヾ,转载请注明原文链接:https://www.cnblogs.com/Jupiter-blog/p/16265823.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具