I'm trying to integrate Kapacitor with our influxdb and collectd setup. However, It doesn't seem to work, and I don't understand why.
Collectd and Influxdb are running correctly, and I think Kapacitor is able to connect to influxdb. In the kapacitor log I see this:
[influxdb] 2016/04/22 09:46:42 I! started UDP listener for collectd_db default
This is the name of the influxdb database where collectd is recording metrics.
I created the following tick-file, and uploaded it to kapacitor and enabled it:
stream
.from().measurement('cpu_value')
.where(lambda: "type" == "percent")
.where(lambda: "type_instance" == "idle")
.alert()
.crit(lambda: "value" < 100)
// Whenever we get an alert write it to a file.
.log('/tmp/alerts.log')
This was just a test script, which hopefully produces some output.
The script is enabled:
Name Type Enabled Executing Databases and Retention Policies
cpu_tick stream true true ["collectd_db"."default"]
However, I don't see any recordings:
[centos@ip-xx-xx-xx-xx tmp]$ kapacitor list recordings
ID Type Size Created
"cpu_value" is a valid measurement in my database.
This is what I get in my error log:
[cpu_alert:stream1] 2016/04/28 13:00:51 E! error while evaluating WHERE expression: name "percent" is undefined. Names in scope: time,value,host,instance,type,type_instance