- 授权协议: MIT
- 开发语言: Google Go
- 操作系统: 跨平台
- 软件首页: https://github.com/influxdata/kapacitor
- 软件文档: https://docs.influxdata.com/kapacitor/v0.10/
软件介绍
stream
.from().measurement('cpu_usage_idle')
.groupBy('host')
.window()
.period(1m)
.every(1m)
.mapReduce(influxql.mean('value'))
.eval(lambda: 100.0 - "mean")
.as('used')
.alert()
.message('{{ .Level}}: {{ .Name }}/{{ index .Tags "host" }} has high cpu usage: {{ index .Fields "used" }}')
.warn(lambda: "used" > 70.0)
.crit(lambda: "used" > 85.0)
// Send alert to hander of choice.
// Slack
.slack()
.channel('#alerts')
// VictorOps
.victorOps()
.routingKey('team_rocket')
// PagerDuty
.pagerDuty()执行方法:
# Define the task (assumes cpu data is in db 'telegraf')kapacitor define \ -name cpu_alert \ -type stream \ -dbrp telegraf.default \ -tick ./cpu_alert.tick# Start the taskkapacitor enable cpu_alert
