1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
| { "title": "Ubuntu 系统监控", "uid": "ubuntu-system-monitor", "tags": ["ubuntu", "system", "telegraf", "production"], "timezone": "browser", "schemaVersion": 36, "version": 0, "refresh": "30s", "panels": [ { "id": 1, "title": "CPU 使用率", "type": "timeseries", "gridPos": {"h": 8, "w": 12, "x": 0, "y": 0}, "targets": [ { "datasource": {"type": "influxdb", "uid": "influxdb-1"}, "query": "from(bucket: \"telegraf\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r._measurement == \"cpu\" and r._field == \"usage_user\" and r.host == \"ubuntu-server\") |> aggregateWindow(every: 1m, fn: mean) |> map(fn: (r) => ({ r with _field: \"用户态使用率\" })) |> yield(name: \"用户态使用率\")", "refId": "A" }, { "datasource": {"type": "influxdb", "uid": "influxdb-1"}, "query": "from(bucket: \"telegraf\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r._measurement == \"cpu\" and r._field == \"usage_system\" and r.host == \"ubuntu-server\") |> aggregateWindow(every: 1m, fn: mean) |> map(fn: (r) => ({ r with _field: \"系统态使用率\" })) |> yield(name: \"系统态使用率\")", "refId": "B" }, { "datasource": {"type": "influxdb", "uid": "influxdb-1"}, "query": "from(bucket: \"telegraf\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r._measurement == \"cpu\" and r._field == \"usage_idle\" and r.host == \"ubuntu-server\") |> aggregateWindow(every: 1m, fn: mean) |> map(fn: (r) => ({ r with _field: \"空闲率\" })) |> yield(name: \"空闲率\")", "refId": "C" }, { "datasource": {"type": "influxdb", "uid": "influxdb-1"}, "query": "from(bucket: \"telegraf\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r._measurement == \"cpu\" and r._field == \"usage_iowait\" and r.host == \"ubuntu-server\") |> aggregateWindow(every: 1m, fn: mean) |> map(fn: (r) => ({ r with _field: \"I/O 等待\" })) |> yield(name: \"I/O 等待\")", "refId": "D" } ], "options": { "legend": {"displayMode": "table", "placement": "bottom", "calcs": ["mean", "max", "last"]}, "tooltip": {"mode": "multi", "sort": "desc"} }, "fieldConfig": { "defaults": { "unit": "percent", "max": 100, "min": 0, "color": {"mode": "palette-classic"}, "custom": {"lineWidth": 2, "fillOpacity": 20, "drawStyle": "line", "lineInterpolation": "smooth"} }, "overrides": [ {"matcher": {"id": "byName", "options": "空闲率"}, "properties": [{"id": "color", "value": {"fixedColor": "green", "mode": "fixed"}}]}, {"matcher": {"id": "byName", "options": "用户态使用率"}, "properties": [{"id": "color", "value": {"fixedColor": "blue", "mode": "fixed"}}]}, {"matcher": {"id": "byName", "options": "系统态使用率"}, "properties": [{"id": "color", "value": {"fixedColor": "red", "mode": "fixed"}}]}, {"matcher": {"id": "byName", "options": "I/O 等待"}, "properties": [{"id": "color", "value": {"fixedColor": "orange", "mode": "fixed"}}]} ] } }, { "id": 2, "title": "内存使用率", "type": "timeseries", "gridPos": {"h": 8, "w": 12, "x": 12, "y": 0}, "targets": [ { "datasource": {"type": "influxdb", "uid": "influxdb-1"}, "query": "from(bucket: \"telegraf\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r._measurement == \"mem\" and r._field == \"used_percent\" and r.host == \"ubuntu-server\") |> aggregateWindow(every: 1m, fn: mean) |> map(fn: (r) => ({ r with _field: \"已用百分比\" })) |> yield(name: \"已用百分比\")", "refId": "A" }, { "datasource": {"type": "influxdb", "uid": "influxdb-1"}, "query": "from(bucket: \"telegraf\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r._measurement == \"mem\" and r._field == \"available\" and r.host == \"ubuntu-server\") |> aggregateWindow(every: 1m, fn: mean) |> map(fn: (r) => ({ r with _field: \"可用内存\" })) |> yield(name: \"可用内存\")", "refId": "B" }, { "datasource": {"type": "influxdb", "uid": "influxdb-1"}, "query": "from(bucket: \"telegraf\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r._measurement == \"mem\" and r._field == \"used\" and r.host == \"ubuntu-server\") |> aggregateWindow(every: 1m, fn: mean) |> map(fn: (r) => ({ r with _field: \"已用内存\" })) |> yield(name: \"已用内存\")", "refId": "C" }, { "datasource": {"type": "influxdb", "uid": "influxdb-1"}, "query": "from(bucket: \"telegraf\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r._measurement == \"mem\" and r._field == \"total\" and r.host == \"ubuntu-server\") |> aggregateWindow(every: 1m, fn: mean) |> map(fn: (r) => ({ r with _field: \"总内存\" })) |> yield(name: \"总内存\")", "refId": "D" } ], "options": { "legend": {"displayMode": "table", "placement": "bottom", "calcs": ["mean", "max", "last"]}, "tooltip": {"mode": "multi"} }, "fieldConfig": { "defaults": { "unit": "percent", "max": 100, "min": 0, "color": {"mode": "palette-classic"}, "custom": {"lineWidth": 2, "fillOpacity": 20, "drawStyle": "line", "lineInterpolation": "smooth"} }, "overrides": [ {"matcher": {"id": "byName", "options": "可用内存"}, "properties": [{"id": "unit", "value": "bytes"}, {"id": "color", "value": {"fixedColor": "green", "mode": "fixed"}}]}, {"matcher": {"id": "byName", "options": "已用内存"}, "properties": [{"id": "unit", "value": "bytes"}, {"id": "color", "value": {"fixedColor": "orange", "mode": "fixed"}}]}, {"matcher": {"id": "byName", "options": "总内存"}, "properties": [{"id": "unit", "value": "bytes"}, {"id": "color", "value": {"fixedColor": "blue", "mode": "fixed"}}]}, {"matcher": {"id": "byName", "options": "已用百分比"}, "properties": [{"id": "color", "value": {"fixedColor": "red", "mode": "fixed"}}]} ] } }, { "id": 3, "title": "磁盘使用率", "type": "timeseries", "gridPos": {"h": 8, "w": 12, "x": 0, "y": 8}, "targets": [ { "datasource": {"type": "influxdb", "uid": "influxdb-1"}, "query": "from(bucket: \"telegraf\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r._measurement == \"disk\" and r._field == \"used_percent\" and r.host == \"ubuntu-server\") |> aggregateWindow(every: 1m, fn: mean) |> map(fn: (r) => ({ r with _field: \"磁盘使用率\" })) |> yield(name: \"磁盘使用率\")", "refId": "A" }, { "datasource": {"type": "influxdb", "uid": "influxdb-1"}, "query": "from(bucket: \"telegraf\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r._measurement == \"disk\" and r._field == \"free\" and r.host == \"ubuntu-server\") |> aggregateWindow(every: 1m, fn: mean) |> map(fn: (r) => ({ r with _field: \"剩余空间\" })) |> yield(name: \"剩余空间\")", "refId": "B" }, { "datasource": {"type": "influxdb", "uid": "influxdb-1"}, "query": "from(bucket: \"telegraf\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r._measurement == \"disk\" and r._field == \"total\" and r.host == \"ubuntu-server\") |> aggregateWindow(every: 1m, fn: mean) |> map(fn: (r) => ({ r with _field: \"总空间\" })) |> yield(name: \"总空间\")", "refId": "C" } ], "options": { "legend": {"displayMode": "table", "placement": "bottom", "calcs": ["mean", "max", "last"]}, "tooltip": {"mode": "multi"} }, "fieldConfig": { "defaults": { "unit": "percent", "max": 100, "min": 0, "color": {"mode": "palette-classic"}, "custom": {"lineWidth": 2, "fillOpacity": 20, "drawStyle": "line", "lineInterpolation": "smooth"} }, "overrides": [ {"matcher": {"id": "byName", "options": "剩余空间"}, "properties": [{"id": "unit", "value": "bytes"}, {"id": "color", "value": {"fixedColor": "green", "mode": "fixed"}}]}, {"matcher": {"id": "byName", "options": "总空间"}, "properties": [{"id": "unit", "value": "bytes"}, {"id": "color", "value": {"fixedColor": "blue", "mode": "fixed"}}]} ] } }, { "id": 4, "title": "网络流量", "type": "timeseries", "gridPos": {"h": 8, "w": 12, "x": 12, "y": 8}, "targets": [ { "datasource": {"type": "influxdb", "uid": "influxdb-1"}, "query": "from(bucket: \"telegraf\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r._measurement == \"net\" and r._field == \"bytes_recv\" and r.host == \"ubuntu-server\") |> aggregateWindow(every: 1m, fn: mean) |> map(fn: (r) => ({ r with _field: \"接收流量\" })) |> yield(name: \"接收流量\")", "refId": "A" }, { "datasource": {"type": "influxdb", "uid": "influxdb-1"}, "query": "from(bucket: \"telegraf\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r._measurement == \"net\" and r._field == \"bytes_sent\" and r.host == \"ubuntu-server\") |> aggregateWindow(every: 1m, fn: mean) |> map(fn: (r) => ({ r with _field: \"发送流量\" })) |> yield(name: \"发送流量\")", "refId": "B" }, { "datasource": {"type": "influxdb", "uid": "influxdb-1"}, "query": "from(bucket: \"telegraf\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r._measurement == \"net\" and r._field == \"packets_recv\" and r.host == \"ubuntu-server\") |> aggregateWindow(every: 1m, fn: mean) |> map(fn: (r) => ({ r with _field: \"接收包数\" })) |> yield(name: \"接收包数\")", "refId": "C" }, { "datasource": {"type": "influxdb", "uid": "influxdb-1"}, "query": "from(bucket: \"telegraf\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r._measurement == \"net\" and r._field == \"packets_sent\" and r.host == \"ubuntu-server\") |> aggregateWindow(every: 1m, fn: mean) |> map(fn: (r) => ({ r with _field: \"发送包数\" })) |> yield(name: \"发送包数\")", "refId": "D" } ], "options": { "legend": {"displayMode": "table", "placement": "bottom", "calcs": ["mean", "max", "last"]}, "tooltip": {"mode": "multi"} }, "fieldConfig": { "defaults": { "unit": "bps", "color": {"mode": "palette-classic"}, "custom": {"lineWidth": 2, "fillOpacity": 20, "drawStyle": "line", "lineInterpolation": "smooth"} }, "overrides": [ {"matcher": {"id": "byName", "options": "接收流量"}, "properties": [{"id": "color", "value": {"fixedColor": "blue", "mode": "fixed"}}]}, {"matcher": {"id": "byName", "options": "发送流量"}, "properties": [{"id": "color", "value": {"fixedColor": "red", "mode": "fixed"}}]}, {"matcher": {"id": "byName", "options": "接收包数"}, "properties": [{"id": "unit", "value": "short"}, {"id": "color", "value": {"fixedColor": "green", "mode": "fixed"}}]}, {"matcher": {"id": "byName", "options": "发送包数"}, "properties": [{"id": "unit", "value": "short"}, {"id": "color", "value": {"fixedColor": "orange", "mode": "fixed"}}]} ] } }, { "id": 5, "title": "CPU 核心数", "type": "stat", "gridPos": {"h": 4, "w": 3, "x": 0, "y": 16}, "targets": [ { "datasource": {"type": "influxdb", "uid": "influxdb-1"}, "query": "from(bucket: \"telegraf\") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r._measurement == \"cpu\" and r._field == \"usage_user\" and r.host == \"ubuntu-server\") |> last
|