Skip to content

Commit

Permalink
removed linux system host, changed to telegraf bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
hoorayimhelping committed Sep 11, 2020
1 parent 30bdb4e commit 6b12d35
Showing 1 changed file with 13 additions and 81 deletions.
94 changes: 13 additions & 81 deletions linux_system/linux_system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,10 @@ spec:
language: flux
query: |-
option params = {
bucket: "v.bucket"
bucket: "telegraf"
}
import "influxdata/influxdb/v1"
v1.measurementTagValues(bucket: params.bucket, measurement: "cpu", tag: "host")
params:
- key: bucket
default: "v.bucket"
type: string
type: query
---
apiVersion: influxdata.com/v2alpha1
Expand Down Expand Up @@ -430,20 +426,15 @@ spec:
queries:
- query: |-
option params = {
bucket: "v.bucket"
bucket: "telegraf"
}
from(bucket: params.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "system")
|> filter(fn: (r) => r._field == "uptime")
|> filter(fn: (r) => r.host == v.linux_host)
|> last()
|> map(fn: (r) => ({ _value: float(v: r._value) / 86400.00 }))
params:
- key: bucket
default: "v.bucket"
type: string
suffix: ' days'
width: 3
yPos: 1
Expand All @@ -465,19 +456,14 @@ spec:
queries:
- query: |-
option params = {
bucket: "v.bucket"
bucket: "telegraf"
}
from(bucket: params.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "disk")
|> filter(fn: (r) => r._field == "used_percent")
|> filter(fn: (r) => r.host == v.linux_host)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
params:
- key: bucket
default: "v.bucket"
type: string
width: 3
yPos: 2
- axes:
Expand All @@ -498,19 +484,14 @@ spec:
queries:
- query: |-
option params = {
bucket: "v.bucket"
bucket: "telegraf"
}
from(bucket: params.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "diskio")
|> filter(fn: (r) => r._field == "read_bytes" or r._field == "write_bytes")
|> filter(fn: (r) => r.host == v.linux_host)
|> derivative(unit: v.windowPeriod, nonNegative: false)
params:
- key: bucket
default: "v.bucket"
type: string
width: 3
yPos: 5
- colors:
Expand All @@ -524,19 +505,14 @@ spec:
queries:
- query: |-
option params = {
bucket: "v.bucket"
bucket: "telegraf"
}
from(bucket: params.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "system")
|> filter(fn: (r) => r._field == "n_cpus")
|> filter(fn: (r) => r.host == v.linux_host)
|> last()
params:
- key: bucket
default: "v.bucket"
type: string
suffix: ' cpus'
width: 2
xPos: 3
Expand All @@ -559,20 +535,15 @@ spec:
queries:
- query: |-
option params = {
bucket: "v.bucket"
bucket: "telegraf"
}
from(bucket: params.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "cpu")
|> filter(fn: (r) => r._field == "usage_user" or r._field == "usage_system" or r._field == "usage_idle")
|> filter(fn: (r) => r.cpu == "cpu-total")
|> filter(fn: (r) => r.host == v.linux_host)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
params:
- key: bucket
default: "v.bucket"
type: string
width: 3
xPos: 3
yPos: 2
Expand All @@ -594,19 +565,14 @@ spec:
queries:
- query: |-
option params = {
bucket: "v.bucket"
bucket: "telegraf"
}
from(bucket: params.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "net")
|> filter(fn: (r) => r._field == "bytes_recv" or r._field == "bytes_sent")
|> filter(fn: (r) => r.host == v.linux_host)
|> derivative(unit: v.windowPeriod, nonNegative: false)
params:
- key: bucket
default: "v.bucket"
type: string
width: 3
xCol: _time
xPos: 3
Expand All @@ -623,19 +589,14 @@ spec:
queries:
- query: |-
option params = {
bucket: "v.bucket"
bucket: "telegraf"
}
from(bucket: params.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "system")
|> filter(fn: (r) => r._field == "load1")
|> filter(fn: (r) => r.host == v.linux_host)
|> last()
params:
- key: bucket
default: "v.bucket"
type: string
width: 2
xPos: 5
yPos: 1
Expand All @@ -657,19 +618,14 @@ spec:
queries:
- query: |-
option params = {
bucket: "v.bucket"
bucket: "telegraf"
}
from(bucket: params.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "system")
|> filter(fn: (r) => r._field == "load1" or r._field == "load5" or r._field == "load15")
|> filter(fn: (r) => r.host == v.linux_host)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
params:
- key: bucket
default: "v.bucket"
type: string
width: 3
xPos: 6
yPos: 2
Expand All @@ -690,19 +646,14 @@ spec:
queries:
- query: |-
option params = {
bucket: "v.bucket"
bucket: "telegraf"
}
from(bucket: params.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "processes")
|> filter(fn: (r) => r._field == "running" or r._field == "blocked" or r._field == "idle" or r._field == "unknown")
|> filter(fn: (r) => r.host == v.linux_host)
|> aggregateWindow(every: v.windowPeriod, fn: max)
params:
- key: bucket
default: "v.bucket"
type: string
width: 3
xPos: 6
yPos: 5
Expand All @@ -717,20 +668,15 @@ spec:
queries:
- query: |-
option params = {
bucket: "v.bucket"
bucket: "telegraf"
}
from(bucket: params.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "mem")
|> filter(fn: (r) => r._field == "total")
|> filter(fn: (r) => r.host == v.linux_host)
|> last()
|> map(fn: (r) => ({r with _value: float(v: r._value) / 1024.0 / 1024.0 / 1024.0}))
params:
- key: bucket
default: "v.bucket"
type: string
suffix: ' GB'
width: 2
xPos: 7
Expand Down Expand Up @@ -766,19 +712,14 @@ spec:
queries:
- query: |-
option params = {
bucket: "v.bucket"
bucket: "telegraf"
}
from(bucket: params.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "mem")
|> filter(fn: (r) => r._field == "used_percent")
|> filter(fn: (r) => r.host == v.linux_host)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
params:
- key: bucket
default: "v.bucket"
type: string
suffix: '%'
width: 3
xPos: 9
Expand All @@ -800,23 +741,14 @@ spec:
queries:
- query: |-
option params = {
bucket: "v.bucket"
bucket: "telegraf"
}
from(bucket: params.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "swap")
|> filter(fn: (r) => r._field == "total" or r._field == "used")
|> filter(fn: (r) => r.host == v.linux_host)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
params:
- key: bucket
default: "v.bucket"
type: string
params:
- key: bucket
default: "v.bucket"
type: string
width: 3
xPos: 9
yPos: 5
Expand Down

0 comments on commit 6b12d35

Please sign in to comment.