Skip to content

Instantly share code, notes, and snippets.

@markuskont
Created May 4, 2016 13:30
Show Gist options
  • Save markuskont/71b0dff64b4087261c379b71e4897306 to your computer and use it in GitHub Desktop.
Save markuskont/71b0dff64b4087261c379b71e4897306 to your computer and use it in GitHub Desktop.
Babbys first TICK script.
var warn_threshold = 30
var crit_threshold = 10
var data = stream
.from().measurement('cpu')
.where(lambda: "cpu" == 'cpu-total')
.groupBy('host')
// Do normal alerting
data.alert()
.warn(lambda: "usage_idle" < warn_threshold)
.crit(lambda: "usage_idle" < crit_threshold)
// Log alerts
.log('/var/log/kapacitor/alerts.json')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment