Kapacitor is not processing data and raising alerts to defined endpoint even when data is inserted in the database


#1

kapacitor is not processing data and not raising alerts to the defined endpoint, even when data is constantly coming to the database. The database name contains some numbers. The kapacitor is processing data and generating alerts for other database, which doesn’t have any numbers in them. Don’t think this should matter, but just providing anyway.

[root@nf_analyzer ~]# kapacitor version
Kapacitor 1.3.3 (git: HEAD ce586f35e89e75a1779e2b493caba15d66295a15)

[root@nf_analyzer ~]# influx -version
InfluxDB shell version: 1.5.2

The following contains the tick script and the database it fetches data from:

[root@nf_analyzer ~]# date +%s
1543387346
[root@nf_analyzer ~]# kapacitor show rule1-53650
ID: rule1-53650
Error: **
Template: **
Type: stream
Status: enabled **
Executing: true
Created: 28 Nov 18 01:03 EST
Modified: 28 Nov 18 01:06 EST
LastEnabled: 28 Nov 18 01:06 EST
Databases Retention Policies: [“tnt_1000_statistic”.“autogen”]
TICKscript:
var data = stream
** |from()

** .database(‘tnt_1000_statistic’)

** .retentionPolicy(‘autogen’)

** .measurement(‘HW’)**
** .groupBy()**
** .where(lambda: TRUE)**
** |eval(lambda: “value”)**
** .as(‘value’)**

var trigger = data
** |alert()**
** .crit(lambda: “value” < 0 OR “value” > 0) **
** .message(‘1. statistic HW != 0’)**
** .id(‘rule1’)**
** .idTag(‘alertID’)**
** .levelTag(‘level’)**
** .messageField(‘message’)**
** .durationField(‘duration’)**
** .post(‘http://localhost:3100/api/alert/send’) **

** trigger**
** |eval(lambda: float(“value”))**
** .as(‘value’)**
** .keep()**
** |influxDBOut()**
** .create()**
** .database(‘chronograf’)**
** .retentionPolicy(‘autogen’)**
** .measurement(‘alerts’)**
** .tag(‘alertName’, ‘rule1’)**
** .tag(‘triggerType’, ‘threshold’)**

trigger
** |httpOut(‘output’)**

DOT:
digraph rule1-53650 {
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_c
ardinality=“0” ];
alert3 -> http_out6 [processed=“0”];
alert3 -> eval4 [processed=“0”];

http_out6 [avg_exec_time_ns=“0s” errors=“0” working_cardinality=“0” ];

influxdb_out5 [avg_exec_time_ns=“0s” errors=“0” points_written=“0” working_cardinality=“0” write_errors=“0” ];
}
[root@nf_analyzer ~]# influx
Connected to http://localhost:8086 version 1.5.2
InfluxDB shell version: 1.5.2
> use tnt_1000_statistic
Using database tnt_1000_statistic
> select * from HW where time > now() - 5m;
name: HW
time host type value
---- ---- ---- -----
1543387080071668183 nf_analyzer cpu_usage 15.5
1543387140113970662 nf_analyzer cpu_usage 15.5
1543387200176073058 nf_analyzer cpu_usage 15.5
1543387200191745461 nf_analyzer udp_packet_receive_errors 0
1543387200191845795 nf_analyzer tcp_segments_retransmitted 3
1543387200191927351 nf_analyzer udp_packets_received 859
1543387200192023450 nf_analyzer tcp_segments_received 58796
1543387200192096978 nf_analyzer memory_free 1882099712
1543387200192187532 nf_analyzer memory_usage 5389107200
1543387201183515797 nf_analyzer hard_drive_disk_io 18
1543387260021503480 nf_analyzer cpu_usage 15.49
1543387320151714182 nf_analyzer cpu_usage 15.49

As you can see data is there in database for every minute, yet kapacitor is not able to process them.

Please let me know if you need any more information.

Regards,
Hanish