Hi,
I created a simple alert in kapacitor, but this alert don’t work.
I don’t find the error logs in kapacitor.
In my test, I created the alert using the chronograf interface.
ID Type Status Executing Databases and Retention Policies
chronograf-v1-7953f726-5e2c-40f5-9490-c9c7e3050775 stream enabled true [“chronograf”.“autogen”]
chronograf-v1-a4b7550a-7290-47fd-a3a0-2f460bfed025 stream enabled true [“telegraf”.“autogen”]
kapacitor show chronograf-v1-7953f726-5e2c-40f5-9490-c9c7e3050775
ID: chronograf-v1-7953f726-5e2c-40f5-9490-c9c7e3050775
Error:
Template:
Type: stream
Status: enabled
Executing: true
Created: 16 Dec 19 17:39 -0200
Modified: 16 Dec 19 17:42 -0200
LastEnabled: 16 Dec 19 17:42 -0200
Databases Retention Policies: [“chronograf”.“autogen”]
TICKscript:
var db = ‘chronograf’var rp = ‘autogen’
var measurement = ‘m5’
var groupBy =
var whereFilter = lambda: TRUE
var name = ‘Untitled Rule’
var idVar = name
var message = ‘TTTTT’
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 = 2000
var data = stream
|from()
.database(db)
.retentionPolicy(rp)
.measurement(measurement)
.groupBy(groupBy)
.where(whereFilter)
|eval(lambda: “value”)
.as(‘value’)var trigger = data
|alert()
.crit(lambda: “value” >= crit)
.message(message)
.id(idVar)
.idTag(idTag)
.levelTag(levelTag)
.messageField(messageField)
.durationField(durationField)
.stateChangesOnly()
.slack()
.workspace(‘T’)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-7953f726-5e2c-40f5-9490-c9c7e3050775 {
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_inhibited=“0” 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” ];
}
I using:
influxd version
InfluxDB v1.7.8 (git: 1.7 ff383cdc0420217e3460dabe17db54f8557d95b6)
kapacitor version
Kapacitor OSS 1.5.3 (git: HEAD e6bc51b8447de450c3f6fc0f6e47b6a0987ce5b6)