74 lines
1.9 KiB
YAML
74 lines
1.9 KiB
YAML
|
apiVersion: 0.1.0
|
||
|
kind: Package
|
||
|
meta:
|
||
|
pkgName: pkg_name
|
||
|
pkgVersion: 1
|
||
|
description: pack description
|
||
|
spec:
|
||
|
resources:
|
||
|
- kind: Label
|
||
|
name: label_1
|
||
|
- kind: Check_Threshold
|
||
|
name: check_0
|
||
|
description: desc_0
|
||
|
every: 1m
|
||
|
offset: 15s
|
||
|
query: >
|
||
|
from(bucket: "rucket_1")
|
||
|
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|
||
|
|> filter(fn: (r) => r._measurement == "cpu")
|
||
|
|> filter(fn: (r) => r._field == "usage_idle")
|
||
|
|> aggregateWindow(every: 1m, fn: mean)
|
||
|
|> yield(name: "mean")
|
||
|
status: inactive
|
||
|
statusMessageTemplate: "Check: ${ r._check_name } is: ${ r._level }"
|
||
|
tags:
|
||
|
- key: tag_1
|
||
|
value: val_1
|
||
|
- key: tag_2
|
||
|
value: val_2
|
||
|
thresholds:
|
||
|
- type: greater
|
||
|
level: CRIT
|
||
|
value: 50.0
|
||
|
allValues: true
|
||
|
- type: lesser
|
||
|
level: warn
|
||
|
value: 49.9
|
||
|
- type: inside_range
|
||
|
level: INfO
|
||
|
min: 30.0
|
||
|
max: 45.0
|
||
|
- type: outside_range
|
||
|
level: ok
|
||
|
min: 30.0
|
||
|
max: 35.0
|
||
|
associations:
|
||
|
- kind: Label
|
||
|
name: label_1
|
||
|
- kind: Check_Deadman
|
||
|
name: check_1
|
||
|
description: desc_1
|
||
|
every: 5m
|
||
|
level: cRiT
|
||
|
offset: 10s
|
||
|
query: >
|
||
|
from(bucket: "rucket_1")
|
||
|
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|
||
|
|> filter(fn: (r) => r._measurement == "cpu")
|
||
|
|> filter(fn: (r) => r._field == "usage_idle")
|
||
|
|> aggregateWindow(every: 1m, fn: mean)
|
||
|
|> yield(name: "mean")
|
||
|
reportZero: true
|
||
|
staleTime: 10m
|
||
|
statusMessageTemplate: "Check: ${ r._check_name } is: ${ r._level }"
|
||
|
tags:
|
||
|
- key: tag_1
|
||
|
value: val_1
|
||
|
- key: tag_2
|
||
|
value: val_2
|
||
|
timeSince: 90s
|
||
|
associations:
|
||
|
- kind: Label
|
||
|
name: label_1
|