├── .gitignore ├── targets.json ├── .editorconfig ├── prometheus.yml ├── LICENSE ├── docker-compose.yml ├── README.md └── grafana ├── ups.json ├── smartmon.json ├── mdadm.json └── basic.json /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *~ 3 | /build 4 | /target 5 | /vendor 6 | /config.json 7 | Thumbs.db 8 | .DS* 9 | /.idea 10 | -------------------------------------------------------------------------------- /targets.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "targets": ["raspberry:9100"], 4 | "labels": { 5 | "job": "raspberry", 6 | "env": "prod" 7 | } 8 | }, 9 | { 10 | "targets": ["raspberry:9101"], 11 | "labels": { 12 | "job": "haproxy", 13 | "env": "prod" 14 | } 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [Dockerfile] 12 | indent_style = tab 13 | indent_size = 4 14 | 15 | [Makefile] 16 | indent_style = tab 17 | indent_size = 4 18 | 19 | [.travis.yml,*.yml] 20 | indent_style = space 21 | indent_size = 2 22 | 23 | [*.json] 24 | indent_style = space 25 | indent_size = 2 26 | -------------------------------------------------------------------------------- /prometheus.yml: -------------------------------------------------------------------------------- 1 | ### 2 | # File: prometheus.yml 3 | # Author: Ming Cheng 4 | # 5 | # Created Date: Friday, June 28th 2019, 7:16:07 am 6 | # Last Modified: Monday, July 1st 2019, 5:35:22 pm 7 | # 8 | # http://www.opensource.org/licenses/MIT 9 | ### 10 | 11 | global: 12 | scrape_interval: 60s 13 | evaluation_interval: 60s 14 | 15 | scrape_configs: 16 | - job_name: prometheus 17 | static_configs: 18 | - targets: ["localhost:9090"] 19 | labels: 20 | instance: prometheus 21 | 22 | - job_name: phicomm 23 | static_configs: 24 | - targets: ["localhost:9100"] 25 | labels: 26 | instance: phicomm 27 | 28 | - job_name: "dummy" # This is a default value, it is mandatory. 29 | scheme: "http" 30 | scrape_timeout: 5s 31 | scrape_interval: 60s 32 | file_sd_configs: 33 | - files: 34 | - /prometheus-targets.json 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Óscar de Arriba 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | ### 2 | # File: docker-compose.yml 3 | # Author: Ming Cheng 4 | # 5 | # Created Date: Friday, June 28th 2019, 7:14:17 am 6 | # Last Modified: Monday, July 1st 2019, 5:46:20 pm 7 | # 8 | # http://www.opensource.org/licenses/MIT 9 | ### 10 | 11 | version: "2" 12 | 13 | volumes: 14 | prometheus-storage: 15 | grafana-storage: 16 | grafana-provisioning: 17 | 18 | services: 19 | prometheus: 20 | image: prom/prometheus-linux-arm64:v2.10.0 21 | container_name: prometheus 22 | hostname: prometheus 23 | user: "root" 24 | restart: unless-stopped 25 | volumes: 26 | - /etc/hosts:/etc/hosts:ro 27 | - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro 28 | - ./targets.json:/prometheus-targets.json:ro 29 | - prometheus-storage:/prometheus 30 | command: 31 | - "--config.file=/etc/prometheus/prometheus.yml" 32 | - "--web.console.libraries=/etc/prometheus/console_libraries" 33 | - "--web.console.templates=/etc/prometheus/consoles" 34 | - "--storage.tsdb.path=/prometheus" 35 | - "--storage.tsdb.retention.time=2y" 36 | - "--storage.tsdb.retention.size=48GB" 37 | - "--web.enable-lifecycle" 38 | ports: 39 | - 9090:9090 40 | 41 | grafana: 42 | image: grafana/grafana:6.2.5 43 | container_name: grafana 44 | hostname: grafana 45 | user: "root" 46 | restart: unless-stopped 47 | links: 48 | - prometheus 49 | volumes: 50 | - /etc/hosts:/etc/hosts:ro 51 | - grafana-storage:/var/lib/grafana 52 | - grafana-provisioning:/etc/grafana/provisioning 53 | ports: 54 | - 3000:3000 55 | depends_on: 56 | - prometheus 57 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 在 Phicomm(斐讯)N1 上部署 Prometheus 和 Grafana 2 | 3 | 目前市场上出现了批矿难留下来的名为斐讯 N1 的机顶盒,有着不错的性能。对比树莓派 3B+,N1 有着更好的性价比以及外观。相对来说,N1 对比 树莓派3B+ 是更优的选择。 4 | 5 | ![N1](https://friable.rocks/_/2019_07_01/1561965398151224.jpg) 6 | 7 | 由于原先的 Prometheus 和 Grfana 是在台虚拟机里,从监控的角度叫上说单独的硬件更加合适些,所刚好入了台 N1 用来当作单独的监控系统。 8 | 9 | ## 硬件 10 | 11 | 购买的渠道先不说了,普遍价格依据成色从几十到一百出头不等。建议购买相对成色比较新带包装和三码的产品,由于底价低所以差价其实并不是很大。 12 | 13 | 下面硬件方面,斐讯的 N1 和 树莓派3B+ 做个对比: 14 | 15 | | / | 斐讯 N1 | 树莓派 3B+ | 16 | | ------ | ------ | ------ | 17 | | CPU 和平台 | Amlogic ARM64 | BCM2835 ARMv7 | 18 | | 内存 | 2G | 1G | 19 | | 存储 | 自带 8g EMMC | 另外安装 SD 卡 | 20 | | 外观 | 自带外壳 | 裸板,需要外壳自行购买 | 21 | | 价格 | 100+ | 裸板200+,外壳和存储另算 | 22 | 23 | 具体性能方面的,[可以参考这篇文档](https://zocodev.com/phicomm-n1-box.html)这里不放具体的指标和数字了。 24 | 25 | ## 系统调整 26 | 27 | 目前二手市场上很多卖家都提供了刷机服务,我这边为了节省时间直接让卖家给刷了Armbian 系统。 28 | 29 | 到手以后 SSH 上去发现存储这块有些不对,还需要调整。因为原先还有部分 Android 的文件在其他的分区,可以直接执行 `blkid` 查看可以的块设备。 30 | 31 | 大概有那么几个块设备可以使用: 32 | 33 | ``` 34 | /dev/cache 35 | /dev/tee 36 | /dev/system 37 | /dev/data 38 | ``` 39 | 40 | `/dev/data` 是目前的根分区,我们不用动它,而 `/dev/tee` 这个分区太小没有使用的价值,所以个人将 `/dev/system` 格式化为 ext4 mount 到了 /home 以及将 /dev/cache 作为 swap 分区备用(才 512MB 有点鸡肋)。 41 | 42 | ``` 43 | Filesystem Size Used Avail Use% Mounted on 44 | udev 789M 0 789M 0% /dev 45 | tmpfs 180M 17M 164M 10% /run 46 | /dev/data 4.4G 2.4G 2.0G 56% / 47 | tmpfs 900M 0 900M 0% /dev/shm 48 | tmpfs 5.0M 4.0K 5.0M 1% /run/lock 49 | tmpfs 900M 0 900M 0% /sys/fs/cgroup 50 | tmpfs 900M 0 900M 0% /tmp 51 | /dev/system 1.2G 294M 855M 26% /home 52 | log2ram 50M 13M 38M 25% /var/log 53 | tmpfs 180M 0 180M 0% /run/user/1000 54 | ``` 55 | 56 | 以及 free(已经运行了部分服务的情况): 57 | 58 | ``` 59 | total used free shared buff/cache available 60 | Mem: 1.8G 205M 837M 28M 756M 1.5G 61 | Swap: 511M 0B 511M 62 | ``` 63 | 64 | 所以,总体分区调整配置完了以后,大概是这样子总计占用的空间大概 7G 不到一点,但其实足够日常使用了(其实是不想在系统瘦身这块花更多的时间)。 65 | 66 | 调整完分区,然后关闭不必要的服务和启动项。关闭和删除红外线服务: 67 | 68 | ``` 69 | systemctl disable lircd.service lircd-setup.service lircd.socket lircd-uinput.service lircmd.service 70 | apt remove -y lirc 71 | ``` 72 | 73 | 关闭 NFS 服务,在集群里已经有 NFS 服务器了,所以不需要: 74 | 75 | ``` 76 | systemctl disable nfs-server 77 | ``` 78 | 79 | 禁止图形界面启动的 Hook,这个其实没必要操作,但为了避免自启动有些图形应用: 80 | 81 | ``` 82 | systemctl disable graphical.target 83 | ``` 84 | 85 | 后面添加清华的镜像源,安装 `Docker CE` 等操作就不复述了。这样子,重启以后系统层面的配置就完成了。 86 | 87 | ## 配置 88 | 89 | 下面主要说下这个机子安装 Prometheus 和 Grafana 遇到的些坑。首先,就是平台的问题,由于是 ARM64 的设备,所以直接用 Docker 镜像(默认 x86/amd64)是行不通的,需要使用针对平台的 Docker 镜像。 90 | 91 | 具体请参见 `docker-compose.yml` 文件的配置,注意镜像的名称。因为机子的原生可用容量较少,所以针对 Prometheus 最好追加个容量方面的限定参数,例如我这边配置了: 92 | 93 | ```yaml 94 | - '--storage.tsdb.retention.time=6month' 95 | - '--storage.tsdb.retention.size=2GB' 96 | ``` 97 | 98 | 六个月或者总容量到达 2GB 的时候自动清除老的数据,默认 Prometheus 清除时间为 15d。 99 | 100 | 注意,`Alert Manager` 和 `Node Exporter` 以及 `Push GateWay` 都没有加入 Docker 的部署。 101 | 102 | 原因是,一来官方没有针对 ARM64 平台的镜像,二来这些服务相对比较简单、同时数据也不用纳入 Docker Volume 管理,因此就直接下载安装包运行。 103 | 104 | ## 后续 105 | 106 | 执行完 docker-compose 以后,就有了基础的 Prometheus 以及 Grafana 环境了,分别暴露的端口为 9090 以及 3000 。 107 | 108 | Grafana 相关的 Dashboard 配置在 `./grafana` 目录中,如果有需要直接 import 即可。下面是效果图: 109 | 110 | ![Grafana](https://friable.rocks/_/2019_07_01/1561965398165370.png) 111 | 112 | 如有任何问题和疑问,欢迎探讨 mingcheng[at]outlook.com 113 | 114 | `- eof -` 115 | -------------------------------------------------------------------------------- /grafana/ups.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "builtIn": 1, 6 | "datasource": "-- Grafana --", 7 | "enable": true, 8 | "hide": true, 9 | "iconColor": "rgba(0, 211, 255, 1)", 10 | "name": "Annotations & Alerts", 11 | "type": "dashboard" 12 | } 13 | ] 14 | }, 15 | "description": "Dashboard for single APC UPS", 16 | "editable": true, 17 | "gnetId": 4191, 18 | "graphTooltip": 0, 19 | "id": 4, 20 | "links": [], 21 | "panels": [ 22 | { 23 | "aliasColors": {}, 24 | "bars": false, 25 | "dashLength": 10, 26 | "dashes": false, 27 | "datasource": "Prometheus", 28 | "fill": 1, 29 | "gridPos": { 30 | "h": 7, 31 | "w": 18, 32 | "x": 0, 33 | "y": 0 34 | }, 35 | "id": 1, 36 | "legend": { 37 | "avg": false, 38 | "current": false, 39 | "max": false, 40 | "min": false, 41 | "show": true, 42 | "total": false, 43 | "values": false 44 | }, 45 | "lines": true, 46 | "linewidth": 1, 47 | "links": [], 48 | "nullPointMode": "null", 49 | "options": {}, 50 | "percentage": false, 51 | "pointradius": 5, 52 | "points": false, 53 | "renderer": "flot", 54 | "seriesOverrides": [], 55 | "spaceLength": 10, 56 | "stack": false, 57 | "steppedLine": false, 58 | "targets": [ 59 | { 60 | "expr": "apcupsd_battery_charge_percent", 61 | "format": "time_series", 62 | "intervalFactor": 2, 63 | "legendFormat": "Battery", 64 | "refId": "A" 65 | } 66 | ], 67 | "thresholds": [], 68 | "timeFrom": null, 69 | "timeRegions": [], 70 | "timeShift": null, 71 | "title": "Charge Percent", 72 | "tooltip": { 73 | "shared": true, 74 | "sort": 0, 75 | "value_type": "individual" 76 | }, 77 | "type": "graph", 78 | "xaxis": { 79 | "buckets": null, 80 | "mode": "time", 81 | "name": null, 82 | "show": true, 83 | "values": [] 84 | }, 85 | "yaxes": [ 86 | { 87 | "decimals": null, 88 | "format": "percent", 89 | "label": null, 90 | "logBase": 1, 91 | "max": "100", 92 | "min": null, 93 | "show": true 94 | }, 95 | { 96 | "format": "short", 97 | "label": null, 98 | "logBase": 1, 99 | "max": null, 100 | "min": null, 101 | "show": true 102 | } 103 | ], 104 | "yaxis": { 105 | "align": false, 106 | "alignLevel": null 107 | } 108 | }, 109 | { 110 | "cacheTimeout": null, 111 | "colorBackground": false, 112 | "colorValue": true, 113 | "colors": ["#d44a3a", "rgba(237, 129, 40, 0.89)", "#299c46"], 114 | "datasource": "Prometheus", 115 | "format": "m", 116 | "gauge": { 117 | "maxValue": 100, 118 | "minValue": 0, 119 | "show": false, 120 | "thresholdLabels": false, 121 | "thresholdMarkers": true 122 | }, 123 | "gridPos": { 124 | "h": 7, 125 | "w": 6, 126 | "x": 18, 127 | "y": 0 128 | }, 129 | "id": 2, 130 | "interval": null, 131 | "links": [], 132 | "mappingType": 1, 133 | "mappingTypes": [ 134 | { 135 | "name": "value to text", 136 | "value": 1 137 | }, 138 | { 139 | "name": "range to text", 140 | "value": 2 141 | } 142 | ], 143 | "maxDataPoints": 100, 144 | "nullPointMode": "connected", 145 | "nullText": null, 146 | "options": {}, 147 | "postfix": "", 148 | "postfixFontSize": "50%", 149 | "prefix": "", 150 | "prefixFontSize": "50%", 151 | "rangeMaps": [ 152 | { 153 | "from": "null", 154 | "text": "N/A", 155 | "to": "null" 156 | } 157 | ], 158 | "sparkline": { 159 | "fillColor": "rgba(31, 118, 189, 0.18)", 160 | "full": false, 161 | "lineColor": "rgb(31, 120, 193)", 162 | "show": false 163 | }, 164 | "tableColumn": "", 165 | "targets": [ 166 | { 167 | "expr": "apcupsd_battery_time_left_seconds / 60", 168 | "format": "time_series", 169 | "intervalFactor": 2, 170 | "legendFormat": "", 171 | "refId": "A" 172 | } 173 | ], 174 | "thresholds": "5,10,60", 175 | "title": "Time on Battery", 176 | "type": "singlestat", 177 | "valueFontSize": "150%", 178 | "valueMaps": [ 179 | { 180 | "op": "=", 181 | "text": "N/A", 182 | "value": "null" 183 | } 184 | ], 185 | "valueName": "current" 186 | }, 187 | { 188 | "aliasColors": {}, 189 | "bars": false, 190 | "dashLength": 10, 191 | "dashes": false, 192 | "datasource": "Prometheus", 193 | "fill": 1, 194 | "gridPos": { 195 | "h": 8, 196 | "w": 24, 197 | "x": 0, 198 | "y": 7 199 | }, 200 | "id": 3, 201 | "legend": { 202 | "avg": false, 203 | "current": false, 204 | "max": false, 205 | "min": false, 206 | "show": true, 207 | "total": false, 208 | "values": false 209 | }, 210 | "lines": true, 211 | "linewidth": 1, 212 | "links": [], 213 | "nullPointMode": "null", 214 | "options": {}, 215 | "percentage": false, 216 | "pointradius": 5, 217 | "points": false, 218 | "renderer": "flot", 219 | "seriesOverrides": [], 220 | "spaceLength": 10, 221 | "stack": false, 222 | "steppedLine": false, 223 | "targets": [ 224 | { 225 | "expr": "apcupsd_line_nominal_volts", 226 | "format": "time_series", 227 | "intervalFactor": 2, 228 | "legendFormat": "Nominal", 229 | "refId": "A" 230 | }, 231 | { 232 | "expr": "apcupsd_line_volts", 233 | "format": "time_series", 234 | "intervalFactor": 2, 235 | "legendFormat": "Actual", 236 | "refId": "B" 237 | } 238 | ], 239 | "thresholds": [], 240 | "timeFrom": null, 241 | "timeRegions": [], 242 | "timeShift": null, 243 | "title": "Line Voltage", 244 | "tooltip": { 245 | "shared": true, 246 | "sort": 0, 247 | "value_type": "individual" 248 | }, 249 | "type": "graph", 250 | "xaxis": { 251 | "buckets": null, 252 | "mode": "time", 253 | "name": null, 254 | "show": true, 255 | "values": [] 256 | }, 257 | "yaxes": [ 258 | { 259 | "format": "volt", 260 | "label": null, 261 | "logBase": 1, 262 | "max": null, 263 | "min": null, 264 | "show": true 265 | }, 266 | { 267 | "format": "short", 268 | "label": null, 269 | "logBase": 1, 270 | "max": null, 271 | "min": null, 272 | "show": true 273 | } 274 | ], 275 | "yaxis": { 276 | "align": false, 277 | "alignLevel": null 278 | } 279 | }, 280 | { 281 | "aliasColors": {}, 282 | "bars": false, 283 | "dashLength": 10, 284 | "dashes": false, 285 | "datasource": "Prometheus", 286 | "fill": 1, 287 | "gridPos": { 288 | "h": 8, 289 | "w": 24, 290 | "x": 0, 291 | "y": 15 292 | }, 293 | "id": 4, 294 | "legend": { 295 | "avg": false, 296 | "current": false, 297 | "max": false, 298 | "min": false, 299 | "show": true, 300 | "total": false, 301 | "values": false 302 | }, 303 | "lines": true, 304 | "linewidth": 1, 305 | "links": [], 306 | "nullPointMode": "null", 307 | "options": {}, 308 | "percentage": false, 309 | "pointradius": 5, 310 | "points": false, 311 | "renderer": "flot", 312 | "seriesOverrides": [], 313 | "spaceLength": 10, 314 | "stack": false, 315 | "steppedLine": false, 316 | "targets": [ 317 | { 318 | "expr": "apcupsd_ups_load_percent", 319 | "format": "time_series", 320 | "instant": false, 321 | "intervalFactor": 2, 322 | "legendFormat": "Percent", 323 | "refId": "A" 324 | } 325 | ], 326 | "thresholds": [], 327 | "timeFrom": null, 328 | "timeRegions": [], 329 | "timeShift": null, 330 | "title": "Load Percent", 331 | "tooltip": { 332 | "shared": true, 333 | "sort": 0, 334 | "value_type": "individual" 335 | }, 336 | "type": "graph", 337 | "xaxis": { 338 | "buckets": null, 339 | "mode": "time", 340 | "name": null, 341 | "show": true, 342 | "values": [] 343 | }, 344 | "yaxes": [ 345 | { 346 | "format": "percent", 347 | "label": null, 348 | "logBase": 1, 349 | "max": null, 350 | "min": null, 351 | "show": true 352 | }, 353 | { 354 | "format": "short", 355 | "label": null, 356 | "logBase": 1, 357 | "max": null, 358 | "min": null, 359 | "show": true 360 | } 361 | ], 362 | "yaxis": { 363 | "align": false, 364 | "alignLevel": null 365 | } 366 | } 367 | ], 368 | "refresh": "5m", 369 | "schemaVersion": 18, 370 | "style": "dark", 371 | "tags": [], 372 | "templating": { 373 | "list": [] 374 | }, 375 | "time": { 376 | "from": "now-24h", 377 | "to": "now" 378 | }, 379 | "timepicker": { 380 | "refresh_intervals": [ 381 | "5s", 382 | "10s", 383 | "30s", 384 | "1m", 385 | "5m", 386 | "15m", 387 | "30m", 388 | "1h", 389 | "2h", 390 | "1d" 391 | ], 392 | "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] 393 | }, 394 | "timezone": "", 395 | "title": "UPS Status of ACP BK-650", 396 | "uid": "ezcX9Eigz", 397 | "version": 5 398 | } 399 | -------------------------------------------------------------------------------- /grafana/smartmon.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "builtIn": 1, 6 | "datasource": "-- Grafana --", 7 | "enable": true, 8 | "hide": true, 9 | "iconColor": "rgba(0, 211, 255, 1)", 10 | "name": "Annotations & Alerts", 11 | "type": "dashboard" 12 | } 13 | ] 14 | }, 15 | "description": "Smartmon Texfile node_exporter Dashboard", 16 | "editable": true, 17 | "gnetId": 3992, 18 | "graphTooltip": 0, 19 | "id": 7, 20 | "iteration": 1561974419252, 21 | "links": [], 22 | "panels": [ 23 | { 24 | "columns": [], 25 | "fontSize": "100%", 26 | "gridPos": { 27 | "h": 5, 28 | "w": 24, 29 | "x": 0, 30 | "y": 0 31 | }, 32 | "id": 9, 33 | "links": [], 34 | "options": {}, 35 | "pageSize": null, 36 | "scroll": true, 37 | "showHeader": true, 38 | "sort": { 39 | "col": 0, 40 | "desc": true 41 | }, 42 | "styles": [ 43 | { 44 | "alias": "", 45 | "colorMode": null, 46 | "colors": [ 47 | "rgba(245, 54, 54, 0.9)", 48 | "rgba(237, 129, 40, 0.89)", 49 | "rgba(50, 172, 45, 0.97)" 50 | ], 51 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 52 | "decimals": 2, 53 | "mappingType": 1, 54 | "pattern": "Time", 55 | "thresholds": [], 56 | "type": "hidden", 57 | "unit": "short" 58 | }, 59 | { 60 | "alias": "", 61 | "colorMode": null, 62 | "colors": [ 63 | "rgba(245, 54, 54, 0.9)", 64 | "rgba(237, 129, 40, 0.89)", 65 | "rgba(50, 172, 45, 0.97)" 66 | ], 67 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 68 | "decimals": 2, 69 | "mappingType": 1, 70 | "pattern": "Value", 71 | "thresholds": [], 72 | "type": "hidden", 73 | "unit": "short" 74 | }, 75 | { 76 | "alias": "", 77 | "colorMode": null, 78 | "colors": [ 79 | "rgba(245, 54, 54, 0.9)", 80 | "rgba(237, 129, 40, 0.89)", 81 | "rgba(50, 172, 45, 0.97)" 82 | ], 83 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 84 | "decimals": 2, 85 | "mappingType": 1, 86 | "pattern": "serial_number", 87 | "thresholds": [], 88 | "type": "hidden", 89 | "unit": "short" 90 | } 91 | ], 92 | "targets": [ 93 | { 94 | "expr": "count(smartmon_device_info{exported_instance=~\"$instance\"}) without (exported_instance, exported_job, instance, job)", 95 | "format": "table", 96 | "instant": true, 97 | "intervalFactor": 1, 98 | "refId": "A" 99 | } 100 | ], 101 | "timeFrom": null, 102 | "timeShift": null, 103 | "title": "Smartmon All Disks", 104 | "transform": "table", 105 | "type": "table" 106 | }, 107 | { 108 | "columns": [], 109 | "fontSize": "100%", 110 | "gridPos": { 111 | "h": 4, 112 | "w": 24, 113 | "x": 0, 114 | "y": 5 115 | }, 116 | "id": 10, 117 | "links": [], 118 | "options": {}, 119 | "pageSize": null, 120 | "scroll": true, 121 | "showHeader": true, 122 | "sort": { 123 | "col": 0, 124 | "desc": true 125 | }, 126 | "styles": [ 127 | { 128 | "alias": "", 129 | "colorMode": null, 130 | "colors": [ 131 | "rgba(245, 54, 54, 0.9)", 132 | "rgba(237, 129, 40, 0.89)", 133 | "rgba(50, 172, 45, 0.97)" 134 | ], 135 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 136 | "decimals": 2, 137 | "mappingType": 1, 138 | "pattern": "Time", 139 | "thresholds": [], 140 | "type": "hidden", 141 | "unit": "short" 142 | }, 143 | { 144 | "alias": "", 145 | "colorMode": null, 146 | "colors": [ 147 | "rgba(245, 54, 54, 0.9)", 148 | "rgba(237, 129, 40, 0.89)", 149 | "rgba(50, 172, 45, 0.97)" 150 | ], 151 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 152 | "decimals": 2, 153 | "mappingType": 1, 154 | "pattern": "exported_instance", 155 | "thresholds": [], 156 | "type": "hidden", 157 | "unit": "short" 158 | }, 159 | { 160 | "alias": "", 161 | "colorMode": null, 162 | "colors": [ 163 | "rgba(245, 54, 54, 0.9)", 164 | "rgba(237, 129, 40, 0.89)", 165 | "rgba(50, 172, 45, 0.97)" 166 | ], 167 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 168 | "decimals": 2, 169 | "mappingType": 1, 170 | "pattern": "exported_job", 171 | "thresholds": [], 172 | "type": "hidden", 173 | "unit": "short" 174 | }, 175 | { 176 | "alias": "", 177 | "colorMode": null, 178 | "colors": [ 179 | "rgba(245, 54, 54, 0.9)", 180 | "rgba(237, 129, 40, 0.89)", 181 | "rgba(50, 172, 45, 0.97)" 182 | ], 183 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 184 | "decimals": 2, 185 | "mappingType": 1, 186 | "pattern": "instance", 187 | "thresholds": [], 188 | "type": "hidden", 189 | "unit": "short" 190 | }, 191 | { 192 | "alias": "", 193 | "colorMode": null, 194 | "colors": [ 195 | "rgba(245, 54, 54, 0.9)", 196 | "rgba(237, 129, 40, 0.89)", 197 | "rgba(50, 172, 45, 0.97)" 198 | ], 199 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 200 | "decimals": 2, 201 | "mappingType": 1, 202 | "pattern": "job", 203 | "thresholds": [], 204 | "type": "hidden", 205 | "unit": "short" 206 | }, 207 | { 208 | "alias": "", 209 | "colorMode": null, 210 | "colors": [ 211 | "rgba(245, 54, 54, 0.9)", 212 | "rgba(237, 129, 40, 0.89)", 213 | "rgba(50, 172, 45, 0.97)" 214 | ], 215 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 216 | "decimals": 2, 217 | "mappingType": 1, 218 | "pattern": "Value", 219 | "thresholds": [], 220 | "type": "number", 221 | "unit": "h" 222 | }, 223 | { 224 | "alias": "", 225 | "colorMode": null, 226 | "colors": [ 227 | "rgba(245, 54, 54, 0.9)", 228 | "rgba(237, 129, 40, 0.89)", 229 | "rgba(50, 172, 45, 0.97)" 230 | ], 231 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 232 | "decimals": 2, 233 | "mappingType": 1, 234 | "pattern": "__name__", 235 | "thresholds": [], 236 | "type": "hidden", 237 | "unit": "short" 238 | } 239 | ], 240 | "targets": [ 241 | { 242 | "expr": "smartmon_power_on_hours_raw_value{exported_instance=~\"$instance\"}", 243 | "format": "table", 244 | "instant": true, 245 | "intervalFactor": 1, 246 | "refId": "A" 247 | } 248 | ], 249 | "timeFrom": null, 250 | "timeShift": null, 251 | "title": "Power On Hours", 252 | "transform": "table", 253 | "type": "table" 254 | }, 255 | { 256 | "aliasColors": {}, 257 | "bars": false, 258 | "dashLength": 10, 259 | "dashes": false, 260 | "datasource": "Prometheus", 261 | "fill": 5, 262 | "gridPos": { 263 | "h": 7, 264 | "w": 24, 265 | "x": 0, 266 | "y": 9 267 | }, 268 | "id": 1, 269 | "legend": { 270 | "alignAsTable": true, 271 | "avg": true, 272 | "current": true, 273 | "max": true, 274 | "min": true, 275 | "rightSide": true, 276 | "show": true, 277 | "sideWidth": null, 278 | "total": false, 279 | "values": true 280 | }, 281 | "lines": true, 282 | "linewidth": 5, 283 | "links": [], 284 | "nullPointMode": "null", 285 | "options": {}, 286 | "percentage": false, 287 | "pointradius": 1, 288 | "points": false, 289 | "renderer": "flot", 290 | "seriesOverrides": [], 291 | "spaceLength": 10, 292 | "stack": false, 293 | "steppedLine": false, 294 | "targets": [ 295 | { 296 | "expr": "avg(smartmon_temperature_celsius_value{exported_instance=~\"$instance\"}) by (exported_instance, disk)", 297 | "format": "time_series", 298 | "hide": true, 299 | "interval": "1m", 300 | "intervalFactor": 2, 301 | "legendFormat": " {{exported_instance}} {{disk}}", 302 | "refId": "B" 303 | }, 304 | { 305 | "expr": "avg(smartmon_temperature_celsius_raw_value{exported_instance=~\"$instance\"}) by (exported_instance, disk)", 306 | "format": "time_series", 307 | "hide": false, 308 | "interval": "1m", 309 | "intervalFactor": 2, 310 | "legendFormat": "{{exported_instance}} {{disk}}", 311 | "refId": "A" 312 | } 313 | ], 314 | "thresholds": [], 315 | "timeFrom": null, 316 | "timeRegions": [], 317 | "timeShift": null, 318 | "title": "Disk Temperature", 319 | "tooltip": { 320 | "shared": true, 321 | "sort": 0, 322 | "value_type": "individual" 323 | }, 324 | "type": "graph", 325 | "xaxis": { 326 | "buckets": null, 327 | "mode": "time", 328 | "name": null, 329 | "show": true, 330 | "values": [] 331 | }, 332 | "yaxes": [ 333 | { 334 | "format": "celsius", 335 | "label": null, 336 | "logBase": 1, 337 | "max": null, 338 | "min": null, 339 | "show": true 340 | }, 341 | { 342 | "format": "short", 343 | "label": null, 344 | "logBase": 1, 345 | "max": null, 346 | "min": null, 347 | "show": true 348 | } 349 | ], 350 | "yaxis": { 351 | "align": false, 352 | "alignLevel": null 353 | } 354 | }, 355 | { 356 | "aliasColors": {}, 357 | "bars": false, 358 | "dashLength": 10, 359 | "dashes": false, 360 | "datasource": "Prometheus", 361 | "fill": 1, 362 | "gridPos": { 363 | "h": 7, 364 | "w": 12, 365 | "x": 0, 366 | "y": 16 367 | }, 368 | "id": 2, 369 | "legend": { 370 | "alignAsTable": true, 371 | "avg": true, 372 | "current": true, 373 | "max": true, 374 | "min": true, 375 | "rightSide": true, 376 | "show": true, 377 | "total": false, 378 | "values": true 379 | }, 380 | "lines": true, 381 | "linewidth": 1, 382 | "links": [], 383 | "nullPointMode": "null", 384 | "options": {}, 385 | "percentage": false, 386 | "pointradius": 5, 387 | "points": false, 388 | "renderer": "flot", 389 | "seriesOverrides": [], 390 | "spaceLength": 10, 391 | "stack": false, 392 | "steppedLine": false, 393 | "targets": [ 394 | { 395 | "expr": "avg(smartmon_raw_read_error_rate_value{exported_instance=~\"$instance\"}) by (exported_instance, disk)", 396 | "format": "time_series", 397 | "intervalFactor": 2, 398 | "legendFormat": "val {{exported_instance}} {{disk}}", 399 | "refId": "A" 400 | }, 401 | { 402 | "expr": "avg(smartmon_spin_retry_count_raw_value{exported_instance=~\"$instance\"}) by (exported_instance, disk)", 403 | "format": "time_series", 404 | "interval": "", 405 | "intervalFactor": 2, 406 | "legendFormat": "raw {{exported_instance}} {{disk}}", 407 | "refId": "B" 408 | } 409 | ], 410 | "thresholds": [], 411 | "timeFrom": null, 412 | "timeRegions": [], 413 | "timeShift": null, 414 | "title": "Raw Error Read Rate", 415 | "tooltip": { 416 | "shared": true, 417 | "sort": 0, 418 | "value_type": "individual" 419 | }, 420 | "type": "graph", 421 | "xaxis": { 422 | "buckets": null, 423 | "mode": "time", 424 | "name": null, 425 | "show": true, 426 | "values": [] 427 | }, 428 | "yaxes": [ 429 | { 430 | "format": "short", 431 | "label": null, 432 | "logBase": 1, 433 | "max": null, 434 | "min": null, 435 | "show": true 436 | }, 437 | { 438 | "format": "short", 439 | "label": null, 440 | "logBase": 1, 441 | "max": null, 442 | "min": null, 443 | "show": true 444 | } 445 | ], 446 | "yaxis": { 447 | "align": false, 448 | "alignLevel": null 449 | } 450 | }, 451 | { 452 | "aliasColors": {}, 453 | "bars": false, 454 | "dashLength": 10, 455 | "dashes": false, 456 | "datasource": "Prometheus", 457 | "fill": 1, 458 | "gridPos": { 459 | "h": 7, 460 | "w": 12, 461 | "x": 12, 462 | "y": 16 463 | }, 464 | "id": 3, 465 | "legend": { 466 | "alignAsTable": true, 467 | "avg": true, 468 | "current": true, 469 | "max": true, 470 | "min": true, 471 | "rightSide": true, 472 | "show": true, 473 | "total": false, 474 | "values": true 475 | }, 476 | "lines": true, 477 | "linewidth": 1, 478 | "links": [], 479 | "nullPointMode": "null", 480 | "options": {}, 481 | "percentage": false, 482 | "pointradius": 5, 483 | "points": false, 484 | "renderer": "flot", 485 | "seriesOverrides": [], 486 | "spaceLength": 10, 487 | "stack": false, 488 | "steppedLine": false, 489 | "targets": [ 490 | { 491 | "expr": "avg(smartmon_total_lbas_written_value{exported_instance=~\"$instance\"}) by (exported_instance, disk)", 492 | "format": "time_series", 493 | "intervalFactor": 2, 494 | "legendFormat": "val {{exported_instance}} {{disk}}", 495 | "refId": "A" 496 | }, 497 | { 498 | "expr": "avg(smartmon_total_lbas_written_raw_value{exported_instance=~\"$instance\"}) by (exported_instance, disk)", 499 | "format": "time_series", 500 | "intervalFactor": 2, 501 | "legendFormat": "raw {{exported_instance}} {{disk}}", 502 | "refId": "B" 503 | } 504 | ], 505 | "thresholds": [], 506 | "timeFrom": null, 507 | "timeRegions": [], 508 | "timeShift": null, 509 | "title": "Raw Error Read Rate", 510 | "tooltip": { 511 | "shared": true, 512 | "sort": 0, 513 | "value_type": "individual" 514 | }, 515 | "type": "graph", 516 | "xaxis": { 517 | "buckets": null, 518 | "mode": "time", 519 | "name": null, 520 | "show": true, 521 | "values": [] 522 | }, 523 | "yaxes": [ 524 | { 525 | "format": "short", 526 | "label": null, 527 | "logBase": 1, 528 | "max": null, 529 | "min": null, 530 | "show": true 531 | }, 532 | { 533 | "format": "short", 534 | "label": null, 535 | "logBase": 1, 536 | "max": null, 537 | "min": null, 538 | "show": true 539 | } 540 | ], 541 | "yaxis": { 542 | "align": false, 543 | "alignLevel": null 544 | } 545 | }, 546 | { 547 | "aliasColors": {}, 548 | "bars": false, 549 | "dashLength": 10, 550 | "dashes": false, 551 | "datasource": "Prometheus", 552 | "fill": 1, 553 | "gridPos": { 554 | "h": 7, 555 | "w": 12, 556 | "x": 0, 557 | "y": 23 558 | }, 559 | "id": 5, 560 | "legend": { 561 | "alignAsTable": true, 562 | "avg": true, 563 | "current": true, 564 | "max": true, 565 | "min": true, 566 | "rightSide": true, 567 | "show": true, 568 | "total": false, 569 | "values": true 570 | }, 571 | "lines": true, 572 | "linewidth": 1, 573 | "links": [], 574 | "nullPointMode": "null", 575 | "options": {}, 576 | "percentage": false, 577 | "pointradius": 5, 578 | "points": false, 579 | "renderer": "flot", 580 | "seriesOverrides": [], 581 | "spaceLength": 10, 582 | "stack": false, 583 | "steppedLine": false, 584 | "targets": [ 585 | { 586 | "expr": "smartmon_reallocated_sector_ct_raw_value{exported_instance=~\"$instance\"}", 587 | "format": "time_series", 588 | "intervalFactor": 2, 589 | "legendFormat": "raw {{exported_instance}} {{disk}}", 590 | "refId": "B" 591 | }, 592 | { 593 | "expr": "smartmon_reallocated_sector_ct_value{exported_instance=~\"$instance\"}", 594 | "format": "time_series", 595 | "interval": "", 596 | "intervalFactor": 2, 597 | "legendFormat": "val {{exported_instance}} {{disk}}", 598 | "refId": "A" 599 | } 600 | ], 601 | "thresholds": [], 602 | "timeFrom": null, 603 | "timeRegions": [], 604 | "timeShift": null, 605 | "title": "Reallocated Sectors", 606 | "tooltip": { 607 | "shared": true, 608 | "sort": 0, 609 | "value_type": "individual" 610 | }, 611 | "type": "graph", 612 | "xaxis": { 613 | "buckets": null, 614 | "mode": "time", 615 | "name": null, 616 | "show": true, 617 | "values": [] 618 | }, 619 | "yaxes": [ 620 | { 621 | "format": "short", 622 | "label": null, 623 | "logBase": 1, 624 | "max": null, 625 | "min": "0", 626 | "show": true 627 | }, 628 | { 629 | "format": "short", 630 | "label": null, 631 | "logBase": 1, 632 | "max": null, 633 | "min": null, 634 | "show": true 635 | } 636 | ], 637 | "yaxis": { 638 | "align": false, 639 | "alignLevel": null 640 | } 641 | }, 642 | { 643 | "aliasColors": {}, 644 | "bars": false, 645 | "dashLength": 10, 646 | "dashes": false, 647 | "datasource": "Prometheus", 648 | "fill": 1, 649 | "gridPos": { 650 | "h": 7, 651 | "w": 12, 652 | "x": 12, 653 | "y": 23 654 | }, 655 | "id": 6, 656 | "legend": { 657 | "alignAsTable": true, 658 | "avg": true, 659 | "current": true, 660 | "max": true, 661 | "min": true, 662 | "rightSide": true, 663 | "show": true, 664 | "total": false, 665 | "values": true 666 | }, 667 | "lines": true, 668 | "linewidth": 1, 669 | "links": [], 670 | "nullPointMode": "null", 671 | "options": {}, 672 | "percentage": false, 673 | "pointradius": 5, 674 | "points": false, 675 | "renderer": "flot", 676 | "seriesOverrides": [], 677 | "spaceLength": 10, 678 | "stack": false, 679 | "steppedLine": false, 680 | "targets": [ 681 | { 682 | "expr": "smartmon_current_pending_sector_raw_value{exported_instance=~\"$instance\"}", 683 | "format": "time_series", 684 | "intervalFactor": 2, 685 | "legendFormat": "raw {{exported_instance}} {{disk}}", 686 | "refId": "B" 687 | }, 688 | { 689 | "expr": "smartmon_current_pending_sector_value{exported_instance=~\"$instance\"}", 690 | "format": "time_series", 691 | "interval": "", 692 | "intervalFactor": 2, 693 | "legendFormat": "val {{exported_instance}} {{disk}}", 694 | "refId": "A" 695 | } 696 | ], 697 | "thresholds": [], 698 | "timeFrom": null, 699 | "timeRegions": [], 700 | "timeShift": null, 701 | "title": "Current Pending Sectors", 702 | "tooltip": { 703 | "shared": true, 704 | "sort": 0, 705 | "value_type": "individual" 706 | }, 707 | "type": "graph", 708 | "xaxis": { 709 | "buckets": null, 710 | "mode": "time", 711 | "name": null, 712 | "show": true, 713 | "values": [] 714 | }, 715 | "yaxes": [ 716 | { 717 | "format": "short", 718 | "label": null, 719 | "logBase": 1, 720 | "max": null, 721 | "min": "0", 722 | "show": true 723 | }, 724 | { 725 | "format": "short", 726 | "label": null, 727 | "logBase": 1, 728 | "max": null, 729 | "min": null, 730 | "show": true 731 | } 732 | ], 733 | "yaxis": { 734 | "align": false, 735 | "alignLevel": null 736 | } 737 | } 738 | ], 739 | "schemaVersion": 18, 740 | "style": "dark", 741 | "tags": ["prometheus", "node_exporter", "smartmon"], 742 | "templating": { 743 | "list": [ 744 | { 745 | "allValue": null, 746 | "current": { 747 | "text": "sharkbay", 748 | "value": "sharkbay" 749 | }, 750 | "datasource": "Prometheus", 751 | "definition": "label_values(smartmon_smartctl_version, exported_instance)", 752 | "hide": 0, 753 | "includeAll": false, 754 | "label": null, 755 | "multi": false, 756 | "name": "instance", 757 | "options": [], 758 | "query": "label_values(smartmon_smartctl_version, exported_instance)", 759 | "refresh": 1, 760 | "regex": "", 761 | "skipUrlSync": false, 762 | "sort": 1, 763 | "tagValuesQuery": "", 764 | "tags": [], 765 | "tagsQuery": "", 766 | "type": "query", 767 | "useTags": false 768 | } 769 | ] 770 | }, 771 | "time": { 772 | "from": "now-24h", 773 | "to": "now" 774 | }, 775 | "timepicker": { 776 | "refresh_intervals": [ 777 | "5s", 778 | "10s", 779 | "30s", 780 | "1m", 781 | "5m", 782 | "15m", 783 | "30m", 784 | "1h", 785 | "2h", 786 | "1d" 787 | ], 788 | "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] 789 | }, 790 | "timezone": "browser", 791 | "title": "Smartmon Textfile", 792 | "uid": "ClkzWsiRz", 793 | "version": 5 794 | } 795 | -------------------------------------------------------------------------------- /grafana/mdadm.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "builtIn": 1, 6 | "datasource": "-- Grafana --", 7 | "enable": true, 8 | "hide": true, 9 | "iconColor": "rgba(0, 211, 255, 1)", 10 | "name": "Annotations & Alerts", 11 | "type": "dashboard" 12 | } 13 | ] 14 | }, 15 | "description": "Prometheus node_exporter mdadm module dashboard. Per Server and per md view", 16 | "editable": true, 17 | "gnetId": 4394, 18 | "graphTooltip": 0, 19 | "id": 3, 20 | "iteration": 1561974443839, 21 | "links": [], 22 | "panels": [ 23 | { 24 | "collapsed": false, 25 | "gridPos": { 26 | "h": 1, 27 | "w": 24, 28 | "x": 0, 29 | "y": 0 30 | }, 31 | "id": 51, 32 | "panels": [], 33 | "repeat": null, 34 | "title": "Dashboard Row", 35 | "type": "row" 36 | }, 37 | { 38 | "cacheTimeout": null, 39 | "colorBackground": true, 40 | "colorValue": false, 41 | "colors": [ 42 | "rgba(245, 54, 54, 0.9)", 43 | "rgba(237, 129, 40, 0.89)", 44 | "rgba(50, 172, 45, 0.97)" 45 | ], 46 | "datasource": "Prometheus", 47 | "format": "none", 48 | "gauge": { 49 | "maxValue": 100, 50 | "minValue": 0, 51 | "show": false, 52 | "thresholdLabels": false, 53 | "thresholdMarkers": true 54 | }, 55 | "gridPos": { 56 | "h": 3, 57 | "w": 4, 58 | "x": 0, 59 | "y": 1 60 | }, 61 | "id": 5, 62 | "interval": null, 63 | "links": [], 64 | "mappingType": 2, 65 | "mappingTypes": [ 66 | { 67 | "name": "value to text", 68 | "value": 1 69 | }, 70 | { 71 | "name": "range to text", 72 | "value": 2 73 | } 74 | ], 75 | "maxDataPoints": 100, 76 | "nullPointMode": "connected", 77 | "nullText": null, 78 | "options": {}, 79 | "postfix": "", 80 | "postfixFontSize": "50%", 81 | "prefix": "", 82 | "prefixFontSize": "50%", 83 | "rangeMaps": [ 84 | { 85 | "from": "1", 86 | "text": "OK", 87 | "to": "1" 88 | }, 89 | { 90 | "from": "0", 91 | "text": "DEGRADED", 92 | "to": "1" 93 | } 94 | ], 95 | "sparkline": { 96 | "fillColor": "rgba(31, 118, 189, 0.18)", 97 | "full": false, 98 | "lineColor": "rgb(31, 120, 193)", 99 | "show": false 100 | }, 101 | "tableColumn": "", 102 | "targets": [ 103 | { 104 | "expr": "sum(node_md_is_active{instance=~\"$instance\"}) / count(node_md_is_active{instance=~\"$instance\"})", 105 | "format": "time_series", 106 | "instant": true, 107 | "intervalFactor": 1, 108 | "refId": "A", 109 | "step": 600 110 | } 111 | ], 112 | "thresholds": "1,1", 113 | "title": "All mds are active", 114 | "type": "singlestat", 115 | "valueFontSize": "80%", 116 | "valueMaps": [], 117 | "valueName": "current" 118 | }, 119 | { 120 | "cacheTimeout": null, 121 | "colorBackground": true, 122 | "colorValue": false, 123 | "colors": [ 124 | "rgba(245, 54, 54, 0.9)", 125 | "rgba(237, 129, 40, 0.89)", 126 | "rgba(50, 172, 45, 0.97)" 127 | ], 128 | "datasource": "Prometheus", 129 | "format": "none", 130 | "gauge": { 131 | "maxValue": 100, 132 | "minValue": 0, 133 | "show": false, 134 | "thresholdLabels": false, 135 | "thresholdMarkers": true 136 | }, 137 | "gridPos": { 138 | "h": 3, 139 | "w": 4, 140 | "x": 4, 141 | "y": 1 142 | }, 143 | "id": 49, 144 | "interval": null, 145 | "links": [], 146 | "mappingType": 2, 147 | "mappingTypes": [ 148 | { 149 | "name": "value to text", 150 | "value": 1 151 | }, 152 | { 153 | "name": "range to text", 154 | "value": 2 155 | } 156 | ], 157 | "maxDataPoints": 100, 158 | "nullPointMode": "connected", 159 | "nullText": null, 160 | "options": {}, 161 | "postfix": "", 162 | "postfixFontSize": "50%", 163 | "prefix": "", 164 | "prefixFontSize": "50%", 165 | "rangeMaps": [ 166 | { 167 | "from": "1", 168 | "text": "OK", 169 | "to": "1" 170 | }, 171 | { 172 | "from": "0", 173 | "text": "DEGRADED", 174 | "to": "1" 175 | } 176 | ], 177 | "sparkline": { 178 | "fillColor": "rgba(31, 118, 189, 0.18)", 179 | "full": false, 180 | "lineColor": "rgb(31, 120, 193)", 181 | "show": false 182 | }, 183 | "tableColumn": "", 184 | "targets": [ 185 | { 186 | "expr": "sum(node_md_disks_active{instance=~\"$instance\"}) / sum(node_md_disks{instance=~\"$instance\"})", 187 | "format": "time_series", 188 | "instant": true, 189 | "intervalFactor": 1, 190 | "refId": "A", 191 | "step": 600 192 | } 193 | ], 194 | "thresholds": "1,1", 195 | "title": "All md disks are active", 196 | "type": "singlestat", 197 | "valueFontSize": "80%", 198 | "valueMaps": [ 199 | { 200 | "op": "=", 201 | "text": "OK", 202 | "value": "1" 203 | }, 204 | { 205 | "op": "=", 206 | "text": "DEGRADED", 207 | "value": "0" 208 | } 209 | ], 210 | "valueName": "current" 211 | }, 212 | { 213 | "cacheTimeout": null, 214 | "colorBackground": false, 215 | "colorValue": false, 216 | "colors": [ 217 | "rgba(245, 54, 54, 0.9)", 218 | "rgba(237, 129, 40, 0.89)", 219 | "rgba(50, 172, 45, 0.97)" 220 | ], 221 | "datasource": "Prometheus", 222 | "format": "none", 223 | "gauge": { 224 | "maxValue": 100, 225 | "minValue": 0, 226 | "show": false, 227 | "thresholdLabels": false, 228 | "thresholdMarkers": true 229 | }, 230 | "gridPos": { 231 | "h": 3, 232 | "w": 4, 233 | "x": 8, 234 | "y": 1 235 | }, 236 | "height": "100px", 237 | "id": 2, 238 | "interval": null, 239 | "links": [], 240 | "mappingType": 1, 241 | "mappingTypes": [ 242 | { 243 | "name": "value to text", 244 | "value": 1 245 | }, 246 | { 247 | "name": "range to text", 248 | "value": 2 249 | } 250 | ], 251 | "maxDataPoints": 100, 252 | "nullPointMode": "connected", 253 | "nullText": null, 254 | "options": {}, 255 | "postfix": "", 256 | "postfixFontSize": "50%", 257 | "prefix": "", 258 | "prefixFontSize": "50%", 259 | "rangeMaps": [ 260 | { 261 | "from": "null", 262 | "text": "N/A", 263 | "to": "null" 264 | } 265 | ], 266 | "sparkline": { 267 | "fillColor": "rgba(31, 118, 189, 0.18)", 268 | "full": true, 269 | "lineColor": "rgb(31, 120, 193)", 270 | "show": true 271 | }, 272 | "tableColumn": "", 273 | "targets": [ 274 | { 275 | "expr": "sum(node_md_disks_active{instance=~\"$instance\"})", 276 | "format": "time_series", 277 | "instant": true, 278 | "intervalFactor": 1, 279 | "legendFormat": "", 280 | "metric": "node_md_disks_active", 281 | "refId": "A", 282 | "step": 600 283 | } 284 | ], 285 | "thresholds": "", 286 | "title": "Total Active Disks", 287 | "type": "singlestat", 288 | "valueFontSize": "80%", 289 | "valueMaps": [], 290 | "valueName": "current" 291 | }, 292 | { 293 | "cacheTimeout": null, 294 | "colorBackground": false, 295 | "colorValue": false, 296 | "colors": [ 297 | "rgba(245, 54, 54, 0.9)", 298 | "rgba(237, 129, 40, 0.89)", 299 | "rgba(50, 172, 45, 0.97)" 300 | ], 301 | "datasource": "Prometheus", 302 | "format": "none", 303 | "gauge": { 304 | "maxValue": 100, 305 | "minValue": 0, 306 | "show": false, 307 | "thresholdLabels": false, 308 | "thresholdMarkers": true 309 | }, 310 | "gridPos": { 311 | "h": 3, 312 | "w": 4, 313 | "x": 12, 314 | "y": 1 315 | }, 316 | "height": "100px", 317 | "id": 1, 318 | "interval": null, 319 | "links": [], 320 | "mappingType": 1, 321 | "mappingTypes": [ 322 | { 323 | "name": "value to text", 324 | "value": 1 325 | }, 326 | { 327 | "name": "range to text", 328 | "value": 2 329 | } 330 | ], 331 | "maxDataPoints": 100, 332 | "nullPointMode": "connected", 333 | "nullText": null, 334 | "options": {}, 335 | "postfix": "", 336 | "postfixFontSize": "50%", 337 | "prefix": "", 338 | "prefixFontSize": "50%", 339 | "rangeMaps": [ 340 | { 341 | "from": "null", 342 | "text": "N/A", 343 | "to": "null" 344 | } 345 | ], 346 | "sparkline": { 347 | "fillColor": "rgba(31, 118, 189, 0.18)", 348 | "full": false, 349 | "lineColor": "rgb(31, 120, 193)", 350 | "show": false 351 | }, 352 | "tableColumn": "", 353 | "targets": [ 354 | { 355 | "expr": "sum(node_md_disks{instance=~\"$instance\"})", 356 | "format": "time_series", 357 | "instant": true, 358 | "intervalFactor": 1, 359 | "legendFormat": "", 360 | "metric": "node_md_disks", 361 | "refId": "A", 362 | "step": 600 363 | } 364 | ], 365 | "thresholds": "", 366 | "title": "Total installed Disks", 367 | "type": "singlestat", 368 | "valueFontSize": "80%", 369 | "valueMaps": [ 370 | { 371 | "op": "=", 372 | "text": "N/A", 373 | "value": "null" 374 | } 375 | ], 376 | "valueName": "current" 377 | }, 378 | { 379 | "cacheTimeout": null, 380 | "colorBackground": false, 381 | "colorValue": false, 382 | "colors": [ 383 | "rgba(245, 54, 54, 0.9)", 384 | "rgba(237, 129, 40, 0.89)", 385 | "rgba(50, 172, 45, 0.97)" 386 | ], 387 | "datasource": "Prometheus", 388 | "decimals": null, 389 | "format": "none", 390 | "gauge": { 391 | "maxValue": 100, 392 | "minValue": 0, 393 | "show": false, 394 | "thresholdLabels": false, 395 | "thresholdMarkers": true 396 | }, 397 | "gridPos": { 398 | "h": 3, 399 | "w": 8, 400 | "x": 16, 401 | "y": 1 402 | }, 403 | "height": "100px", 404 | "id": 6, 405 | "interval": null, 406 | "links": [], 407 | "mappingType": 1, 408 | "mappingTypes": [ 409 | { 410 | "name": "value to text", 411 | "value": 1 412 | }, 413 | { 414 | "name": "range to text", 415 | "value": 2 416 | } 417 | ], 418 | "maxDataPoints": 100, 419 | "nullPointMode": "connected", 420 | "nullText": null, 421 | "options": {}, 422 | "postfix": "", 423 | "postfixFontSize": "50%", 424 | "prefix": "", 425 | "prefixFontSize": "50%", 426 | "rangeMaps": [ 427 | { 428 | "from": "null", 429 | "text": "N/A", 430 | "to": "null" 431 | } 432 | ], 433 | "sparkline": { 434 | "fillColor": "rgba(31, 118, 189, 0.18)", 435 | "full": false, 436 | "lineColor": "rgb(31, 120, 193)", 437 | "show": false 438 | }, 439 | "tableColumn": "", 440 | "targets": [ 441 | { 442 | "expr": "count(node_md_disks{instance=~\"$instance\"})", 443 | "format": "time_series", 444 | "instant": true, 445 | "intervalFactor": 1, 446 | "legendFormat": "", 447 | "metric": "node_md_disks_active", 448 | "refId": "A", 449 | "step": 600 450 | } 451 | ], 452 | "thresholds": "", 453 | "title": "Total MD RAIDs", 454 | "type": "singlestat", 455 | "valueFontSize": "80%", 456 | "valueMaps": [], 457 | "valueName": "current" 458 | }, 459 | { 460 | "collapsed": false, 461 | "gridPos": { 462 | "h": 1, 463 | "w": 24, 464 | "x": 0, 465 | "y": 4 466 | }, 467 | "id": 52, 468 | "panels": [], 469 | "repeat": "md", 470 | "scopedVars": { 471 | "md": { 472 | "selected": false, 473 | "text": "md0", 474 | "value": "md0" 475 | } 476 | }, 477 | "title": "$md RAID", 478 | "type": "row" 479 | }, 480 | { 481 | "cacheTimeout": null, 482 | "colorBackground": true, 483 | "colorValue": false, 484 | "colors": [ 485 | "rgba(245, 54, 54, 0.9)", 486 | "rgba(237, 129, 40, 0.89)", 487 | "rgba(50, 172, 45, 0.97)" 488 | ], 489 | "datasource": "Prometheus", 490 | "format": "none", 491 | "gauge": { 492 | "maxValue": 100, 493 | "minValue": 0, 494 | "show": false, 495 | "thresholdLabels": false, 496 | "thresholdMarkers": true 497 | }, 498 | "gridPos": { 499 | "h": 7, 500 | "w": 4, 501 | "x": 0, 502 | "y": 5 503 | }, 504 | "id": 47, 505 | "interval": null, 506 | "links": [], 507 | "mappingType": 2, 508 | "mappingTypes": [ 509 | { 510 | "name": "value to text", 511 | "value": 1 512 | }, 513 | { 514 | "name": "range to text", 515 | "value": 2 516 | } 517 | ], 518 | "maxDataPoints": 100, 519 | "nullPointMode": "connected", 520 | "nullText": null, 521 | "options": {}, 522 | "postfix": "", 523 | "postfixFontSize": "50%", 524 | "prefix": "", 525 | "prefixFontSize": "50%", 526 | "rangeMaps": [ 527 | { 528 | "from": "1", 529 | "text": "OK", 530 | "to": "1" 531 | }, 532 | { 533 | "from": "0", 534 | "text": "DEGRADED", 535 | "to": "1" 536 | } 537 | ], 538 | "scopedVars": { 539 | "md": { 540 | "selected": false, 541 | "text": "md0", 542 | "value": "md0" 543 | } 544 | }, 545 | "sparkline": { 546 | "fillColor": "rgba(31, 118, 189, 0.18)", 547 | "full": false, 548 | "lineColor": "rgb(31, 120, 193)", 549 | "show": false 550 | }, 551 | "tableColumn": "", 552 | "targets": [ 553 | { 554 | "expr": "sum(node_md_is_active{instance=~\"$instance\",device=\"$md\"}) / count(node_md_is_active{instance=~\"$instance\",device=\"$md\"})", 555 | "format": "time_series", 556 | "instant": true, 557 | "intervalFactor": 1, 558 | "refId": "A", 559 | "step": 600 560 | } 561 | ], 562 | "thresholds": "1,1", 563 | "title": "$md is active", 564 | "type": "singlestat", 565 | "valueFontSize": "80%", 566 | "valueMaps": [], 567 | "valueName": "current" 568 | }, 569 | { 570 | "cacheTimeout": null, 571 | "colorBackground": true, 572 | "colorValue": false, 573 | "colors": [ 574 | "rgba(245, 54, 54, 0.9)", 575 | "rgba(237, 129, 40, 0.89)", 576 | "rgba(50, 172, 45, 0.97)" 577 | ], 578 | "datasource": "Prometheus", 579 | "format": "none", 580 | "gauge": { 581 | "maxValue": 100, 582 | "minValue": 0, 583 | "show": false, 584 | "thresholdLabels": false, 585 | "thresholdMarkers": true 586 | }, 587 | "gridPos": { 588 | "h": 7, 589 | "w": 4, 590 | "x": 4, 591 | "y": 5 592 | }, 593 | "id": 50, 594 | "interval": null, 595 | "links": [], 596 | "mappingType": 2, 597 | "mappingTypes": [ 598 | { 599 | "name": "value to text", 600 | "value": 1 601 | }, 602 | { 603 | "name": "range to text", 604 | "value": 2 605 | } 606 | ], 607 | "maxDataPoints": 100, 608 | "nullPointMode": "connected", 609 | "nullText": null, 610 | "options": {}, 611 | "postfix": "", 612 | "postfixFontSize": "50%", 613 | "prefix": "", 614 | "prefixFontSize": "50%", 615 | "rangeMaps": [ 616 | { 617 | "from": "1", 618 | "text": "OK", 619 | "to": "1" 620 | }, 621 | { 622 | "from": "0", 623 | "text": "DEGRADED", 624 | "to": "1" 625 | } 626 | ], 627 | "scopedVars": { 628 | "md": { 629 | "selected": false, 630 | "text": "md0", 631 | "value": "md0" 632 | } 633 | }, 634 | "sparkline": { 635 | "fillColor": "rgba(31, 118, 189, 0.18)", 636 | "full": false, 637 | "lineColor": "rgb(31, 120, 193)", 638 | "show": false 639 | }, 640 | "tableColumn": "", 641 | "targets": [ 642 | { 643 | "expr": "sum(node_md_disks_active{instance=~\"$instance\",device=\"$md\"}) / sum(node_md_disks{instance=~\"$instance\",device=\"$md\"})", 644 | "format": "time_series", 645 | "instant": true, 646 | "intervalFactor": 1, 647 | "refId": "A", 648 | "step": 600 649 | } 650 | ], 651 | "thresholds": "1,1", 652 | "title": "Disks status in $md", 653 | "type": "singlestat", 654 | "valueFontSize": "80%", 655 | "valueMaps": [], 656 | "valueName": "current" 657 | }, 658 | { 659 | "cacheTimeout": null, 660 | "colorBackground": false, 661 | "colorValue": false, 662 | "colors": ["#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a"], 663 | "datasource": "Prometheus", 664 | "format": "none", 665 | "gauge": { 666 | "maxValue": 100, 667 | "minValue": 0, 668 | "show": false, 669 | "thresholdLabels": false, 670 | "thresholdMarkers": true 671 | }, 672 | "gridPos": { 673 | "h": 7, 674 | "w": 4, 675 | "x": 8, 676 | "y": 5 677 | }, 678 | "id": 48, 679 | "interval": null, 680 | "links": [], 681 | "mappingType": 1, 682 | "mappingTypes": [ 683 | { 684 | "name": "value to text", 685 | "value": 1 686 | }, 687 | { 688 | "name": "range to text", 689 | "value": 2 690 | } 691 | ], 692 | "maxDataPoints": 100, 693 | "nullPointMode": "connected", 694 | "nullText": null, 695 | "options": {}, 696 | "postfix": "", 697 | "postfixFontSize": "50%", 698 | "prefix": "", 699 | "prefixFontSize": "50%", 700 | "rangeMaps": [ 701 | { 702 | "from": "null", 703 | "text": "N/A", 704 | "to": "null" 705 | } 706 | ], 707 | "scopedVars": { 708 | "md": { 709 | "selected": false, 710 | "text": "md0", 711 | "value": "md0" 712 | } 713 | }, 714 | "sparkline": { 715 | "fillColor": "rgba(31, 118, 189, 0.18)", 716 | "full": false, 717 | "lineColor": "rgb(31, 120, 193)", 718 | "show": true 719 | }, 720 | "tableColumn": "", 721 | "targets": [ 722 | { 723 | "expr": "node_md_disks_active{instance=~\"$instance\",device=\"$md\"}", 724 | "format": "time_series", 725 | "instant": false, 726 | "intervalFactor": 1, 727 | "legendFormat": "", 728 | "refId": "A" 729 | } 730 | ], 731 | "thresholds": "", 732 | "title": "Disks active in RAID $host $md", 733 | "type": "singlestat", 734 | "valueFontSize": "80%", 735 | "valueMaps": [ 736 | { 737 | "op": "=", 738 | "text": "N/A", 739 | "value": "null" 740 | } 741 | ], 742 | "valueName": "avg" 743 | }, 744 | { 745 | "cacheTimeout": null, 746 | "colorBackground": false, 747 | "colorValue": false, 748 | "colors": ["#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a"], 749 | "datasource": "Prometheus", 750 | "format": "none", 751 | "gauge": { 752 | "maxValue": 100, 753 | "minValue": 0, 754 | "show": false, 755 | "thresholdLabels": false, 756 | "thresholdMarkers": true 757 | }, 758 | "gridPos": { 759 | "h": 7, 760 | "w": 6, 761 | "x": 12, 762 | "y": 5 763 | }, 764 | "id": 13, 765 | "interval": null, 766 | "links": [], 767 | "mappingType": 1, 768 | "mappingTypes": [ 769 | { 770 | "name": "value to text", 771 | "value": 1 772 | }, 773 | { 774 | "name": "range to text", 775 | "value": 2 776 | } 777 | ], 778 | "maxDataPoints": 100, 779 | "nullPointMode": "connected", 780 | "nullText": null, 781 | "options": {}, 782 | "postfix": "", 783 | "postfixFontSize": "50%", 784 | "prefix": "", 785 | "prefixFontSize": "50%", 786 | "rangeMaps": [ 787 | { 788 | "from": "null", 789 | "text": "N/A", 790 | "to": "null" 791 | } 792 | ], 793 | "scopedVars": { 794 | "md": { 795 | "selected": false, 796 | "text": "md0", 797 | "value": "md0" 798 | } 799 | }, 800 | "sparkline": { 801 | "fillColor": "rgba(31, 118, 189, 0.18)", 802 | "full": false, 803 | "lineColor": "rgb(31, 120, 193)", 804 | "show": true 805 | }, 806 | "tableColumn": "", 807 | "targets": [ 808 | { 809 | "expr": "node_md_disks{instance=~\"$instance\",device=\"$md\"}", 810 | "format": "time_series", 811 | "instant": false, 812 | "intervalFactor": 1, 813 | "refId": "A" 814 | } 815 | ], 816 | "thresholds": "", 817 | "title": "Disks configured in RAID $host $md", 818 | "type": "singlestat", 819 | "valueFontSize": "80%", 820 | "valueMaps": [ 821 | { 822 | "op": "=", 823 | "text": "N/A", 824 | "value": "null" 825 | } 826 | ], 827 | "valueName": "avg" 828 | }, 829 | { 830 | "aliasColors": {}, 831 | "bars": false, 832 | "dashLength": 10, 833 | "dashes": false, 834 | "datasource": "Prometheus", 835 | "fill": 1, 836 | "gridPos": { 837 | "h": 7, 838 | "w": 6, 839 | "x": 18, 840 | "y": 5 841 | }, 842 | "id": 7, 843 | "legend": { 844 | "avg": false, 845 | "current": false, 846 | "max": false, 847 | "min": false, 848 | "show": false, 849 | "total": false, 850 | "values": false 851 | }, 852 | "lines": true, 853 | "linewidth": 1, 854 | "links": [], 855 | "nullPointMode": "null", 856 | "options": {}, 857 | "percentage": false, 858 | "pointradius": 5, 859 | "points": false, 860 | "renderer": "flot", 861 | "scopedVars": { 862 | "md": { 863 | "selected": false, 864 | "text": "md0", 865 | "value": "md0" 866 | } 867 | }, 868 | "seriesOverrides": [], 869 | "spaceLength": 10, 870 | "stack": false, 871 | "steppedLine": false, 872 | "targets": [ 873 | { 874 | "expr": "(node_md_blocks_synced{instance=~\"$instance\",device=\"$md\"} / node_md_blocks{instance=~\"$instance\",device=\"$md\"}) * 100", 875 | "format": "time_series", 876 | "intervalFactor": 1, 877 | "legendFormat": "{{device }}", 878 | "refId": "A" 879 | } 880 | ], 881 | "thresholds": [], 882 | "timeFrom": null, 883 | "timeRegions": [], 884 | "timeShift": null, 885 | "title": "Sync ratio $host $md", 886 | "tooltip": { 887 | "shared": true, 888 | "sort": 0, 889 | "value_type": "individual" 890 | }, 891 | "type": "graph", 892 | "xaxis": { 893 | "buckets": null, 894 | "mode": "time", 895 | "name": null, 896 | "show": true, 897 | "values": [] 898 | }, 899 | "yaxes": [ 900 | { 901 | "format": "percent", 902 | "label": null, 903 | "logBase": 1, 904 | "max": null, 905 | "min": null, 906 | "show": true 907 | }, 908 | { 909 | "format": "short", 910 | "label": null, 911 | "logBase": 1, 912 | "max": null, 913 | "min": null, 914 | "show": true 915 | } 916 | ], 917 | "yaxis": { 918 | "align": false, 919 | "alignLevel": null 920 | } 921 | } 922 | ], 923 | "refresh": "1m", 924 | "schemaVersion": 18, 925 | "style": "dark", 926 | "tags": ["node", "disk", "mdstat"], 927 | "templating": { 928 | "list": [ 929 | { 930 | "allValue": null, 931 | "current": { 932 | "text": "sharkbay:9100", 933 | "value": "sharkbay:9100" 934 | }, 935 | "datasource": "Prometheus", 936 | "definition": "label_values(node_md_disks, instance)", 937 | "hide": 0, 938 | "includeAll": false, 939 | "label": null, 940 | "multi": false, 941 | "name": "instance", 942 | "options": [], 943 | "query": "label_values(node_md_disks, instance)", 944 | "refresh": 1, 945 | "regex": "", 946 | "skipUrlSync": false, 947 | "sort": 1, 948 | "tagValuesQuery": "", 949 | "tags": [], 950 | "tagsQuery": "", 951 | "type": "query", 952 | "useTags": false 953 | }, 954 | { 955 | "allValue": null, 956 | "current": { 957 | "text": "sharkbay", 958 | "value": "sharkbay" 959 | }, 960 | "datasource": "Prometheus", 961 | "definition": "label_values(node_md_disks{instance=~\"$instance\"}, instance)", 962 | "hide": 2, 963 | "includeAll": false, 964 | "label": null, 965 | "multi": false, 966 | "name": "host", 967 | "options": [], 968 | "query": "label_values(node_md_disks{instance=~\"$instance\"}, instance)", 969 | "refresh": 1, 970 | "regex": "/(.+):.*/", 971 | "skipUrlSync": false, 972 | "sort": 0, 973 | "tagValuesQuery": "", 974 | "tags": [], 975 | "tagsQuery": "", 976 | "type": "query", 977 | "useTags": false 978 | }, 979 | { 980 | "allValue": null, 981 | "current": { 982 | "text": "All", 983 | "value": "$__all" 984 | }, 985 | "datasource": "Prometheus", 986 | "definition": "", 987 | "hide": 0, 988 | "includeAll": true, 989 | "label": null, 990 | "multi": true, 991 | "name": "md", 992 | "options": [], 993 | "query": "label_values(node_md_is_active{instance=~\"$instance\"}, device)", 994 | "refresh": 1, 995 | "regex": "", 996 | "skipUrlSync": false, 997 | "sort": 0, 998 | "tagValuesQuery": "", 999 | "tags": [], 1000 | "tagsQuery": "", 1001 | "type": "query", 1002 | "useTags": false 1003 | } 1004 | ] 1005 | }, 1006 | "time": { 1007 | "from": "now-24h", 1008 | "to": "now" 1009 | }, 1010 | "timepicker": { 1011 | "refresh_intervals": [ 1012 | "5s", 1013 | "10s", 1014 | "30s", 1015 | "1m", 1016 | "5m", 1017 | "15m", 1018 | "30m", 1019 | "1h", 1020 | "2h", 1021 | "1d" 1022 | ], 1023 | "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] 1024 | }, 1025 | "timezone": "browser", 1026 | "title": "磁盘阵列状态", 1027 | "uid": "gUJS8Eigz", 1028 | "version": 2 1029 | } 1030 | -------------------------------------------------------------------------------- /grafana/basic.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "builtIn": 1, 6 | "datasource": "-- Grafana --", 7 | "enable": true, 8 | "hide": true, 9 | "iconColor": "rgba(0, 211, 255, 1)", 10 | "name": "Annotations & Alerts", 11 | "type": "dashboard" 12 | } 13 | ] 14 | }, 15 | "description": "精简优化重要指标展示。包含:CPU 内存 磁盘 IO 网络 等监控指标。https://github.com/starsliao/Prometheus", 16 | "editable": true, 17 | "gnetId": 9276, 18 | "graphTooltip": 0, 19 | "id": 2, 20 | "iteration": 1561974387009, 21 | "links": [], 22 | "panels": [ 23 | { 24 | "cacheTimeout": null, 25 | "colorBackground": false, 26 | "colorPrefix": false, 27 | "colorValue": true, 28 | "colors": [ 29 | "#1F60C4", 30 | "rgba(237, 129, 40, 0.89)", 31 | "rgba(50, 172, 45, 0.97)" 32 | ], 33 | "datasource": "Prometheus", 34 | "decimals": 1, 35 | "description": "", 36 | "format": "s", 37 | "gauge": { 38 | "maxValue": 100, 39 | "minValue": 0, 40 | "show": false, 41 | "thresholdLabels": false, 42 | "thresholdMarkers": true 43 | }, 44 | "gridPos": { 45 | "h": 5, 46 | "w": 4, 47 | "x": 0, 48 | "y": 0 49 | }, 50 | "hideTimeOverride": true, 51 | "id": 15, 52 | "interval": null, 53 | "links": [], 54 | "mappingType": 1, 55 | "mappingTypes": [ 56 | { 57 | "name": "value to text", 58 | "value": 1 59 | }, 60 | { 61 | "name": "range to text", 62 | "value": 2 63 | } 64 | ], 65 | "maxDataPoints": 100, 66 | "nullPointMode": "null", 67 | "nullText": null, 68 | "options": {}, 69 | "postfix": "", 70 | "postfixFontSize": "50%", 71 | "prefix": "", 72 | "prefixFontSize": "50%", 73 | "rangeMaps": [ 74 | { 75 | "from": "null", 76 | "text": "N/A", 77 | "to": "null" 78 | } 79 | ], 80 | "sparkline": { 81 | "fillColor": "rgba(31, 118, 189, 0.18)", 82 | "full": false, 83 | "lineColor": "rgb(31, 120, 193)", 84 | "show": false 85 | }, 86 | "tableColumn": "", 87 | "targets": [ 88 | { 89 | "expr": "time() - node_boot_time_seconds{instance=~\"$node\"}", 90 | "format": "time_series", 91 | "hide": false, 92 | "instant": true, 93 | "intervalFactor": 2, 94 | "refId": "A", 95 | "step": 40 96 | } 97 | ], 98 | "thresholds": "", 99 | "title": "Uptime", 100 | "type": "singlestat", 101 | "valueFontSize": "100%", 102 | "valueMaps": [ 103 | { 104 | "op": "=", 105 | "text": "N/A", 106 | "value": "null" 107 | } 108 | ], 109 | "valueName": "current" 110 | }, 111 | { 112 | "cacheTimeout": null, 113 | "colorBackground": false, 114 | "colorValue": false, 115 | "colors": [ 116 | "rgba(245, 54, 54, 0.9)", 117 | "rgba(237, 129, 40, 0.89)", 118 | "rgba(50, 172, 45, 0.97)" 119 | ], 120 | "datasource": "Prometheus", 121 | "description": "", 122 | "format": "short", 123 | "gauge": { 124 | "maxValue": 100, 125 | "minValue": 0, 126 | "show": false, 127 | "thresholdLabels": false, 128 | "thresholdMarkers": true 129 | }, 130 | "gridPos": { 131 | "h": 2, 132 | "w": 4, 133 | "x": 4, 134 | "y": 0 135 | }, 136 | "id": 14, 137 | "interval": null, 138 | "links": [], 139 | "mappingType": 1, 140 | "mappingTypes": [ 141 | { 142 | "name": "value to text", 143 | "value": 1 144 | }, 145 | { 146 | "name": "range to text", 147 | "value": 2 148 | } 149 | ], 150 | "maxDataPoints": 100, 151 | "maxPerRow": 6, 152 | "nullPointMode": "null", 153 | "nullText": null, 154 | "options": {}, 155 | "postfix": "", 156 | "postfixFontSize": "50%", 157 | "prefix": "", 158 | "prefixFontSize": "50%", 159 | "rangeMaps": [ 160 | { 161 | "from": "null", 162 | "text": "N/A", 163 | "to": "null" 164 | } 165 | ], 166 | "sparkline": { 167 | "fillColor": "rgba(31, 118, 189, 0.18)", 168 | "full": false, 169 | "lineColor": "rgb(31, 120, 193)", 170 | "show": false 171 | }, 172 | "tableColumn": "", 173 | "targets": [ 174 | { 175 | "expr": "count(count(node_cpu_seconds_total{instance=~\"$node\", mode='system'}) by (cpu))", 176 | "format": "time_series", 177 | "instant": true, 178 | "intervalFactor": 1, 179 | "legendFormat": "", 180 | "refId": "A", 181 | "step": 20 182 | } 183 | ], 184 | "thresholds": "", 185 | "title": "CPU 核数", 186 | "type": "singlestat", 187 | "valueFontSize": "70%", 188 | "valueMaps": [ 189 | { 190 | "op": "=", 191 | "text": "N/A", 192 | "value": "null" 193 | } 194 | ], 195 | "valueName": "current" 196 | }, 197 | { 198 | "cacheTimeout": null, 199 | "colorBackground": false, 200 | "colorValue": true, 201 | "colors": [ 202 | "rgba(50, 172, 45, 0.97)", 203 | "rgba(237, 129, 40, 0.89)", 204 | "rgba(245, 54, 54, 0.9)" 205 | ], 206 | "datasource": "Prometheus", 207 | "decimals": 2, 208 | "description": "", 209 | "format": "percent", 210 | "gauge": { 211 | "maxValue": 100, 212 | "minValue": 0, 213 | "show": true, 214 | "thresholdLabels": false, 215 | "thresholdMarkers": true 216 | }, 217 | "gridPos": { 218 | "h": 5, 219 | "w": 4, 220 | "x": 8, 221 | "y": 0 222 | }, 223 | "id": 167, 224 | "interval": null, 225 | "links": [], 226 | "mappingType": 1, 227 | "mappingTypes": [ 228 | { 229 | "name": "value to text", 230 | "value": 1 231 | }, 232 | { 233 | "name": "range to text", 234 | "value": 2 235 | } 236 | ], 237 | "maxDataPoints": 100, 238 | "maxPerRow": 12, 239 | "nullPointMode": "null", 240 | "nullText": null, 241 | "options": {}, 242 | "postfix": "", 243 | "postfixFontSize": "50%", 244 | "prefix": "", 245 | "prefixFontSize": "50%", 246 | "rangeMaps": [ 247 | { 248 | "from": "null", 249 | "text": "N/A", 250 | "to": "null" 251 | } 252 | ], 253 | "sparkline": { 254 | "fillColor": "rgba(31, 118, 189, 0.18)", 255 | "full": false, 256 | "lineColor": "rgb(31, 120, 193)", 257 | "show": true 258 | }, 259 | "tableColumn": "", 260 | "targets": [ 261 | { 262 | "expr": "100 - (avg(irate(node_cpu_seconds_total{instance=~\"$node\",mode=\"idle\"}[15m])) * 100)", 263 | "format": "time_series", 264 | "hide": false, 265 | "instant": false, 266 | "interval": "", 267 | "intervalFactor": 1, 268 | "legendFormat": "", 269 | "refId": "A", 270 | "step": 20 271 | } 272 | ], 273 | "thresholds": "50,80", 274 | "title": "CPU使用率(15m)", 275 | "type": "singlestat", 276 | "valueFontSize": "80%", 277 | "valueMaps": [ 278 | { 279 | "op": "=", 280 | "text": "N/A", 281 | "value": "null" 282 | } 283 | ], 284 | "valueName": "current" 285 | }, 286 | { 287 | "cacheTimeout": null, 288 | "colorBackground": false, 289 | "colorValue": true, 290 | "colors": [ 291 | "rgba(50, 172, 45, 0.97)", 292 | "rgba(237, 129, 40, 0.89)", 293 | "rgba(245, 54, 54, 0.9)" 294 | ], 295 | "datasource": "Prometheus", 296 | "decimals": 0, 297 | "description": "", 298 | "format": "percent", 299 | "gauge": { 300 | "maxValue": 100, 301 | "minValue": 0, 302 | "show": true, 303 | "thresholdLabels": false, 304 | "thresholdMarkers": true 305 | }, 306 | "gridPos": { 307 | "h": 5, 308 | "w": 4, 309 | "x": 12, 310 | "y": 0 311 | }, 312 | "hideTimeOverride": false, 313 | "id": 172, 314 | "interval": null, 315 | "links": [], 316 | "mappingType": 1, 317 | "mappingTypes": [ 318 | { 319 | "name": "value to text", 320 | "value": 1 321 | }, 322 | { 323 | "name": "range to text", 324 | "value": 2 325 | } 326 | ], 327 | "maxDataPoints": 100, 328 | "maxPerRow": 6, 329 | "nullPointMode": "null", 330 | "nullText": null, 331 | "options": {}, 332 | "postfix": "", 333 | "postfixFontSize": "50%", 334 | "prefix": "", 335 | "prefixFontSize": "50%", 336 | "rangeMaps": [ 337 | { 338 | "from": "null", 339 | "text": "N/A", 340 | "to": "null" 341 | } 342 | ], 343 | "sparkline": { 344 | "fillColor": "rgba(31, 118, 189, 0.18)", 345 | "full": false, 346 | "lineColor": "rgb(31, 120, 193)", 347 | "show": true 348 | }, 349 | "tableColumn": "", 350 | "targets": [ 351 | { 352 | "expr": "((node_memory_MemTotal_bytes{instance=~\"$node\"} - node_memory_MemFree_bytes{instance=~\"$node\"} - node_memory_Buffers_bytes{instance=~\"$node\"} - node_memory_Cached_bytes{instance=~\"$node\"}) / (node_memory_MemTotal_bytes{instance=~\"$node\"} )) * 100", 353 | "format": "time_series", 354 | "hide": false, 355 | "interval": "10s", 356 | "intervalFactor": 1, 357 | "refId": "A", 358 | "step": 20 359 | } 360 | ], 361 | "thresholds": "80,90", 362 | "title": "内存使用率", 363 | "type": "singlestat", 364 | "valueFontSize": "80%", 365 | "valueMaps": [], 366 | "valueName": "current" 367 | }, 368 | { 369 | "cacheTimeout": null, 370 | "colorBackground": false, 371 | "colorValue": true, 372 | "colors": [ 373 | "rgba(50, 172, 45, 0.97)", 374 | "rgba(237, 129, 40, 0.89)", 375 | "rgba(245, 54, 54, 0.9)" 376 | ], 377 | "datasource": "Prometheus", 378 | "decimals": null, 379 | "description": "通过变量maxmount获取最大的分区。", 380 | "format": "percent", 381 | "gauge": { 382 | "maxValue": 100, 383 | "minValue": 0, 384 | "show": true, 385 | "thresholdLabels": false, 386 | "thresholdMarkers": true 387 | }, 388 | "gridPos": { 389 | "h": 5, 390 | "w": 4, 391 | "x": 16, 392 | "y": 0 393 | }, 394 | "id": 154, 395 | "interval": null, 396 | "links": [], 397 | "mappingType": 1, 398 | "mappingTypes": [ 399 | { 400 | "name": "value to text", 401 | "value": 1 402 | }, 403 | { 404 | "name": "range to text", 405 | "value": 2 406 | } 407 | ], 408 | "maxDataPoints": 100, 409 | "maxPerRow": 6, 410 | "nullPointMode": "null", 411 | "nullText": null, 412 | "options": {}, 413 | "postfix": "", 414 | "postfixFontSize": "50%", 415 | "prefix": "", 416 | "prefixFontSize": "50%", 417 | "rangeMaps": [ 418 | { 419 | "from": "null", 420 | "text": "N/A", 421 | "to": "null" 422 | } 423 | ], 424 | "repeat": null, 425 | "repeatDirection": "h", 426 | "sparkline": { 427 | "fillColor": "rgba(31, 118, 189, 0.18)", 428 | "full": false, 429 | "lineColor": "rgb(31, 120, 193)", 430 | "show": true 431 | }, 432 | "tableColumn": "", 433 | "targets": [ 434 | { 435 | "expr": "100 - ((node_filesystem_avail_bytes{instance=~\"$node\",mountpoint=\"$maxmount\"} * 100) / node_filesystem_size_bytes {instance=~\"$node\",mountpoint=\"$maxmount\"})", 436 | "format": "time_series", 437 | "interval": "10s", 438 | "intervalFactor": 1, 439 | "refId": "A", 440 | "step": 20 441 | } 442 | ], 443 | "thresholds": "70,90", 444 | "title": "最大分区($maxmount)使用率", 445 | "type": "singlestat", 446 | "valueFontSize": "80%", 447 | "valueMaps": [ 448 | { 449 | "op": "=", 450 | "text": "N/A", 451 | "value": "null" 452 | } 453 | ], 454 | "valueName": "current" 455 | }, 456 | { 457 | "cacheTimeout": null, 458 | "colorBackground": false, 459 | "colorValue": false, 460 | "colors": ["#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a"], 461 | "datasource": "Prometheus", 462 | "format": "none", 463 | "gauge": { 464 | "maxValue": 100, 465 | "minValue": 0, 466 | "show": false, 467 | "thresholdLabels": false, 468 | "thresholdMarkers": true 469 | }, 470 | "gridPos": { 471 | "h": 5, 472 | "w": 4, 473 | "x": 20, 474 | "y": 0 475 | }, 476 | "id": 174, 477 | "interval": null, 478 | "links": [], 479 | "mappingType": 1, 480 | "mappingTypes": [ 481 | { 482 | "name": "value to text", 483 | "value": 1 484 | }, 485 | { 486 | "name": "range to text", 487 | "value": 2 488 | } 489 | ], 490 | "maxDataPoints": 100, 491 | "nullPointMode": "connected", 492 | "nullText": null, 493 | "options": {}, 494 | "postfix": "", 495 | "postfixFontSize": "50%", 496 | "prefix": "", 497 | "prefixFontSize": "50%", 498 | "rangeMaps": [ 499 | { 500 | "from": "null", 501 | "text": "N/A", 502 | "to": "null" 503 | } 504 | ], 505 | "sparkline": { 506 | "fillColor": "rgba(31, 118, 189, 0.18)", 507 | "full": false, 508 | "lineColor": "rgb(31, 120, 193)", 509 | "show": true 510 | }, 511 | "tableColumn": "", 512 | "targets": [ 513 | { 514 | "expr": "node_load15{instance=\"$node\"}", 515 | "format": "time_series", 516 | "hide": false, 517 | "instant": false, 518 | "intervalFactor": 1, 519 | "legendFormat": "1m", 520 | "refId": "A" 521 | } 522 | ], 523 | "thresholds": "1,4", 524 | "title": "系统平均负载(15m)", 525 | "type": "singlestat", 526 | "valueFontSize": "80%", 527 | "valueMaps": [ 528 | { 529 | "op": "=", 530 | "text": "N/A", 531 | "value": "null" 532 | } 533 | ], 534 | "valueName": "avg" 535 | }, 536 | { 537 | "cacheTimeout": null, 538 | "colorBackground": false, 539 | "colorValue": false, 540 | "colors": [ 541 | "rgba(245, 54, 54, 0.9)", 542 | "rgba(237, 129, 40, 0.89)", 543 | "rgba(50, 172, 45, 0.97)" 544 | ], 545 | "datasource": "Prometheus", 546 | "decimals": null, 547 | "description": "", 548 | "format": "bytes", 549 | "gauge": { 550 | "maxValue": 100, 551 | "minValue": 0, 552 | "show": false, 553 | "thresholdLabels": false, 554 | "thresholdMarkers": true 555 | }, 556 | "gridPos": { 557 | "h": 3, 558 | "w": 4, 559 | "x": 4, 560 | "y": 2 561 | }, 562 | "id": 75, 563 | "interval": null, 564 | "links": [], 565 | "mappingType": 1, 566 | "mappingTypes": [ 567 | { 568 | "name": "value to text", 569 | "value": 1 570 | }, 571 | { 572 | "name": "range to text", 573 | "value": 2 574 | } 575 | ], 576 | "maxDataPoints": 100, 577 | "maxPerRow": 6, 578 | "nullPointMode": "null", 579 | "nullText": null, 580 | "options": {}, 581 | "postfix": "", 582 | "postfixFontSize": "70%", 583 | "prefix": "", 584 | "prefixFontSize": "50%", 585 | "rangeMaps": [ 586 | { 587 | "from": "null", 588 | "text": "N/A", 589 | "to": "null" 590 | } 591 | ], 592 | "sparkline": { 593 | "fillColor": "rgba(31, 118, 189, 0.18)", 594 | "full": false, 595 | "lineColor": "rgb(31, 120, 193)", 596 | "show": false 597 | }, 598 | "tableColumn": "", 599 | "targets": [ 600 | { 601 | "expr": "node_memory_MemTotal_bytes{instance=~\"$node\"}", 602 | "format": "time_series", 603 | "instant": true, 604 | "intervalFactor": 1, 605 | "legendFormat": "{{instance}}", 606 | "refId": "A", 607 | "step": 20 608 | } 609 | ], 610 | "thresholds": "", 611 | "title": "内存总量", 612 | "type": "singlestat", 613 | "valueFontSize": "100%", 614 | "valueMaps": [ 615 | { 616 | "op": "=", 617 | "text": "N/A", 618 | "value": "null" 619 | } 620 | ], 621 | "valueName": "current" 622 | }, 623 | { 624 | "aliasColors": { 625 | "Idle - Waiting for something to happen": "#052B51", 626 | "guest": "#9AC48A", 627 | "idle": "#052B51", 628 | "iowait": "#EAB839", 629 | "irq": "#BF1B00", 630 | "nice": "#C15C17", 631 | "sdb_每秒I/O操作%": "#d683ce", 632 | "softirq": "#E24D42", 633 | "steal": "#FCE2DE", 634 | "system": "#508642", 635 | "user": "#5195CE", 636 | "磁盘花费在I/O操作占比": "#ba43a9" 637 | }, 638 | "bars": false, 639 | "dashLength": 10, 640 | "dashes": false, 641 | "datasource": "Prometheus", 642 | "decimals": 2, 643 | "description": "", 644 | "fill": 1, 645 | "gridPos": { 646 | "h": 9, 647 | "w": 12, 648 | "x": 0, 649 | "y": 5 650 | }, 651 | "id": 7, 652 | "legend": { 653 | "alignAsTable": true, 654 | "avg": true, 655 | "current": true, 656 | "hideEmpty": true, 657 | "hideZero": true, 658 | "max": true, 659 | "min": false, 660 | "rightSide": false, 661 | "show": true, 662 | "sideWidth": null, 663 | "sort": null, 664 | "sortDesc": null, 665 | "total": false, 666 | "values": true 667 | }, 668 | "lines": true, 669 | "linewidth": 1, 670 | "links": [], 671 | "maxPerRow": 6, 672 | "nullPointMode": "null", 673 | "options": {}, 674 | "percentage": false, 675 | "pointradius": 5, 676 | "points": false, 677 | "renderer": "flot", 678 | "repeat": null, 679 | "seriesOverrides": [], 680 | "spaceLength": 10, 681 | "stack": false, 682 | "steppedLine": false, 683 | "targets": [ 684 | { 685 | "expr": "avg(irate(node_cpu_seconds_total{instance=~\"$node\",mode=\"system\"}[5m]))", 686 | "format": "time_series", 687 | "interval": "", 688 | "intervalFactor": 2, 689 | "legendFormat": "System", 690 | "refId": "A", 691 | "step": 20 692 | }, 693 | { 694 | "expr": "avg(irate(node_cpu_seconds_total{instance=~\"$node\",mode=\"user\"}[5m]))", 695 | "format": "time_series", 696 | "intervalFactor": 2, 697 | "legendFormat": "User", 698 | "refId": "B", 699 | "step": 240 700 | }, 701 | { 702 | "expr": "avg(irate(node_cpu_seconds_total{instance=~\"$node\",mode=\"idle\"}[5m]))", 703 | "format": "time_series", 704 | "hide": false, 705 | "intervalFactor": 2, 706 | "legendFormat": "Idle", 707 | "refId": "F", 708 | "step": 240 709 | }, 710 | { 711 | "expr": "avg(irate(node_cpu_seconds_total{instance=~\"$node\",mode=\"iowait\"}[5m]))", 712 | "format": "time_series", 713 | "intervalFactor": 2, 714 | "legendFormat": "Iowait", 715 | "refId": "D", 716 | "step": 240 717 | } 718 | ], 719 | "thresholds": [], 720 | "timeFrom": null, 721 | "timeRegions": [], 722 | "timeShift": null, 723 | "title": "CPU使用率(%)", 724 | "tooltip": { 725 | "shared": true, 726 | "sort": 0, 727 | "value_type": "individual" 728 | }, 729 | "type": "graph", 730 | "xaxis": { 731 | "buckets": null, 732 | "mode": "time", 733 | "name": null, 734 | "show": true, 735 | "values": [] 736 | }, 737 | "yaxes": [ 738 | { 739 | "decimals": null, 740 | "format": "percentunit", 741 | "label": "", 742 | "logBase": 1, 743 | "max": "1", 744 | "min": null, 745 | "show": true 746 | }, 747 | { 748 | "format": "short", 749 | "label": null, 750 | "logBase": 1, 751 | "max": null, 752 | "min": null, 753 | "show": false 754 | } 755 | ], 756 | "yaxis": { 757 | "align": false, 758 | "alignLevel": null 759 | } 760 | }, 761 | { 762 | "aliasColors": { 763 | "15分钟": "#6ED0E0", 764 | "1分钟": "#BF1B00", 765 | "5分钟": "#CCA300" 766 | }, 767 | "bars": false, 768 | "dashLength": 10, 769 | "dashes": false, 770 | "datasource": "Prometheus", 771 | "editable": true, 772 | "error": false, 773 | "fill": 1, 774 | "grid": {}, 775 | "gridPos": { 776 | "h": 9, 777 | "w": 12, 778 | "x": 12, 779 | "y": 5 780 | }, 781 | "height": "300", 782 | "id": 13, 783 | "legend": { 784 | "alignAsTable": true, 785 | "avg": true, 786 | "current": true, 787 | "hideEmpty": true, 788 | "hideZero": true, 789 | "max": true, 790 | "min": false, 791 | "rightSide": false, 792 | "show": true, 793 | "total": false, 794 | "values": true 795 | }, 796 | "lines": true, 797 | "linewidth": 2, 798 | "links": [], 799 | "maxPerRow": 6, 800 | "nullPointMode": "null as zero", 801 | "options": {}, 802 | "percentage": false, 803 | "pointradius": 5, 804 | "points": false, 805 | "renderer": "flot", 806 | "repeat": null, 807 | "seriesOverrides": [], 808 | "spaceLength": 10, 809 | "stack": false, 810 | "steppedLine": false, 811 | "targets": [ 812 | { 813 | "expr": "node_load1{instance=~\"$node\"}", 814 | "format": "time_series", 815 | "instant": false, 816 | "interval": "10s", 817 | "intervalFactor": 2, 818 | "legendFormat": "1m", 819 | "metric": "", 820 | "refId": "A", 821 | "step": 20, 822 | "target": "" 823 | }, 824 | { 825 | "expr": "node_load5{instance=~\"$node\"}", 826 | "format": "time_series", 827 | "instant": false, 828 | "interval": "10s", 829 | "intervalFactor": 2, 830 | "legendFormat": "5m", 831 | "refId": "B", 832 | "step": 20 833 | }, 834 | { 835 | "expr": "node_load15{instance=~\"$node\"}", 836 | "format": "time_series", 837 | "instant": false, 838 | "interval": "10s", 839 | "intervalFactor": 2, 840 | "legendFormat": "15m", 841 | "refId": "C", 842 | "step": 20 843 | } 844 | ], 845 | "thresholds": [], 846 | "timeFrom": null, 847 | "timeRegions": [], 848 | "timeShift": null, 849 | "title": "系统平均负载", 850 | "tooltip": { 851 | "msResolution": false, 852 | "shared": true, 853 | "sort": 0, 854 | "value_type": "cumulative" 855 | }, 856 | "type": "graph", 857 | "xaxis": { 858 | "buckets": null, 859 | "mode": "time", 860 | "name": null, 861 | "show": true, 862 | "values": [] 863 | }, 864 | "yaxes": [ 865 | { 866 | "format": "short", 867 | "logBase": 1, 868 | "max": null, 869 | "min": null, 870 | "show": true 871 | }, 872 | { 873 | "format": "short", 874 | "logBase": 1, 875 | "max": null, 876 | "min": null, 877 | "show": true 878 | } 879 | ], 880 | "yaxis": { 881 | "align": false, 882 | "alignLevel": null 883 | } 884 | }, 885 | { 886 | "aliasColors": { 887 | "内存_Avaliable": "#6ED0E0", 888 | "内存_Cached": "#EF843C", 889 | "内存_Free": "#629E51", 890 | "内存_Total": "#6d1f62", 891 | "内存_Used": "#eab839" 892 | }, 893 | "bars": false, 894 | "dashLength": 10, 895 | "dashes": false, 896 | "datasource": "Prometheus", 897 | "decimals": 2, 898 | "fill": 1, 899 | "gridPos": { 900 | "h": 8, 901 | "w": 12, 902 | "x": 0, 903 | "y": 14 904 | }, 905 | "height": "300", 906 | "id": 156, 907 | "legend": { 908 | "alignAsTable": true, 909 | "avg": true, 910 | "current": true, 911 | "max": false, 912 | "min": false, 913 | "rightSide": false, 914 | "show": true, 915 | "total": false, 916 | "values": true 917 | }, 918 | "lines": true, 919 | "linewidth": 2, 920 | "links": [], 921 | "nullPointMode": "null", 922 | "options": {}, 923 | "percentage": false, 924 | "pointradius": 5, 925 | "points": false, 926 | "renderer": "flot", 927 | "seriesOverrides": [], 928 | "spaceLength": 10, 929 | "stack": false, 930 | "steppedLine": false, 931 | "targets": [ 932 | { 933 | "expr": "node_memory_MemTotal_bytes{instance=~\"$node\"}", 934 | "format": "time_series", 935 | "hide": false, 936 | "intervalFactor": 2, 937 | "legendFormat": "总内存", 938 | "refId": "A", 939 | "step": 4 940 | }, 941 | { 942 | "expr": "node_memory_MemTotal_bytes{instance=~\"$node\"} - (node_memory_Cached_bytes{instance=~\"$node\"} + node_memory_Buffers_bytes{instance=~\"$node\"} + node_memory_MemFree_bytes{instance=~\"$node\"})", 943 | "format": "time_series", 944 | "hide": false, 945 | "intervalFactor": 2, 946 | "legendFormat": "已用", 947 | "refId": "B", 948 | "step": 4 949 | }, 950 | { 951 | "expr": "node_memory_MemFree_bytes{instance=~\"$node\"}", 952 | "format": "time_series", 953 | "hide": true, 954 | "intervalFactor": 2, 955 | "legendFormat": "内存_Free", 956 | "refId": "C", 957 | "step": 4 958 | }, 959 | { 960 | "expr": "node_memory_Buffers_bytes{instance=~\"$node\"}", 961 | "format": "time_series", 962 | "hide": true, 963 | "intervalFactor": 2, 964 | "legendFormat": "内存_Buffers", 965 | "refId": "D", 966 | "step": 4 967 | }, 968 | { 969 | "expr": "node_memory_Cached_bytes{instance=~\"$node\"}", 970 | "format": "time_series", 971 | "hide": false, 972 | "intervalFactor": 2, 973 | "legendFormat": "Cached", 974 | "refId": "E", 975 | "step": 4 976 | }, 977 | { 978 | "expr": "node_memory_MemAvailable_bytes{instance=~\"$node\"}", 979 | "format": "time_series", 980 | "hide": false, 981 | "interval": "", 982 | "intervalFactor": 2, 983 | "legendFormat": "可用", 984 | "refId": "F", 985 | "step": 4 986 | } 987 | ], 988 | "thresholds": [], 989 | "timeFrom": null, 990 | "timeRegions": [], 991 | "timeShift": null, 992 | "title": "内存信息", 993 | "tooltip": { 994 | "shared": true, 995 | "sort": 0, 996 | "value_type": "individual" 997 | }, 998 | "type": "graph", 999 | "xaxis": { 1000 | "buckets": null, 1001 | "mode": "time", 1002 | "name": null, 1003 | "show": true, 1004 | "values": [] 1005 | }, 1006 | "yaxes": [ 1007 | { 1008 | "format": "decbytes", 1009 | "label": null, 1010 | "logBase": 1, 1011 | "max": null, 1012 | "min": "0", 1013 | "show": true 1014 | }, 1015 | { 1016 | "format": "short", 1017 | "label": null, 1018 | "logBase": 1, 1019 | "max": null, 1020 | "min": null, 1021 | "show": true 1022 | } 1023 | ], 1024 | "yaxis": { 1025 | "align": false, 1026 | "alignLevel": null 1027 | } 1028 | }, 1029 | { 1030 | "columns": [], 1031 | "datasource": "Prometheus", 1032 | "fontSize": "120%", 1033 | "gridPos": { 1034 | "h": 8, 1035 | "w": 12, 1036 | "x": 12, 1037 | "y": 14 1038 | }, 1039 | "id": 164, 1040 | "links": [], 1041 | "options": {}, 1042 | "pageSize": null, 1043 | "scroll": true, 1044 | "showHeader": true, 1045 | "sort": { 1046 | "col": null, 1047 | "desc": false 1048 | }, 1049 | "styles": [ 1050 | { 1051 | "alias": "Time", 1052 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 1053 | "pattern": "Time", 1054 | "type": "hidden" 1055 | }, 1056 | { 1057 | "alias": "分区", 1058 | "colorMode": null, 1059 | "colors": [ 1060 | "rgba(50, 172, 45, 0.97)", 1061 | "rgba(237, 129, 40, 0.89)", 1062 | "rgba(245, 54, 54, 0.9)" 1063 | ], 1064 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 1065 | "decimals": 2, 1066 | "mappingType": 1, 1067 | "pattern": "mountpoint", 1068 | "thresholds": [""], 1069 | "type": "string", 1070 | "unit": "bytes" 1071 | }, 1072 | { 1073 | "alias": "已用空间", 1074 | "colorMode": null, 1075 | "colors": [ 1076 | "rgba(245, 54, 54, 0.9)", 1077 | "rgba(237, 129, 40, 0.89)", 1078 | "rgba(50, 172, 45, 0.97)" 1079 | ], 1080 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 1081 | "decimals": 2, 1082 | "mappingType": 1, 1083 | "pattern": "Value #A", 1084 | "thresholds": ["10000000000", "20000000000"], 1085 | "type": "number", 1086 | "unit": "bytes" 1087 | }, 1088 | { 1089 | "alias": "使用率", 1090 | "colorMode": "cell", 1091 | "colors": [ 1092 | "rgba(50, 172, 45, 0.97)", 1093 | "rgba(237, 129, 40, 0.89)", 1094 | "rgba(245, 54, 54, 0.9)" 1095 | ], 1096 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 1097 | "decimals": 2, 1098 | "mappingType": 1, 1099 | "pattern": "Value #B", 1100 | "thresholds": ["70", "90"], 1101 | "type": "number", 1102 | "unit": "percentunit" 1103 | }, 1104 | { 1105 | "alias": "总空间", 1106 | "colorMode": null, 1107 | "colors": [ 1108 | "rgba(245, 54, 54, 0.9)", 1109 | "rgba(237, 129, 40, 0.89)", 1110 | "rgba(50, 172, 45, 0.97)" 1111 | ], 1112 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 1113 | "decimals": 1, 1114 | "link": false, 1115 | "mappingType": 1, 1116 | "pattern": "Value #C", 1117 | "thresholds": [], 1118 | "type": "number", 1119 | "unit": "bytes" 1120 | }, 1121 | { 1122 | "alias": "文件系统", 1123 | "colorMode": null, 1124 | "colors": [ 1125 | "rgba(245, 54, 54, 0.9)", 1126 | "rgba(237, 129, 40, 0.89)", 1127 | "rgba(50, 172, 45, 0.97)" 1128 | ], 1129 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 1130 | "decimals": 2, 1131 | "link": false, 1132 | "mappingType": 1, 1133 | "pattern": "fstype", 1134 | "thresholds": [], 1135 | "type": "number", 1136 | "unit": "short" 1137 | }, 1138 | { 1139 | "alias": "", 1140 | "colorMode": null, 1141 | "colors": [ 1142 | "rgba(245, 54, 54, 0.9)", 1143 | "rgba(237, 129, 40, 0.89)", 1144 | "rgba(50, 172, 45, 0.97)" 1145 | ], 1146 | "decimals": 2, 1147 | "pattern": "/.*/", 1148 | "preserveFormat": true, 1149 | "sanitize": false, 1150 | "thresholds": [], 1151 | "type": "hidden", 1152 | "unit": "short" 1153 | } 1154 | ], 1155 | "targets": [ 1156 | { 1157 | "expr": "node_filesystem_size_bytes{instance=~'$node',fstype=~\"ext4|xfs\"}-node_filesystem_avail_bytes {instance=~'$node',fstype=~\"ext4|xfs\"}", 1158 | "format": "table", 1159 | "hide": false, 1160 | "instant": true, 1161 | "interval": "10s", 1162 | "intervalFactor": 1, 1163 | "legendFormat": "", 1164 | "refId": "A" 1165 | }, 1166 | { 1167 | "expr": "node_filesystem_size_bytes{instance=~'$node',fstype=~\"ext4|xfs\"}", 1168 | "format": "table", 1169 | "hide": false, 1170 | "instant": true, 1171 | "intervalFactor": 1, 1172 | "legendFormat": "", 1173 | "refId": "C" 1174 | }, 1175 | { 1176 | "expr": "1-(node_filesystem_free_bytes{instance=~'$node',fstype=~\"ext4|xfs\"} / node_filesystem_size_bytes{instance=~'$node',fstype=~\"ext4|xfs\"})", 1177 | "format": "table", 1178 | "hide": false, 1179 | "instant": true, 1180 | "intervalFactor": 1, 1181 | "legendFormat": "", 1182 | "refId": "B" 1183 | } 1184 | ], 1185 | "title": "各分区可用空间", 1186 | "transform": "table", 1187 | "type": "table" 1188 | }, 1189 | { 1190 | "aliasColors": {}, 1191 | "bars": false, 1192 | "dashLength": 10, 1193 | "dashes": false, 1194 | "datasource": "Prometheus", 1195 | "fill": 1, 1196 | "gridPos": { 1197 | "h": 8, 1198 | "w": 12, 1199 | "x": 0, 1200 | "y": 22 1201 | }, 1202 | "height": "300", 1203 | "id": 157, 1204 | "legend": { 1205 | "alignAsTable": true, 1206 | "avg": true, 1207 | "current": true, 1208 | "hideEmpty": true, 1209 | "hideZero": true, 1210 | "max": true, 1211 | "min": false, 1212 | "show": true, 1213 | "total": false, 1214 | "values": true 1215 | }, 1216 | "lines": true, 1217 | "linewidth": 2, 1218 | "links": [], 1219 | "nullPointMode": "null", 1220 | "options": {}, 1221 | "percentage": false, 1222 | "pointradius": 5, 1223 | "points": false, 1224 | "renderer": "flot", 1225 | "seriesOverrides": [ 1226 | { 1227 | "alias": "/.*_out上传$/", 1228 | "transform": "negative-Y" 1229 | } 1230 | ], 1231 | "spaceLength": 10, 1232 | "stack": false, 1233 | "steppedLine": false, 1234 | "targets": [ 1235 | { 1236 | "expr": "irate(node_network_receive_bytes_total{instance=~'$node',device!~'tap.*|veth.*|br.*|docker.*|virbr*|lo*'}[5m])*8", 1237 | "format": "time_series", 1238 | "intervalFactor": 2, 1239 | "legendFormat": "{{device}}_进带宽(in)", 1240 | "refId": "A", 1241 | "step": 4 1242 | } 1243 | ], 1244 | "thresholds": [], 1245 | "timeFrom": null, 1246 | "timeRegions": [], 1247 | "timeShift": null, 1248 | "title": "网络进带宽(in)", 1249 | "tooltip": { 1250 | "shared": true, 1251 | "sort": 0, 1252 | "value_type": "individual" 1253 | }, 1254 | "type": "graph", 1255 | "xaxis": { 1256 | "buckets": null, 1257 | "mode": "time", 1258 | "name": null, 1259 | "show": true, 1260 | "values": [] 1261 | }, 1262 | "yaxes": [ 1263 | { 1264 | "format": "bps", 1265 | "label": "上传(-)/下载(+)", 1266 | "logBase": 1, 1267 | "max": null, 1268 | "min": null, 1269 | "show": true 1270 | }, 1271 | { 1272 | "format": "short", 1273 | "label": null, 1274 | "logBase": 1, 1275 | "max": null, 1276 | "min": null, 1277 | "show": false 1278 | } 1279 | ], 1280 | "yaxis": { 1281 | "align": false, 1282 | "alignLevel": null 1283 | } 1284 | }, 1285 | { 1286 | "aliasColors": {}, 1287 | "bars": false, 1288 | "dashLength": 10, 1289 | "dashes": false, 1290 | "datasource": "Prometheus", 1291 | "fill": 1, 1292 | "gridPos": { 1293 | "h": 8, 1294 | "w": 12, 1295 | "x": 12, 1296 | "y": 22 1297 | }, 1298 | "height": "300", 1299 | "id": 178, 1300 | "legend": { 1301 | "alignAsTable": true, 1302 | "avg": true, 1303 | "current": true, 1304 | "hideEmpty": true, 1305 | "hideZero": true, 1306 | "max": true, 1307 | "min": false, 1308 | "show": true, 1309 | "total": false, 1310 | "values": true 1311 | }, 1312 | "lines": true, 1313 | "linewidth": 2, 1314 | "links": [], 1315 | "nullPointMode": "null", 1316 | "options": {}, 1317 | "percentage": false, 1318 | "pointradius": 5, 1319 | "points": false, 1320 | "renderer": "flot", 1321 | "seriesOverrides": [ 1322 | { 1323 | "alias": "/.*_out上传$/", 1324 | "transform": "negative-Y" 1325 | } 1326 | ], 1327 | "spaceLength": 10, 1328 | "stack": false, 1329 | "steppedLine": false, 1330 | "targets": [ 1331 | { 1332 | "expr": "irate(node_network_transmit_bytes_total{instance=~'$node',device!~'tap.*|veth.*|br.*|docker.*|virbr*|lo*'}[5m])*8", 1333 | "format": "time_series", 1334 | "intervalFactor": 2, 1335 | "legendFormat": "{{device}}_出带宽(out)", 1336 | "refId": "B", 1337 | "step": 4 1338 | } 1339 | ], 1340 | "thresholds": [], 1341 | "timeFrom": null, 1342 | "timeRegions": [], 1343 | "timeShift": null, 1344 | "title": "网络出带宽(out)", 1345 | "tooltip": { 1346 | "shared": true, 1347 | "sort": 0, 1348 | "value_type": "individual" 1349 | }, 1350 | "type": "graph", 1351 | "xaxis": { 1352 | "buckets": null, 1353 | "mode": "time", 1354 | "name": null, 1355 | "show": true, 1356 | "values": [] 1357 | }, 1358 | "yaxes": [ 1359 | { 1360 | "format": "bps", 1361 | "label": "上传(-)/下载(+)", 1362 | "logBase": 1, 1363 | "max": null, 1364 | "min": null, 1365 | "show": true 1366 | }, 1367 | { 1368 | "format": "short", 1369 | "label": null, 1370 | "logBase": 1, 1371 | "max": null, 1372 | "min": null, 1373 | "show": false 1374 | } 1375 | ], 1376 | "yaxis": { 1377 | "align": false, 1378 | "alignLevel": null 1379 | } 1380 | }, 1381 | { 1382 | "aliasColors": { 1383 | "vda_write": "#6ED0E0" 1384 | }, 1385 | "bars": true, 1386 | "dashLength": 10, 1387 | "dashes": false, 1388 | "datasource": "Prometheus", 1389 | "description": "Reads completed: 每个磁盘分区每秒读完成次数\n\nWrites completed: 每个磁盘分区每秒写完成次数\n\nIO now 每个磁盘分区每秒正在处理的输入/输出请求数", 1390 | "fill": 2, 1391 | "gridPos": { 1392 | "h": 8, 1393 | "w": 8, 1394 | "x": 0, 1395 | "y": 30 1396 | }, 1397 | "height": "300", 1398 | "id": 161, 1399 | "legend": { 1400 | "alignAsTable": true, 1401 | "avg": false, 1402 | "current": true, 1403 | "hideEmpty": true, 1404 | "hideZero": true, 1405 | "max": true, 1406 | "min": false, 1407 | "show": true, 1408 | "total": false, 1409 | "values": true 1410 | }, 1411 | "lines": false, 1412 | "linewidth": 1, 1413 | "links": [], 1414 | "nullPointMode": "null", 1415 | "options": {}, 1416 | "percentage": false, 1417 | "pointradius": 5, 1418 | "points": false, 1419 | "renderer": "flot", 1420 | "seriesOverrides": [ 1421 | { 1422 | "alias": "/.*_读取$/", 1423 | "transform": "negative-Y" 1424 | } 1425 | ], 1426 | "spaceLength": 10, 1427 | "stack": false, 1428 | "steppedLine": false, 1429 | "targets": [ 1430 | { 1431 | "expr": "irate(node_disk_reads_completed_total{instance=~\"$node\"}[5m])", 1432 | "format": "time_series", 1433 | "hide": false, 1434 | "interval": "", 1435 | "intervalFactor": 2, 1436 | "legendFormat": "{{device}}_读取", 1437 | "refId": "A", 1438 | "step": 10 1439 | }, 1440 | { 1441 | "expr": "irate(node_disk_writes_completed_total{instance=~\"$node\"}[5m])", 1442 | "format": "time_series", 1443 | "hide": false, 1444 | "intervalFactor": 2, 1445 | "legendFormat": "{{device}}_写入", 1446 | "refId": "B", 1447 | "step": 10 1448 | }, 1449 | { 1450 | "expr": "node_disk_io_now{instance=~\"$node\"}", 1451 | "format": "time_series", 1452 | "hide": true, 1453 | "interval": "", 1454 | "intervalFactor": 1, 1455 | "legendFormat": "{{device}}", 1456 | "refId": "C" 1457 | } 1458 | ], 1459 | "thresholds": [], 1460 | "timeFrom": null, 1461 | "timeRegions": [], 1462 | "timeShift": null, 1463 | "title": "磁盘读写速率(IOPS)", 1464 | "tooltip": { 1465 | "shared": true, 1466 | "sort": 0, 1467 | "value_type": "individual" 1468 | }, 1469 | "type": "graph", 1470 | "xaxis": { 1471 | "buckets": null, 1472 | "mode": "time", 1473 | "name": null, 1474 | "show": true, 1475 | "values": [] 1476 | }, 1477 | "yaxes": [ 1478 | { 1479 | "decimals": null, 1480 | "format": "iops", 1481 | "label": "读取(-)/写入(+)I/O ops/sec", 1482 | "logBase": 1, 1483 | "max": null, 1484 | "min": null, 1485 | "show": true 1486 | }, 1487 | { 1488 | "format": "short", 1489 | "label": null, 1490 | "logBase": 1, 1491 | "max": null, 1492 | "min": null, 1493 | "show": true 1494 | } 1495 | ], 1496 | "yaxis": { 1497 | "align": false, 1498 | "alignLevel": null 1499 | } 1500 | }, 1501 | { 1502 | "aliasColors": { 1503 | "vda_write": "#6ED0E0" 1504 | }, 1505 | "bars": true, 1506 | "dashLength": 10, 1507 | "dashes": false, 1508 | "datasource": "Prometheus", 1509 | "description": "Read bytes 每个磁盘分区每秒读取的比特数\nWritten bytes 每个磁盘分区每秒写入的比特数", 1510 | "fill": 2, 1511 | "gridPos": { 1512 | "h": 8, 1513 | "w": 8, 1514 | "x": 8, 1515 | "y": 30 1516 | }, 1517 | "height": "300", 1518 | "id": 168, 1519 | "legend": { 1520 | "alignAsTable": true, 1521 | "avg": false, 1522 | "current": true, 1523 | "hideEmpty": true, 1524 | "hideZero": true, 1525 | "max": true, 1526 | "min": false, 1527 | "show": true, 1528 | "total": false, 1529 | "values": true 1530 | }, 1531 | "lines": false, 1532 | "linewidth": 1, 1533 | "links": [], 1534 | "nullPointMode": "null", 1535 | "options": {}, 1536 | "percentage": false, 1537 | "pointradius": 5, 1538 | "points": false, 1539 | "renderer": "flot", 1540 | "seriesOverrides": [ 1541 | { 1542 | "alias": "/.*_读取$/", 1543 | "transform": "negative-Y" 1544 | } 1545 | ], 1546 | "spaceLength": 10, 1547 | "stack": false, 1548 | "steppedLine": false, 1549 | "targets": [ 1550 | { 1551 | "expr": "irate(node_disk_read_bytes_total{instance=~\"$node\"}[5m])", 1552 | "format": "time_series", 1553 | "interval": "", 1554 | "intervalFactor": 2, 1555 | "legendFormat": "{{device}}_读取", 1556 | "refId": "A", 1557 | "step": 10 1558 | }, 1559 | { 1560 | "expr": "irate(node_disk_written_bytes_total{instance=~\"$node\"}[5m])", 1561 | "format": "time_series", 1562 | "hide": false, 1563 | "intervalFactor": 2, 1564 | "legendFormat": "{{device}}_写入", 1565 | "refId": "B", 1566 | "step": 10 1567 | } 1568 | ], 1569 | "thresholds": [], 1570 | "timeFrom": null, 1571 | "timeRegions": [], 1572 | "timeShift": null, 1573 | "title": "磁盘读写容量大小", 1574 | "tooltip": { 1575 | "shared": true, 1576 | "sort": 0, 1577 | "value_type": "individual" 1578 | }, 1579 | "type": "graph", 1580 | "xaxis": { 1581 | "buckets": null, 1582 | "mode": "time", 1583 | "name": null, 1584 | "show": true, 1585 | "values": [] 1586 | }, 1587 | "yaxes": [ 1588 | { 1589 | "decimals": null, 1590 | "format": "Bps", 1591 | "label": "读取(-)/写入(+)", 1592 | "logBase": 1, 1593 | "max": null, 1594 | "min": null, 1595 | "show": true 1596 | }, 1597 | { 1598 | "format": "short", 1599 | "label": null, 1600 | "logBase": 1, 1601 | "max": null, 1602 | "min": null, 1603 | "show": false 1604 | } 1605 | ], 1606 | "yaxis": { 1607 | "align": false, 1608 | "alignLevel": null 1609 | } 1610 | }, 1611 | { 1612 | "aliasColors": { 1613 | "vda": "#6ED0E0" 1614 | }, 1615 | "bars": false, 1616 | "dashLength": 10, 1617 | "dashes": false, 1618 | "datasource": "Prometheus", 1619 | "description": "Read time ms 每个磁盘分区读操作花费的秒数\n\nWrite time ms 每个磁盘分区写操作花费的秒数\n\nIO time ms 每个磁盘分区输入/输出操作花费的秒数\n\nIO time weighted 每个磁盘分区输入/输出操作花费的加权秒数", 1620 | "fill": 3, 1621 | "gridPos": { 1622 | "h": 8, 1623 | "w": 8, 1624 | "x": 16, 1625 | "y": 30 1626 | }, 1627 | "height": "300", 1628 | "id": 160, 1629 | "legend": { 1630 | "alignAsTable": true, 1631 | "avg": false, 1632 | "current": true, 1633 | "hideEmpty": true, 1634 | "hideZero": true, 1635 | "max": true, 1636 | "min": false, 1637 | "show": true, 1638 | "total": false, 1639 | "values": true 1640 | }, 1641 | "lines": true, 1642 | "linewidth": 1, 1643 | "links": [], 1644 | "nullPointMode": "null", 1645 | "options": {}, 1646 | "percentage": false, 1647 | "pointradius": 5, 1648 | "points": false, 1649 | "renderer": "flot", 1650 | "seriesOverrides": [ 1651 | { 1652 | "alias": "/,*_读取$/", 1653 | "transform": "negative-Y" 1654 | } 1655 | ], 1656 | "spaceLength": 10, 1657 | "stack": false, 1658 | "steppedLine": false, 1659 | "targets": [ 1660 | { 1661 | "expr": "irate(node_disk_io_time_seconds_total{instance=~\"$node\"}[5m])", 1662 | "format": "time_series", 1663 | "hide": true, 1664 | "interval": "", 1665 | "intervalFactor": 2, 1666 | "legendFormat": "{{device}}", 1667 | "refId": "A", 1668 | "step": 10 1669 | }, 1670 | { 1671 | "expr": "irate(node_disk_io_time_weighted_seconds_total{instance=~\"$node\"}[5m])", 1672 | "format": "time_series", 1673 | "hide": true, 1674 | "intervalFactor": 1, 1675 | "legendFormat": "{{device}}_加权", 1676 | "refId": "D" 1677 | }, 1678 | { 1679 | "expr": "irate(node_disk_read_time_seconds_total{instance=~\"$node\"}[5m])", 1680 | "format": "time_series", 1681 | "hide": false, 1682 | "interval": "", 1683 | "intervalFactor": 1, 1684 | "legendFormat": "{{device}}_读取", 1685 | "refId": "B" 1686 | }, 1687 | { 1688 | "expr": "irate(node_disk_write_time_seconds_total{instance=~\"$node\"}[5m])", 1689 | "format": "time_series", 1690 | "hide": false, 1691 | "intervalFactor": 1, 1692 | "legendFormat": "{{device}}_写入", 1693 | "refId": "C" 1694 | } 1695 | ], 1696 | "thresholds": [], 1697 | "timeFrom": null, 1698 | "timeRegions": [], 1699 | "timeShift": null, 1700 | "title": "磁盘IO读写时间", 1701 | "tooltip": { 1702 | "shared": true, 1703 | "sort": 0, 1704 | "value_type": "individual" 1705 | }, 1706 | "type": "graph", 1707 | "xaxis": { 1708 | "buckets": null, 1709 | "mode": "time", 1710 | "name": null, 1711 | "show": true, 1712 | "values": [] 1713 | }, 1714 | "yaxes": [ 1715 | { 1716 | "format": "s", 1717 | "label": "读取(-)/写入(+)", 1718 | "logBase": 1, 1719 | "max": null, 1720 | "min": null, 1721 | "show": true 1722 | }, 1723 | { 1724 | "format": "short", 1725 | "label": null, 1726 | "logBase": 1, 1727 | "max": null, 1728 | "min": null, 1729 | "show": false 1730 | } 1731 | ], 1732 | "yaxis": { 1733 | "align": false, 1734 | "alignLevel": null 1735 | } 1736 | }, 1737 | { 1738 | "aliasColors": {}, 1739 | "bars": false, 1740 | "dashLength": 10, 1741 | "dashes": false, 1742 | "datasource": "Prometheus", 1743 | "description": "node_disk_io_time_seconds_total:\n磁盘花费在输入/输出操作上的毫秒数。该值为累加值。(Milliseconds Spent Doing I/Os)\n\nirate(node_disk_io_time_seconds_total[5m]):\n计算每秒的速率:(last值-last前一个值)/时间戳差值,即:1秒钟内磁盘花费在I/O操作的时间占比。", 1744 | "fill": 1, 1745 | "gridPos": { 1746 | "h": 9, 1747 | "w": 12, 1748 | "x": 0, 1749 | "y": 38 1750 | }, 1751 | "id": 176, 1752 | "legend": { 1753 | "alignAsTable": true, 1754 | "avg": false, 1755 | "current": true, 1756 | "hideEmpty": true, 1757 | "hideZero": true, 1758 | "max": true, 1759 | "min": false, 1760 | "show": true, 1761 | "total": false, 1762 | "values": true 1763 | }, 1764 | "lines": true, 1765 | "linewidth": 1, 1766 | "links": [], 1767 | "nullPointMode": "null", 1768 | "options": {}, 1769 | "percentage": false, 1770 | "pointradius": 5, 1771 | "points": false, 1772 | "renderer": "flot", 1773 | "seriesOverrides": [], 1774 | "spaceLength": 10, 1775 | "stack": false, 1776 | "steppedLine": false, 1777 | "targets": [ 1778 | { 1779 | "expr": "irate(node_disk_io_time_seconds_total{instance=~\"$node\"}[5m])", 1780 | "format": "time_series", 1781 | "intervalFactor": 1, 1782 | "legendFormat": "{{device}}_每秒I/O操作%", 1783 | "refId": "A" 1784 | } 1785 | ], 1786 | "thresholds": [], 1787 | "timeFrom": null, 1788 | "timeRegions": [], 1789 | "timeShift": null, 1790 | "title": "磁盘每秒的I/O操作耗费时间(%)", 1791 | "tooltip": { 1792 | "shared": true, 1793 | "sort": 0, 1794 | "value_type": "individual" 1795 | }, 1796 | "type": "graph", 1797 | "xaxis": { 1798 | "buckets": null, 1799 | "mode": "time", 1800 | "name": null, 1801 | "show": true, 1802 | "values": [] 1803 | }, 1804 | "yaxes": [ 1805 | { 1806 | "format": "short", 1807 | "label": null, 1808 | "logBase": 1, 1809 | "max": null, 1810 | "min": null, 1811 | "show": true 1812 | }, 1813 | { 1814 | "format": "short", 1815 | "label": null, 1816 | "logBase": 1, 1817 | "max": null, 1818 | "min": null, 1819 | "show": true 1820 | } 1821 | ], 1822 | "yaxis": { 1823 | "align": false, 1824 | "alignLevel": null 1825 | } 1826 | }, 1827 | { 1828 | "aliasColors": { 1829 | "TCP": "#6ED0E0" 1830 | }, 1831 | "bars": false, 1832 | "dashLength": 10, 1833 | "dashes": false, 1834 | "datasource": "Prometheus", 1835 | "description": "CurrEstab - 当前状态为 ESTABLISHED 或 CLOSE-WAIT 的 TCP 连接数\n\nActiveOpens - 已从 CLOSED 状态直接转换到 SYN-SENT 状态的 TCP 平均连接数(1分钟内)\n\nPassiveOpens - 已从 LISTEN 状态直接转换到 SYN-RCVD 状态的 TCP 平均连接数(1分钟内)\n\nTCP_alloc - 已分配(已建立、已申请到sk_buff)的TCP套接字数量\n\nTCP_inuse - 正在使用(正在侦听)的TCP套接字数量\n\nTCP_tw - 等待关闭的TCP连接数", 1836 | "fill": 0, 1837 | "gridPos": { 1838 | "h": 9, 1839 | "w": 12, 1840 | "x": 12, 1841 | "y": 38 1842 | }, 1843 | "height": "300", 1844 | "id": 158, 1845 | "legend": { 1846 | "alignAsTable": true, 1847 | "avg": false, 1848 | "current": true, 1849 | "max": true, 1850 | "min": false, 1851 | "rightSide": false, 1852 | "show": true, 1853 | "total": false, 1854 | "values": true 1855 | }, 1856 | "lines": true, 1857 | "linewidth": 1, 1858 | "links": [], 1859 | "nullPointMode": "null", 1860 | "options": {}, 1861 | "percentage": false, 1862 | "pointradius": 5, 1863 | "points": false, 1864 | "renderer": "flot", 1865 | "seriesOverrides": [], 1866 | "spaceLength": 10, 1867 | "stack": false, 1868 | "steppedLine": false, 1869 | "targets": [ 1870 | { 1871 | "expr": "node_netstat_Tcp_CurrEstab{instance=~'$node'}", 1872 | "format": "time_series", 1873 | "hide": false, 1874 | "interval": "10s", 1875 | "intervalFactor": 1, 1876 | "legendFormat": "ESTABLISHED", 1877 | "refId": "A", 1878 | "step": 20 1879 | }, 1880 | { 1881 | "expr": "node_sockstat_TCP_tw{instance=~'$node'}", 1882 | "format": "time_series", 1883 | "intervalFactor": 1, 1884 | "legendFormat": "TCP_tw", 1885 | "refId": "D" 1886 | }, 1887 | { 1888 | "expr": "irate(node_netstat_Tcp_ActiveOpens{instance=~'$node'}[5m])", 1889 | "format": "time_series", 1890 | "hide": false, 1891 | "intervalFactor": 1, 1892 | "legendFormat": "ActiveOpens", 1893 | "refId": "B" 1894 | }, 1895 | { 1896 | "expr": "irate(node_netstat_Tcp_PassiveOpens{instance=~'$node'}[5m])", 1897 | "format": "time_series", 1898 | "intervalFactor": 1, 1899 | "legendFormat": "PassiveOpens", 1900 | "refId": "C" 1901 | }, 1902 | { 1903 | "expr": "node_sockstat_TCP_alloc{instance=~'$node'}", 1904 | "format": "time_series", 1905 | "intervalFactor": 1, 1906 | "legendFormat": "TCP_alloc", 1907 | "refId": "E" 1908 | }, 1909 | { 1910 | "expr": "node_sockstat_TCP_inuse{instance=~'$node'}", 1911 | "format": "time_series", 1912 | "intervalFactor": 1, 1913 | "legendFormat": "TCP_inuse", 1914 | "refId": "F" 1915 | } 1916 | ], 1917 | "thresholds": [], 1918 | "timeFrom": null, 1919 | "timeRegions": [], 1920 | "timeShift": null, 1921 | "title": "TCP 连接情况", 1922 | "tooltip": { 1923 | "shared": true, 1924 | "sort": 0, 1925 | "value_type": "individual" 1926 | }, 1927 | "type": "graph", 1928 | "xaxis": { 1929 | "buckets": null, 1930 | "mode": "time", 1931 | "name": null, 1932 | "show": true, 1933 | "values": [] 1934 | }, 1935 | "yaxes": [ 1936 | { 1937 | "format": "short", 1938 | "label": null, 1939 | "logBase": 1, 1940 | "max": null, 1941 | "min": null, 1942 | "show": true 1943 | }, 1944 | { 1945 | "format": "short", 1946 | "label": null, 1947 | "logBase": 1, 1948 | "max": null, 1949 | "min": null, 1950 | "show": true 1951 | } 1952 | ], 1953 | "yaxis": { 1954 | "align": false, 1955 | "alignLevel": null 1956 | } 1957 | }, 1958 | { 1959 | "aliasColors": {}, 1960 | "bars": false, 1961 | "dashLength": 10, 1962 | "dashes": false, 1963 | "fill": 1, 1964 | "gridPos": { 1965 | "h": 7, 1966 | "w": 24, 1967 | "x": 0, 1968 | "y": 47 1969 | }, 1970 | "id": 180, 1971 | "legend": { 1972 | "avg": false, 1973 | "current": false, 1974 | "max": false, 1975 | "min": false, 1976 | "rightSide": false, 1977 | "show": false, 1978 | "total": false, 1979 | "values": false 1980 | }, 1981 | "lines": true, 1982 | "linewidth": 1, 1983 | "links": [], 1984 | "nullPointMode": "null", 1985 | "options": {}, 1986 | "percentage": false, 1987 | "pointradius": 2, 1988 | "points": false, 1989 | "renderer": "flot", 1990 | "seriesOverrides": [], 1991 | "spaceLength": 10, 1992 | "stack": false, 1993 | "steppedLine": false, 1994 | "targets": [ 1995 | { 1996 | "expr": "node_hwmon_temp_celsius{instance=~'$node'}", 1997 | "format": "time_series", 1998 | "intervalFactor": 1, 1999 | "refId": "A" 2000 | } 2001 | ], 2002 | "thresholds": [], 2003 | "timeFrom": null, 2004 | "timeRegions": [], 2005 | "timeShift": null, 2006 | "title": "硬件温度", 2007 | "tooltip": { 2008 | "shared": true, 2009 | "sort": 0, 2010 | "value_type": "individual" 2011 | }, 2012 | "type": "graph", 2013 | "xaxis": { 2014 | "buckets": null, 2015 | "mode": "time", 2016 | "name": null, 2017 | "show": true, 2018 | "values": [] 2019 | }, 2020 | "yaxes": [ 2021 | { 2022 | "format": "celsius", 2023 | "label": null, 2024 | "logBase": 1, 2025 | "max": null, 2026 | "min": null, 2027 | "show": true 2028 | }, 2029 | { 2030 | "format": "short", 2031 | "label": null, 2032 | "logBase": 1, 2033 | "max": null, 2034 | "min": null, 2035 | "show": true 2036 | } 2037 | ], 2038 | "yaxis": { 2039 | "align": false, 2040 | "alignLevel": null 2041 | } 2042 | } 2043 | ], 2044 | "refresh": "5m", 2045 | "schemaVersion": 18, 2046 | "style": "dark", 2047 | "tags": ["StarsL", "Prometheus"], 2048 | "templating": { 2049 | "list": [ 2050 | { 2051 | "allFormat": "glob", 2052 | "allValue": null, 2053 | "current": { 2054 | "text": "sharkbay", 2055 | "value": "sharkbay" 2056 | }, 2057 | "datasource": "Prometheus", 2058 | "definition": "label_values(node_boot_time_seconds,job)", 2059 | "hide": 0, 2060 | "includeAll": false, 2061 | "label": "分组名称", 2062 | "multi": false, 2063 | "multiFormat": "regex values", 2064 | "name": "job", 2065 | "options": [], 2066 | "query": "label_values(node_boot_time_seconds,job)", 2067 | "refresh": 1, 2068 | "regex": "", 2069 | "skipUrlSync": false, 2070 | "sort": 1, 2071 | "tagValuesQuery": "", 2072 | "tags": [], 2073 | "tagsQuery": "", 2074 | "type": "query", 2075 | "useTags": false 2076 | }, 2077 | { 2078 | "allFormat": "glob", 2079 | "allValue": null, 2080 | "current": { 2081 | "text": "sharkbay:9100", 2082 | "value": "sharkbay:9100" 2083 | }, 2084 | "datasource": "Prometheus", 2085 | "definition": "", 2086 | "hide": 0, 2087 | "includeAll": false, 2088 | "label": "IP地址", 2089 | "multi": false, 2090 | "multiFormat": "regex values", 2091 | "name": "node", 2092 | "options": [], 2093 | "query": "label_values(up{job=\"$job\"},instance)", 2094 | "refresh": 1, 2095 | "regex": "", 2096 | "skipUrlSync": false, 2097 | "sort": 2, 2098 | "tagValuesQuery": "", 2099 | "tags": [], 2100 | "tagsQuery": "", 2101 | "type": "query", 2102 | "useTags": false 2103 | }, 2104 | { 2105 | "allValue": null, 2106 | "current": { 2107 | "text": "/home", 2108 | "value": "/home" 2109 | }, 2110 | "datasource": "Prometheus", 2111 | "definition": "query_result(topk(1,sort_desc (max(node_filesystem_size_bytes{instance=~'$node',fstype=~\"ext4|xfs|rootfs\"}) by (mountpoint))))", 2112 | "hide": 2, 2113 | "includeAll": false, 2114 | "label": "", 2115 | "multi": false, 2116 | "name": "maxmount", 2117 | "options": [], 2118 | "query": "query_result(topk(1,sort_desc (max(node_filesystem_size_bytes{instance=~'$node',fstype=~\"ext4|xfs|rootfs\"}) by (mountpoint))))", 2119 | "refresh": 1, 2120 | "regex": "/.*\\\"(.*)\\\".*/", 2121 | "skipUrlSync": false, 2122 | "sort": 0, 2123 | "tagValuesQuery": "", 2124 | "tags": [], 2125 | "tagsQuery": "", 2126 | "type": "query", 2127 | "useTags": false 2128 | }, 2129 | { 2130 | "allValue": null, 2131 | "current": { 2132 | "isNone": true, 2133 | "text": "None", 2134 | "value": "" 2135 | }, 2136 | "datasource": "Prometheus", 2137 | "definition": "", 2138 | "hide": 2, 2139 | "includeAll": false, 2140 | "label": "网卡", 2141 | "multi": false, 2142 | "name": "nic", 2143 | "options": [], 2144 | "query": "query_result(node_network_up{interface=\"eth0\"})", 2145 | "refresh": 1, 2146 | "regex": "/interface=\"(\\S*)\",job/", 2147 | "skipUrlSync": false, 2148 | "sort": 0, 2149 | "tagValuesQuery": "", 2150 | "tags": [], 2151 | "tagsQuery": "", 2152 | "type": "query", 2153 | "useTags": false 2154 | } 2155 | ] 2156 | }, 2157 | "time": { 2158 | "from": "now-24h", 2159 | "to": "now" 2160 | }, 2161 | "timepicker": { 2162 | "now": true, 2163 | "refresh_intervals": ["30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"], 2164 | "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] 2165 | }, 2166 | "timezone": "", 2167 | "title": "主机基础监控", 2168 | "uid": "Bkl9bBYik", 2169 | "version": 10 2170 | } 2171 | --------------------------------------------------------------------------------