I created an alert through the web interface(Chronograf). The graph shows the intersection. But the alert does not work. How to debug?
Kapacitor 1.4.0 (git: HEAD fcce3ee9e6abcee5595fd61066bfc904edb1e113)
/ # kapacitor list tasks
ID Type Status Executing Databases and Retention Policies
chronograf-v1-708c588f-bf3b-4768-8577-d89ca31d3c1b stream enabled true [“telegraf”.“autogen”]
chronograf-v1-ad53ea27-4a65-4405-b37b-75e587f1ede0 stream enabled true [“telegraf”.“autogen”]
/ # kapacitor show chronograf-v1-708c588f-bf3b-4768-8577-d89ca31d3c1b
ID: chronograf-v1-708c588f-bf3b-4768-8577-d89ca31d3c1b
Error:
Template:
Type: stream
Status: enabled
Executing: true
Created: 22 Feb 18 14:04 UTC
Modified: 26 Feb 18 10:40 UTC
LastEnabled: 26 Feb 18 10:40 UTC
Databases Retention Policies: [“telegraf”.“autogen”]
TICKscript:
var db = ‘telegraf’var rp = ‘autogen’
var measurement = ‘mem’
var groupBy =
var whereFilter = lambda: (“host” == ‘AutomatedTests’)
var name = ‘test’
var idVar = name + ‘:{{.Group}}’
var message = ’ {{.ID}} {{.Name}} {{.TaskName}} {{.Group}} {{.Tags}} {{.Level}} {{ index .Fields “value” }} {{.Time}}’
var idTag = ‘alertID’
var levelTag = ‘level’
var messageField = ‘message’
var durationField = ‘duration’
var outputDB = ‘chronograf’
var outputRP = ‘autogen’
var outputMeasurement = ‘alerts’
var triggerType = ‘threshold’
var crit = 15000000000
var data = stream
|from()
.database(db)
.retentionPolicy(rp)
.measurement(measurement)
.groupBy(groupBy)
.where(whereFilter)
|eval(lambda: “used”)
.as(‘value’)var trigger = data
|alert()
.crit(lambda: “value” > crit)
.stateChangesOnly()
.message(message)
.id(idVar)
.idTag(idTag)
.levelTag(levelTag)
.messageField(messageField)
.durationField(durationField)
.telegram()
.chatId(‘216013926’)
.parseMode(‘mem > 15’)trigger
|eval(lambda: float(“value”))
.as(‘value’)
.keep()
|influxDBOut()
.create()
.database(outputDB)
.retentionPolicy(outputRP)
.measurement(outputMeasurement)
.tag(‘alertName’, name)
.tag(‘triggerType’, triggerType)trigger
|httpOut(‘output’)DOT:
digraph chronograf-v1-708c588f-bf3b-4768-8577-d89ca31d3c1b {
graph [throughput=“0.00 points/s”];stream0 [avg_exec_time_ns=“0s” errors=“0” working_cardinality=“0” ];
stream0 → from1 [processed=“0”];from1 [avg_exec_time_ns=“0s” errors=“0” working_cardinality=“0” ];
from1 → eval2 [processed=“0”];eval2 [avg_exec_time_ns=“0s” errors=“0” working_cardinality=“0” ];
eval2 → alert3 [processed=“0”];alert3 [alerts_triggered=“0” avg_exec_time_ns=“0s” crits_triggered=“0” errors=“0” infos_triggered=“0” oks_triggered=“0” warns_triggered=“0” working_cardinality=“0” ];
alert3 → http_out6 [processed=“0”];
alert3 → eval4 [processed=“0”];http_out6 [avg_exec_time_ns=“0s” errors=“0” working_cardinality=“0” ];
eval4 [avg_exec_time_ns=“0s” errors=“0” working_cardinality=“0” ];
eval4 → influxdb_out5 [processed=“0”];influxdb_out5 [avg_exec_time_ns=“0s” errors=“0” points_written=“0” working_cardinality=“0” write_errors=“0” ];
}
/ #