Grafana dashboard: Windows主机列表
Description: 修改自deweiwu，点击ip可以打开关联的windows主机详情(需预先导入)


{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "6.7.3"
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "$$hashKey": "object:13654",
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "修改自deweiwu，点击ip可以打开关联的windows主机详情(需预先导入)",
  "editable": true,
  "gnetId": 12320,
  "graphTooltip": 0,
  "id": null,
  "links": [],
  "panels": [
    {
      "columns": [],
      "datasource": "${DS_PROMETHEUS}",
      "fontSize": "100%",
      "gridPos": {
        "h": 22,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "pageSize": null,
      "showHeader": true,
      "sort": {
        "col": 0,
        "desc": true
      },
      "styles": [
        {
          "$$hashKey": "object:5107",
          "alias": "Time",
          "align": "auto",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "hidden"
        },
        {
          "$$hashKey": "object:5108",
          "alias": "IP",
          "align": "auto",
          "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": 1,
          "link": true,
          "linkTargetBlank": true,
          "linkTooltip": "点击查看详情",
          "linkUrl": "/d/7UlnHoGZz/windowszhu-ji-xiang-qing?var-project=${__cell_5}&var-job=${__cell_2}",
          "mappingType": 2,
          "pattern": "ip",
          "preserveFormat": false,
          "rangeMaps": [],
          "sanitize": false,
          "thresholds": [],
          "type": "string",
          "unit": "forceNm"
        },
        {
          "$$hashKey": "object:5109",
          "alias": "CPU使用率",
          "align": "auto",
          "colorMode": "cell",
          "colors": [
            "#1F60C4",
            "#8F3BB8",
            "#FA6400"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 0,
          "mappingType": 1,
          "pattern": "Value #E",
          "thresholds": [
            "50",
            "78"
          ],
          "type": "number",
          "unit": "percent"
        },
        {
          "$$hashKey": "object:5110",
          "alias": "CPU核数",
          "align": "auto",
          "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": 0,
          "mappingType": 1,
          "pattern": "Value #A",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "$$hashKey": "object:5111",
          "alias": "系统运行时间",
          "align": "auto",
          "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": 1,
          "mappingType": 1,
          "pattern": "Value #D",
          "thresholds": [],
          "type": "number",
          "unit": "s"
        },
        {
          "$$hashKey": "object:5112",
          "alias": "内存使用率",
          "align": "auto",
          "colorMode": "cell",
          "colors": [
            "#1F60C4",
            "#8F3BB8",
            "#FA6400"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 0,
          "mappingType": 1,
          "pattern": "Value #B",
          "thresholds": [
            "50",
            "78"
          ],
          "type": "number",
          "unit": "percent"
        },
        {
          "$$hashKey": "object:5113",
          "alias": "磁盘大小",
          "align": "auto",
          "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 #F",
          "thresholds": [],
          "type": "number",
          "unit": "bits"
        },
        {
          "$$hashKey": "object:5114",
          "alias": "磁盘使用率",
          "align": "auto",
          "colorMode": "cell",
          "colors": [
            "#1F60C4",
            "#8F3BB8",
            "#FA6400"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "Value #G",
          "thresholds": [
            "50",
            "78"
          ],
          "type": "number",
          "unit": "percent"
        },
        {
          "$$hashKey": "object:5115",
          "alias": "网络下载（s）",
          "align": "auto",
          "colorMode": "cell",
          "colors": [
            "#1F60C4",
            "#8F3BB8",
            "#FA6400"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "Value #H",
          "thresholds": [
            "50000000",
            "800000000"
          ],
          "type": "number",
          "unit": "bps"
        },
        {
          "$$hashKey": "object:5116",
          "alias": "网络上传（s）",
          "align": "auto",
          "colorMode": "cell",
          "colors": [
            "#1F60C4",
            "#8F3BB8",
            "#FA6400"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "Value #I",
          "thresholds": [
            "50000000",
            "800000000"
          ],
          "type": "number",
          "unit": "bps"
        },
        {
          "$$hashKey": "object:5117",
          "alias": "内存总量",
          "align": "auto",
          "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 #C",
          "thresholds": [],
          "type": "number",
          "unit": "decbits"
        },
        {
          "$$hashKey": "object:5118",
          "alias": "",
          "align": "auto",
          "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": "__name__",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        },
        {
          "$$hashKey": "object:5119",
          "alias": "",
          "align": "auto",
          "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"
        },
        {
          "$$hashKey": "object:5120",
          "alias": "",
          "align": "auto",
          "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"
        },
        {
          "$$hashKey": "object:5121",
          "alias": "项目",
          "align": "auto",
          "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": "project",
          "thresholds": [],
          "type": "string",
          "unit": "short"
        },
        {
          "$$hashKey": "object:5122",
          "alias": "类别",
          "align": "auto",
          "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": "part",
          "thresholds": [],
          "type": "string",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "datasource": "${DS_PROMETHEUS}",
          "expr": "label_replace((wmi_os_time - wmi_system_system_up_time),\"ip\",\"$1\",\"instance\",\"(.*):.*\")",
          "format": "table",
          "instant": true,
          "refId": "D"
        },
        {
          "datasource": "${DS_PROMETHEUS}",
          "expr": "count(count(wmi_cpu_time_total{mode=\"idle\"}) by (instance,core)) by (instance)",
          "format": "table",
          "instant": true,
          "refId": "A"
        },
        {
          "datasource": "${DS_PROMETHEUS}",
          "expr": "label_replace((wmi_cs_physical_memory_bytes),\"ip\",\"$1\",\"instance\",\"(.*):.*\")",
          "format": "table",
          "instant": true,
          "refId": "C"
        },
        {
          "datasource": "${DS_PROMETHEUS}",
          "expr": "label_replace((sum(wmi_logical_disk_size_bytes{volume!~\"Harddisk.*\"}) by (instance)),\"ip\",\"$1\",\"instance\",\"(.*):.*\")",
          "format": "table",
          "instant": true,
          "refId": "F"
        },
        {
          "datasource": "${DS_PROMETHEUS}",
          "expr": "label_replace((100 - (avg by (instance) (irate(wmi_cpu_time_total{mode=\"idle\"}[1m])) * 100)),\"ip\",\"$1\",\"instance\",\"(.*):.*\")",
          "format": "table",
          "instant": true,
          "refId": "E"
        },
        {
          "datasource": "${DS_PROMETHEUS}",
          "expr": "label_replace(((wmi_cs_physical_memory_bytes - wmi_os_physical_memory_free_bytes)/wmi_cs_physical_memory_bytes * 100),\"ip\",\"$1\",\"instance\",\"(.*):.*\")",
          "format": "table",
          "instant": true,
          "refId": "B"
        },
        {
          "datasource": "${DS_PROMETHEUS}",
          "expr": "label_replace(((sum(wmi_logical_disk_size_bytes{volume!~\"Harddisk.*\"}) by (instance) - sum(wmi_logical_disk_free_bytes{volume!~\"Harddisk.*\"}) by (instance)) / sum(wmi_logical_disk_size_bytes{volume!~\"Harddisk.*\"}) by (instance) * 100),\"ip\",\"$1\",\"instance\",\"(.*):.*\")",
          "format": "table",
          "instant": true,
          "refId": "G"
        },
        {
          "datasource": "${DS_PROMETHEUS}",
          "expr": "label_replace((sum(irate(wmi_net_bytes_sent_total{nic!~\"MS_TCP_Loopback_interface|isatap*|______*\"}[5m])*8) by (instance)),\"ip\",\"$1\",\"instance\",\"(.*):.*\")",
          "format": "table",
          "instant": true,
          "refId": "H"
        },
        {
          "datasource": "${DS_PROMETHEUS}",
          "expr": "label_replace((sum(irate(wmi_net_bytes_received_total{nic!~\"MS_TCP_Loopback_interface|isatap*|______*\"}[5m])*8) by (instance)),\"ip\",\"$1\",\"instance\",\"(.*):.*\")",
          "format": "table",
          "instant": true,
          "refId": "I"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "",
      "transform": "table",
      "transparent": true,
      "type": "table"
    }
  ],
  "schemaVersion": 22,
  "style": "dark",
  "tags": [
    "wmi_exporter"
  ],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-5m",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ]
  },
  "timezone": "",
  "title": "Windows主机列表",
  "uid": "b4amOyEWz",
  "variables": {
    "list": []
  },
  "version": 30
}