Grafana-zabbix数据源之主机组监控聚合图

效果图


参数设置

https://grafana.com/grafana/dashboards/5456-zabbix-servers-status-table/
注意:variables Group自己配置的不知道为啥不好使,从模版导入的可以!
Grafana-zabbix数据源之主机组监控聚合图_第1张图片
Grafana-zabbix数据源之主机组监控聚合图_第2张图片

json

{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "An easy way to view the performance of your servers",
  "editable": true,
  "gnetId": 5456,
  "graphTooltip": 0,
  "id": 589,
  "iteration": 1664506649540,
  "links": [],
  "panels": [
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": null,
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "fill": 0,
      "fillGradient": 0,
      "gridPos": {
        "h": 18,
        "w": 18,
        "x": 0,
        "y": 0
      },
      "hiddenSeries": false,
      "id": 13,
      "legend": {
        "avg": true,
        "current": false,
        "hideZero": false,
        "max": true,
        "min": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "7.5.10",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "application": {
            "filter": "Memory"
          },
          "functions": [
            {
              "$$hashKey": "object:2242",
              "def": {
                "category": "Alias",
                "defaultParams": [
                  "/(.*)/",
                  "$1"
                ],
                "name": "replaceAlias",
                "params": [
                  {
                    "name": "regexp",
                    "type": "string"
                  },
                  {
                    "name": "newAlias",
                    "type": "string"
                  }
                ]
              },
              "params": [
                "/: Memory used percent/",
                "$'"
              ],
              "text": "replaceAlias(/: Memory used percent/, $')"
            }
          ],
          "group": {
            "filter": "$Group"
          },
          "host": {
            "filter": "$Hosts"
          },
          "item": {
            "filter": "Memory used percent"
          },
          "options": {
            "showDisabledItems": false,
            "skipEmptyValues": false
          },
          "proxy": {
            "filter": ""
          },
          "queryType": 0,
          "refId": "A",
          "resultFormat": "time_series",
          "table": {
            "skipEmptyValues": false
          },
          "tags": {
            "filter": ""
          },
          "trigger": {
            "filter": ""
          },
          "triggers": {
            "acknowledged": 2,
            "count": true,
            "minSeverity": 3
          }
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Memory used 趋势图 %",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:1965",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "$$hashKey": "object:1966",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "datasource": "OurZabbix",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": null,
            "displayMode": "color-background",
            "filterable": false
          },
          "decimals": 0,
          "mappings": [],
          "thresholds": {
            "mode": "percentage",
            "steps": [
              {
                "color": "rgba(50, 172, 45, 0.97)",
                "value": null
              },
              {
                "color": "rgba(237, 129, 40, 0.89)",
                "value": 70
              },
              {
                "color": "rgba(245, 54, 54, 0.9)",
                "value": 90
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Field"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": null
              },
              {
                "id": "color",
                "value": {
                  "fixedColor": "rgba(1, 6, 13, 0.3)",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Last"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 60
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 18,
        "w": 6,
        "x": 18,
        "y": 0
      },
      "id": 1,
      "links": [],
      "options": {
        "showHeader": false,
        "sortBy": [
          {
            "desc": true,
            "displayName": "Last"
          }
        ]
      },
      "pluginVersion": "7.5.10",
      "targets": [
        {
          "application": {
            "filter": "Memory"
          },
          "functions": [
            {
              "$$hashKey": "object:2168",
              "def": {
                "category": "Alias",
                "defaultParams": [
                  "/(.*)/",
                  "$1"
                ],
                "name": "replaceAlias",
                "params": [
                  {
                    "name": "regexp",
                    "type": "string"
                  },
                  {
                    "name": "newAlias",
                    "type": "string"
                  }
                ]
              },
              "params": [
                "/: Memory used percent/",
                "$'"
              ],
              "text": "replaceAlias(/: Memory used percent/, $')"
            }
          ],
          "group": {
            "filter": "$Group"
          },
          "host": {
            "filter": "$Hosts"
          },
          "item": {
            "filter": "Memory used percent"
          },
          "options": {
            "disableDataAlignment": false,
            "showDisabledItems": false,
            "skipEmptyValues": false,
            "useZabbixValueMapping": false
          },
          "proxy": {
            "filter": ""
          },
          "queryType": 0,
          "refId": "A",
          "resultFormat": "time_series",
          "table": {
            "skipEmptyValues": false
          },
          "tags": {
            "filter": ""
          },
          "trigger": {
            "filter": ""
          },
          "triggers": {
            "acknowledged": 2,
            "count": true,
            "minSeverity": 3
          }
        }
      ],
      "title": "Memory Used %",
      "transformations": [
        {
          "id": "reduce",
          "options": {
            "includeTimeField": false,
            "reducers": [
              "last"
            ]
          }
        }
      ],
      "type": "table"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": null,
      "fieldConfig": {
        "defaults": {
          "unit": "short"
        },
        "overrides": []
      },
      "fill": 0,
      "fillGradient": 0,
      "gridPos": {
        "h": 18,
        "w": 18,
        "x": 0,
        "y": 18
      },
      "hiddenSeries": false,
      "id": 14,
      "legend": {
        "avg": true,
        "current": false,
        "max": true,
        "min": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "7.5.10",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "application": {
            "filter": "Memory"
          },
          "functions": [
            {
              "$$hashKey": "object:2363",
              "def": {
                "category": "Alias",
                "defaultParams": [
                  "/(.*)/",
                  "$1"
                ],
                "name": "replaceAlias",
                "params": [
                  {
                    "name": "regexp",
                    "type": "string"
                  },
                  {
                    "name": "newAlias",
                    "type": "string"
                  }
                ]
              },
              "params": [
                "/: Available memory percent/",
                "$'"
              ],
              "text": "replaceAlias(/: Available memory percent/, $')"
            }
          ],
          "group": {
            "filter": "$Group"
          },
          "host": {
            "filter": "$Hosts"
          },
          "item": {
            "filter": "Available memory percent"
          },
          "options": {
            "showDisabledItems": false,
            "skipEmptyValues": false
          },
          "proxy": {
            "filter": ""
          },
          "queryType": 0,
          "refId": "A",
          "resultFormat": "time_series",
          "table": {
            "skipEmptyValues": false
          },
          "tags": {
            "filter": ""
          },
          "trigger": {
            "filter": ""
          },
          "triggers": {
            "acknowledged": 2,
            "count": true,
            "minSeverity": 3
          }
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Memory Available 趋势图 %",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:2079",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "$$hashKey": "object:2080",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "datasource": "OurZabbix",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": null,
            "displayMode": "color-background",
            "filterable": false
          },
          "decimals": 0,
          "mappings": [],
          "thresholds": {
            "mode": "percentage",
            "steps": [
              {
                "color": "rgba(50, 172, 45, 0.97)",
                "value": null
              },
              {
                "color": "rgba(237, 129, 40, 0.89)",
                "value": 70
              },
              {
                "color": "rgba(245, 54, 54, 0.9)",
                "value": 90
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Field"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": null
              },
              {
                "id": "color",
                "value": {
                  "fixedColor": "rgba(1, 6, 13, 0.3)",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Last"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 60
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 18,
        "w": 6,
        "x": 18,
        "y": 18
      },
      "id": 15,
      "links": [],
      "options": {
        "showHeader": false,
        "sortBy": [
          {
            "desc": true,
            "displayName": "Last"
          }
        ]
      },
      "pluginVersion": "7.5.10",
      "targets": [
        {
          "application": {
            "filter": "Memory"
          },
          "functions": [
            {
              "$$hashKey": "object:436",
              "def": {
                "category": "Alias",
                "defaultParams": [
                  "/(.*)/",
                  "$1"
                ],
                "name": "replaceAlias",
                "params": [
                  {
                    "name": "regexp",
                    "type": "string"
                  },
                  {
                    "name": "newAlias",
                    "type": "string"
                  }
                ]
              },
              "params": [
                "/: Available memory percent/",
                "$'"
              ],
              "text": "replaceAlias(/: Available memory percent/, $')"
            }
          ],
          "group": {
            "filter": "$Group"
          },
          "host": {
            "filter": "$Hosts"
          },
          "item": {
            "filter": "Available memory percent"
          },
          "options": {
            "disableDataAlignment": false,
            "showDisabledItems": false,
            "skipEmptyValues": false,
            "useZabbixValueMapping": false
          },
          "proxy": {
            "filter": ""
          },
          "queryType": 0,
          "refId": "A",
          "resultFormat": "time_series",
          "table": {
            "skipEmptyValues": false
          },
          "tags": {
            "filter": ""
          },
          "trigger": {
            "filter": ""
          },
          "triggers": {
            "acknowledged": 2,
            "count": true,
            "minSeverity": 3
          }
        }
      ],
      "title": "Memory Available %",
      "transformations": [
        {
          "id": "reduce",
          "options": {
            "includeTimeField": false,
            "reducers": [
              "last"
            ]
          }
        }
      ],
      "type": "table"
    }
  ],
  "refresh": "5m",
  "schemaVersion": 27,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {
          "selected": false,
          "text": "国内-生产-K8S",
          "value": "国内-生产-K8S"
        },
        "datasource": "OurZabbix",
        "definition": "",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "Group",
        "options": [],
        "query": "*",
        "refresh": 1,
        "regex": "/K8S$/",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {
          "selected": false,
          "text": "All",
          "value": "$__all"
        },
        "datasource": "OurZabbix",
        "definition": "",
        "description": null,
        "error": null,
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": false,
        "name": "Hosts",
        "options": [],
        "query": "$Group.*",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "k8s集群容量监控-内存使用率",
  "uid": "8lhgYN4Vz",
  "version": 4
}

你可能感兴趣的:(自动化运维,grafana,zabbix,python)