Grafana dashboard: linux主机运行状态监控(node_exporter)
Description: 目的是尽量在一个页面显示节点主机的系统概况，包括CPU、内存(memeory)、交换分区(swap)、分区(filesystem)，上传下载速度(network transmission)

节点主机的系统概况，包括CPU、内存(memeory)、交换分区(swap)、分区(filesystem)，上传下载速度(network transmission)     

遗留问题   
1、分区容量按百分比设置Threshold的问题，目前我看到的是只能设置固定数字，如果有大神看到有可以按百分比设置的，请留言指教一下，多谢。   
2、网络传输，当多个网络设备时，如果能按照查询结果中设备的数量来设置颜色就完美了。比如我设置result[0] = purple, result[1]=orange, result[3]=red，那么结果如果只有一个设备，那么就是紫色，如果两个，就是紫色和桔色，如果3个就是紫桔红，再多就是自动。   
3、分区容量百分比显示的guage，如果title能显示值，比如(共xxxGib，已用yyyGib)，那么table就可以去除了。如果有大神有实现方法，请留言指教一下，多谢。   


{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "panel",
      "id": "bargauge",
      "name": "Bar Gauge",
      "version": ""
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "6.5.2"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 11414,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1576462482149,
  "links": [],
  "panels": [
    {
      "collapsed": false,
      "datasource": "${DS_PROMETHEUS}",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 12,
      "panels": [],
      "repeat": null,
      "title": "概览",
      "type": "row"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "format": "dthms",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 7,
        "x": 0,
        "y": 1
      },
      "id": 31,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false,
        "ymax": null,
        "ymin": null
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "node_time_seconds{instance='$node',job='$job'} - node_boot_time_seconds{instance='$node',job='$job'}",
          "instant": false,
          "refId": "A"
        }
      ],
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "$node 连续运行时间",
      "transparent": true,
      "type": "singlestat",
      "valueFontSize": "70%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 8,
        "y": 1
      },
      "hiddenSeries": false,
      "id": 28,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": false,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "/.*下载/",
          "color": "rgb(113, 85, 251)"
        },
        {
          "alias": "/.*上传/",
          "color": "rgb(228, 135, 12)",
          "transform": "negative-Y"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "rate(node_network_receive_bytes_total{instance=\"$node\",job=\"$job\",device!~'tap.*|veth.*|br.*|docker.*|virbr*|lo*'}[1m])*8",
          "hide": false,
          "legendFormat": "{{device}} 下载",
          "refId": "A"
        },
        {
          "expr": "rate(node_network_transmit_bytes_total{instance=~'$node',job=\"$job\",device!~'tap.*|veth.*|br.*|docker.*|virbr*|lo*'}[1m])*8",
          "hide": false,
          "legendFormat": "{{device}} 上传",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "$node 网络传输",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "bytes",
          "label": "上传(-)/下载(+)",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "bytes",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fill": 0,
      "fillGradient": 0,
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 16,
        "y": 1
      },
      "hiddenSeries": false,
      "id": 29,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": false,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "/.*开启的文件描述符/",
          "color": "rgb(113, 85, 251)"
        },
        {
          "alias": "/.*上下文切换/",
          "color": "rgb(228, 135, 12)",
          "lines": false,
          "points": true,
          "yaxis": 2
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "node_filefd_allocated{instance=\"$node\",job=\"$job\"}",
          "intervalFactor": 5,
          "legendFormat": " 开启的文件描述符",
          "refId": "A"
        },
        {
          "expr": "irate(node_context_switches_total{instance='$node',job='$job'}[5m])",
          "intervalFactor": 10,
          "legendFormat": "上下文切换",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "$node 文件IO",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": "文件描述符总数",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": "上下文切换次数",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "description": "节点系统在不同时间周期内的平均负载",
      "fill": 4,
      "fillGradient": 4,
      "gridPos": {
        "h": 6,
        "w": 8,
        "x": 0,
        "y": 3
      },
      "hiddenSeries": false,
      "id": 9,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "/.*1分钟/",
          "color": "rgb(113, 85, 251)"
        },
        {
          "alias": "/.*5分钟/",
          "color": "rgb(31, 149, 193)"
        },
        {
          "alias": "/.*15分钟/",
          "color": "rgb(228, 135, 12)"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "node_load1{instance=~\"$node\",job=\"$job\"}",
          "legendFormat": "1分钟",
          "refId": "A"
        },
        {
          "expr": "node_load5{instance=~\"$node\",job=\"$job\"}",
          "legendFormat": "5分钟",
          "refId": "B"
        },
        {
          "expr": "node_load15{instance=~\"$node\",job=\"$job\"}",
          "legendFormat": "15分钟",
          "refId": "C"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "$node CPU周期负载",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "description": "节点系统在某一时刻的使用分布",
      "fill": 8,
      "fillGradient": 5,
      "gridPos": {
        "h": 6,
        "w": 8,
        "x": 0,
        "y": 9
      },
      "hiddenSeries": false,
      "id": 24,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null as zero",
      "options": {
        "dataLinks": []
      },
      "percentage": true,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "/.*用户/",
          "color": "rgb(113, 85, 251)"
        },
        {
          "alias": "/.*系统/",
          "color": "rgb(85, 136, 251)"
        },
        {
          "alias": "/.*IO等待/",
          "color": "rgb(228, 135, 12)"
        },
        {
          "alias": "/.*IRQ/",
          "color": "rgb(31, 149, 193)"
        },
        {
          "alias": "/.*空闲/",
          "color": "rgba(41, 236, 101, 0.05)"
        }
      ],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "expr": "avg(rate(node_cpu_seconds_total{mode=~'.*irq',instance=~'$node',job=~'$job'}[5m])) without(cpu,mode)",
          "hide": false,
          "legendFormat": "IRQ",
          "refId": "C"
        },
        {
          "expr": "avg(rate(node_cpu_seconds_total{mode=~'iowait',instance=~'$node',job=~'$job'}[5m])) without(cpu)",
          "legendFormat": "IO等待",
          "refId": "A"
        },
        {
          "expr": "avg(rate(node_cpu_seconds_total{mode=~'system',instance=~'$node',job=~'$job'}[5m])) without(cpu)",
          "hide": false,
          "legendFormat": "系统",
          "refId": "D"
        },
        {
          "expr": "avg(rate(node_cpu_seconds_total{mode=~'user',instance=~'$node',job=~'$job'}[5m])) without(cpu)",
          "hide": false,
          "legendFormat": "用户",
          "refId": "B"
        },
        {
          "expr": "avg(rate(node_cpu_seconds_total{mode=~'idle',instance=~'$node',job=~'$job'}[5m])) without(cpu)",
          "hide": false,
          "legendFormat": "空闲",
          "refId": "E"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "$node CPU负载分布",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "cumulative"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "percentunit",
          "label": "",
          "logBase": 1,
          "max": "100",
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": true,
        "alignLevel": null
      }
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorPostfix": true,
      "colorValue": true,
      "colors": [
        "rgb(252, 70, 73)",
        "rgba(237, 129, 40, 0.89)",
        "rgb(85, 136, 251)"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "format": "bytes",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 8,
        "x": 8,
        "y": 9
      },
      "id": 4,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "pluginVersion": "6.5.1",
      "postfix": "可用",
      "postfixFontSize": "70%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": true,
        "lineColor": "rgb(85, 136, 251)",
        "show": false,
        "ymax": null,
        "ymin": null
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"}",
          "hide": false,
          "legendFormat": "可用",
          "refId": "A"
        },
        {
          "expr": "(node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"} / node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"})*100",
          "hide": true,
          "legendFormat": "可用",
          "refId": "B"
        }
      ],
      "thresholds": "10,25",
      "timeFrom": null,
      "timeShift": null,
      "title": "$node 物理内存",
      "transparent": true,
      "type": "singlestat",
      "valueFontSize": "70%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorPostfix": true,
      "colorValue": true,
      "colors": [
        "rgb(85, 136, 251)",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "format": "bytes",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 8,
        "x": 16,
        "y": 9
      },
      "id": 5,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "options": {},
      "pluginVersion": "6.5.1",
      "postfix": "可用",
      "postfixFontSize": "70%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": true,
        "lineColor": "rgb(85, 136, 251)",
        "show": false,
        "ymax": null,
        "ymin": null
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "node_memory_SwapFree_bytes{instance=\"$node\",job=\"$job\"}",
          "hide": false,
          "legendFormat": "总量",
          "refId": "A"
        },
        {
          "expr": "(node_memory_SwapFree_bytes{instance=\"$node\",job=\"$job\"} / node_memory_SwapTotal_bytes{instance=\"$node\",job=\"$job\"})*100",
          "hide": true,
          "legendFormat": "可用",
          "refId": "B"
        }
      ],
      "thresholds": "10，25",
      "timeFrom": null,
      "timeShift": null,
      "title": "$node 交换分区",
      "transparent": true,
      "type": "singlestat",
      "valueFontSize": "70%",
      "valueMaps": [],
      "valueName": "current"
    },
    {
      "aliasColors": {},
      "bars": false,
      "cacheTimeout": null,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "description": "",
      "fill": 8,
      "fillGradient": 2,
      "gridPos": {
        "h": 5,
        "w": 8,
        "x": 8,
        "y": 11
      },
      "hiddenSeries": false,
      "id": 25,
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": true,
        "max": false,
        "min": false,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null as zero",
      "options": {
        "dataLinks": []
      },
      "percentage": true,
      "pluginVersion": "6.5.2",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "可用",
          "color": "rgb(113, 85, 251)",
          "stack": false
        },
        {
          "alias": "/.*交换分区可用/",
          "color": "rgb(85, 136, 251)",
          "stack": false,
          "yaxis": 2
        },
        {
          "alias": "已用",
          "color": "rgb(228, 135, 12)",
          "stack": "D"
        },
        {
          "alias": "/.*交换分区已用/",
          "color": "rgb(31, 149, 193)",
          "stack": "B",
          "yaxis": 2
        },
        {
          "alias": "",
          "color": "rgba(41, 236, 101, 0.05)"
        }
      ],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "expr": "node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"}",
          "hide": false,
          "instant": false,
          "legendFormat": "已用",
          "refId": "C"
        },
        {
          "expr": "node_memory_MemFree_bytes {instance=\"$node\",job=\"$job\"}",
          "hide": false,
          "instant": false,
          "legendFormat": "可用",
          "refId": "D"
        },
        {
          "expr": "node_memory_SwapTotal_bytes-node_memory_SwapFree_bytes{instance=\"$node\",job=\"$job\"}",
          "hide": true,
          "legendFormat": "交换分区已用",
          "refId": "A"
        },
        {
          "expr": "node_memory_SwapFree_bytes{instance=\"$node\",job=\"$job\"}",
          "hide": true,
          "legendFormat": "交换分区可用",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "cumulative"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": 2,
          "format": "bytes",
          "label": "",
          "logBase": 1,
          "max": "100",
          "min": "0",
          "show": true
        },
        {
          "format": "bytes",
          "label": null,
          "logBase": 1,
          "max": "100",
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": true,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "cacheTimeout": null,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "description": "",
      "fill": 8,
      "fillGradient": 2,
      "gridPos": {
        "h": 5,
        "w": 8,
        "x": 16,
        "y": 11
      },
      "hiddenSeries": false,
      "id": 26,
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": true,
        "max": false,
        "min": false,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null as zero",
      "options": {
        "dataLinks": []
      },
      "percentage": true,
      "pluginVersion": "6.5.2",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "/.*可用/",
          "color": "rgb(113, 85, 251)"
        },
        {
          "alias": "",
          "color": "rgb(85, 136, 251)",
          "fill": 0
        },
        {
          "alias": "/.*已用/",
          "color": "rgb(228, 135, 12)",
          "fill": 0
        },
        {
          "alias": "/.*交换分区总量/",
          "color": "rgb(31, 149, 193)",
          "fill": 0
        },
        {
          "alias": "/.*空闲/",
          "color": "rgba(41, 236, 101, 0.05)",
          "fill": 0
        }
      ],
      "spaceLength": 10,
      "stack": true,
      "steppedLine": false,
      "targets": [
        {
          "expr": "node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"}",
          "hide": true,
          "instant": false,
          "legendFormat": "物理内存总量",
          "refId": "C"
        },
        {
          "expr": "node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"}",
          "hide": true,
          "instant": false,
          "legendFormat": "物理内存可用",
          "refId": "D"
        },
        {
          "expr": "node_memory_SwapTotal_bytes-node_memory_SwapFree_bytes{instance=\"$node\",job=\"$job\"}",
          "hide": false,
          "legendFormat": "已用",
          "refId": "A"
        },
        {
          "expr": "node_memory_SwapFree_bytes{instance=\"$node\",job=\"$job\"}",
          "hide": false,
          "legendFormat": "可用",
          "refId": "B"
        },
        {
          "expr": "node_memory_Cached_bytes{instance=\"$node\",job=\"$job\"}",
          "hide": true,
          "legendFormat": "空闲",
          "refId": "E"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "cumulative"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": 2,
          "format": "bytes",
          "label": "",
          "logBase": 1,
          "max": "100",
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": true,
        "alignLevel": null
      }
    },
    {
      "columns": [],
      "datasource": "${DS_PROMETHEUS}",
      "description": "显示各磁盘分区空间使用情况",
      "fontSize": "110%",
      "gridPos": {
        "h": 4,
        "w": 8,
        "x": 0,
        "y": 15
      },
      "id": 23,
      "options": {},
      "pageSize": null,
      "showHeader": true,
      "sort": {
        "col": null,
        "desc": false
      },
      "styles": [
        {
          "alias": "挂载点",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(85, 136, 251, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "mountpoint",
          "preserveFormat": false,
          "sanitize": false,
          "thresholds": [],
          "type": "string",
          "unit": "short"
        },
        {
          "alias": "可用",
          "colorMode": null,
          "colors": [
            "rgba(50, 172, 45, 0.97)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(245, 54, 54, 0.9)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "Value #A",
          "thresholds": [
            ""
          ],
          "type": "number",
          "unit": "bytes"
        },
        {
          "alias": "容量",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "Value #B",
          "thresholds": [],
          "type": "number",
          "unit": "bytes"
        },
        {
          "alias": "节点",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "instance",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        },
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "Time",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        },
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "device",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        },
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "fstype",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        },
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "job",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        },
        {
          "alias": "已用",
          "colorMode": "value",
          "colors": [
            "rgba(85, 136, 251, 0.97)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(245, 54, 54, 0.9)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "Value #C",
          "thresholds": [
            "75",
            "90"
          ],
          "type": "hidden",
          "unit": "percentunit"
        },
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "/.*/",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "expr": " sum by (mountpoint)(node_filesystem_avail_bytes{instance=~'$node',job=~'$job',fstype!~'tmpfs'}-0)",
          "format": "table",
          "instant": true,
          "intervalFactor": 1,
          "refId": "A"
        },
        {
          "expr": "sum by (mountpoint)(node_filesystem_size_bytes{instance=~'$node',job=~'$job',fstype!~'tmpfs'}-0)",
          "format": "table",
          "instant": true,
          "refId": "B"
        },
        {
          "expr": "sum by (mountpoint)(1-(node_filesystem_avail_bytes{instance=~'$node',job=~'$job',fstype!~'tmpfs'} / node_filesystem_size_bytes{instance=~'$node',job=~'$job',fstype!~'tmpfs'}))",
          "format": "table",
          "instant": true,
          "refId": "C"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "$node 存储设备",
      "transform": "table",
      "transparent": true,
      "type": "table"
    },
    {
      "datasource": "${DS_PROMETHEUS}",
      "description": "",
      "gridPos": {
        "h": 3,
        "w": 8,
        "x": 8,
        "y": 16
      },
      "id": 32,
      "interval": "",
      "options": {
        "displayMode": "lcd",
        "fieldOptions": {
          "calcs": [
            "mean"
          ],
          "defaults": {
            "decimals": 1,
            "links": [],
            "mappings": [],
            "max": 1,
            "min": 0,
            "thresholds": [
              {
                "color": "rgb(113, 85, 251)",
                "value": null
              },
              {
                "color": "semi-dark-orange",
                "value": 0.7
              },
              {
                "color": "semi-dark-red",
                "value": 0.8
              }
            ],
            "title": "",
            "unit": "percentunit"
          },
          "override": {},
          "values": false
        },
        "orientation": "horizontal"
      },
      "pluginVersion": "6.5.2",
      "repeatDirection": "h",
      "targets": [
        {
          "expr": "sum by(mountpoint)(1-node_filesystem_avail_bytes{instance='$node',job='$job',fstype!=\"tmpfs\"}/node_filesystem_size_bytes{instance=\"$node\",job=\"$job\"}) ",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "legendFormat": "{{mountpoint}} 已用",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "transparent": true,
      "type": "bargauge"
    }
  ],
  "refresh": "5s",
  "schemaVersion": 21,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(node_uname_info,instance)",
        "hide": 0,
        "includeAll": false,
        "label": "节点",
        "multi": false,
        "name": "node",
        "options": [],
        "query": "label_values(node_uname_info,instance)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(node_uname_info,job)",
        "hide": 0,
        "includeAll": false,
        "label": "任务",
        "multi": false,
        "name": "job",
        "options": [],
        "query": "label_values(node_uname_info,job)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-1h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "linux主机运行状态监控(node_exporter)",
  "uid": "krFlCT-Wz",
  "version": 34,
  "description": "目的是尽量在一个页面显示节点主机的系统概况，包括CPU、内存(memeory)、交换分区(swap)、分区(filesystem)，上传下载速度(network transmission)"
}