-
Notifications
You must be signed in to change notification settings - Fork 0
/
anova_alert.tick
43 lines (37 loc) · 1.46 KB
/
anova_alert.tick
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
var setTemp = '145.0'
var probe1 = stream
|from()
.measurement('temperature')
.where(lambda: "unit" == 'AnovaOne' AND "probe" == 'probe_1')
var probe2 = stream
|from()
.measurement('temperature')
.where(lambda: "unit" == 'AnovaOne' AND "probe" == 'probe_2')
probe1
|alert()
.id('Anova Probe 1')
.message(setTemp)
.crit(lambda: "value" < (float(setTemp) - 1.0))
.stateChangesOnly(5m)
.exec('python','/home/kapacitor/.kapacitor/tasks/anova_alert.py',setTemp)
probe1
|alert()
.id('Anova Probe 1')
.message(setTemp)
.crit(lambda: "value" > (float(setTemp) + 1.0))
.stateChangesOnly(5m)
.exec('python','/home/kapacitor/.kapacitor/tasks/anova_alert.py',setTemp)
probe2
|alert()
.id('Anova Probe 2')
.message(setTemp)
.crit(lambda: "value" < (float(setTemp) - 1.0))
.stateChangesOnly(5m)
.exec('python','/home/kapacitor/.kapacitor/tasks/anova_alert.py',setTemp)
probe2
|alert()
.id('Anova Probe 2')
.message(setTemp)
.crit(lambda: "value" > (float(setTemp) + 1.0))
.stateChangesOnly(5m)
.exec('python','/home/kapacitor/.kapacitor/tasks/anova_alert.py',setTemp)