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 249b404
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions linux_system/linux_system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -430,14 +430,13 @@ 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:
Expand Down Expand Up @@ -465,14 +464,13 @@ 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
Expand All @@ -498,14 +496,13 @@ 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
Expand All @@ -524,14 +521,13 @@ 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
Expand Down Expand Up @@ -559,15 +555,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 == "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
Expand All @@ -594,14 +589,13 @@ 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
Expand All @@ -623,14 +617,13 @@ 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
Expand All @@ -657,14 +650,13 @@ 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
Expand All @@ -690,14 +682,13 @@ 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
Expand All @@ -717,14 +708,13 @@ 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:
Expand Down Expand Up @@ -766,14 +756,13 @@ 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
Expand All @@ -800,14 +789,13 @@ 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
Expand Down

0 comments on commit 249b404

Please sign in to comment.