I'm trying to add the ability to put hosts into a "maintenance mode" which will 
prevent kapacitor from sending out alerts. In order to do this, I've created a 
"maintlock" measurement, which tracks a counter on the host. When the "count" 
field in this measurement is 0, kapacitor is free to send an alert.
I have this mostly working, except only when a tick script stream has a single 
alert() method. As soon as it has a second alert() method, the "count" field 
appears to get zeroed out.

For example, this is my kapacitor tick script:

        var maintlock = stream|from().measurement('maintlock').groupBy('host')
        var data = stream
                |from()
                        .measurement('disk').groupBy('host','path')
                |join(maintlock)
                        .as('disk','maintlock')
                        .on('host')
                        .fill('null')
                        .tolerance(24h)
                |log()
                |where(lambda: "maintlock.count" == 0)
        data
                |alert()
                        .crit(lambda: "disk.used_percent" >= 90)
        data
                |alert()
                        .warn(lambda: "disk.used_percent" >= 80 AND 
"disk.used_percent" < 90)

This is a few lines of the output from the log() method:

        Jul 25 12:39:44 fll2aixd01stg kapacitord[6421]: [disk_free:log5] 
2016/07/25 12:39:44 I!  {disk   host=fll2aixd01stg,path=/var/lib/influxdb, 
[host path] map[host:fll2aixd01stg path:/var/lib/influxdb] 
map[disk.inodes_total:13418496 disk.free:13152272384 disk.used:577781760 
disk.used_percent:4.208153543607759 maintlock.count:0 disk.inodes_free:13418409 
disk.inodes_used:87 disk.total:13730054144] 2016-07-26 00:00:00 +0000 UTC}
        Jul 25 12:39:44 fll2aixd01stg kapacitord[6421]: [disk_free:log5] 
2016/07/25 12:39:44 I!  {disk   host=fll2aixd01stg,path=/var/lib/influxdb, 
[host path] map[host:fll2aixd01stg path:/var/lib/influxdb] 
map[disk.free:13152272384 disk.inodes_free:13418409 disk.inodes_total:13418496 
disk.total:13730054144 maintlock.count:1 disk.used_percent:4.208153543607759 
disk.inodes_used:87 disk.used:577781760] 2016-07-26 00:00:00 +0000 UTC}
        Jul 25 12:39:44 fll2aixd01stg kapacitord[6421]: [disk_free:log5] 
2016/07/25 12:39:44 I!  {disk   host=fll2aixd01stg,path=/tmp/mnt, [host path] 
map[host:fll2aixd01stg path:/tmp/mnt] map[disk.inodes_total:743386 
disk.inodes_used:2 disk.total:10485760 disk.used:9437184 disk.used_percent:90 
maintlock.count:0 disk.free:1048576 disk.inodes_free:743384] 2016-07-26 
00:00:00 +0000 UTC}
        Jul 25 12:39:44 fll2aixd01stg kapacitord[6421]: [disk_free:log5] 
2016/07/25 12:39:44 I!  {disk   host=fll2aixd01stg,path=/tmp/mnt, [host path] 
map[host:fll2aixd01stg path:/tmp/mnt] map[disk.inodes_used:2 
disk.total:10485760 disk.inodes_free:743384 disk.used:9437184 maintlock.count:1 
disk.inodes_total:743386 disk.used_percent:90 disk.free:1048576] 2016-07-26 
00:00:00 +0000 UTC}

Notice how each entry is logged twice. One of the times `maintlock.count:1`, 
and the other time `maintlock.count:0`. If I remove one of the `alert()` 
methods, it behaves fine, properly tracking the value of `maintlock.count`. 
It's only when I add the second `alert()` that the `maintlock.count:0` starts 
showing up.

Any ideas why?

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/2d0ab196-8e95-4c7a-b444-ab2ba241c74a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to