summaryrefslogtreecommitdiffstats
path: root/modules/tozt/files/kapacitor/cpu.tick
diff options
context:
space:
mode:
Diffstat (limited to 'modules/tozt/files/kapacitor/cpu.tick')
-rw-r--r--modules/tozt/files/kapacitor/cpu.tick32
1 files changed, 0 insertions, 32 deletions
diff --git a/modules/tozt/files/kapacitor/cpu.tick b/modules/tozt/files/kapacitor/cpu.tick
deleted file mode 100644
index cc7eb14..0000000
--- a/modules/tozt/files/kapacitor/cpu.tick
+++ /dev/null
@@ -1,32 +0,0 @@
-dbrp "telegraf"."autogen"
-
-var message = '''
-{{- if eq .Level "OK" -}}
-{{ index .Tags "host" }} is no longer using excessive CPU
-{{- else -}}
-{{ index .Tags "host" }} is using excessive CPU
-{{- end -}}
-'''
-
-var details = '''
-{{- if eq .Level "OK" -}}
-{{ index .Tags "host" }} is now only using {{ index .Fields "mean" }}% CPU
-{{- else -}}
-{{ index .Tags "host" }} has used an average of {{ index .Fields "mean" }}% CPU for the last 10 minutes
-{{- end -}}
-'''
-
-stream
-|from()
- .measurement('cpu')
- .groupBy('host')
- .where(lambda: "cpu" == 'cpu-total')
-|eval(lambda: 100.0 - "usage_idle")
- .as('usage')
-|window()
- .period(1h)
-|mean('usage')
-|alert()
- .crit(lambda: "mean" > 90)
- .message(message)
- .details(details)