We are tiying to define an alert flow based on measurements taken by 
telegraf and stored in influx. 

Started with the basic: 

var stats = stream
        | from()
                .database('monitoring')
                .measurement('cpu')
                .where (lambda: "cpu" == 'cpu-total')
        | groupBy ('project','roles','stage')
        | alert()...


This will alert for all hosts that are gathering metrics... is there a way 
to "refine" the filter stream in the alert node and apply different 
thresholds or must I define different streams?

We need also

 * register any evaluated state in influx or log
 * send to slack any state change
 * send to mail any CRITICAL / OK state change from any alerts  tagged 
"production"

For the first two tried to do something like 


      ...  | alert()
                .id('....')
                .warn(lambda: "usage_idle" < 40)


stats | influxDBOut()
            .database('alerts')
            .retentionPolicy('default')
            .measurement('errors')
            // some tags


stats.slack()

        .channel('#kapacitor')
        .stateChangesOnly(30m)
        .message('{{ .ID }} is {{ .Level}} ({{ index .Fields "usage_idle"}})
        


It's valid but only state changes get pumped in influxdb, and I expected to 
have any "OK" evaluatuon there. Must I define two separate | alert nodes to 
have disctint behaviour?

Whe also tried to add 

stats.crit(lambda: "usage_idle" < 20)
        .email()


(whe have no idea how to filter "production ones" there) but also we get 
the same result ¿This will be another | alert node perhaps with its own | 
from node? 

Thanks!. I'm just starting with tickscript (two days so far)

-- 
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 influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
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/36ae5d12-488f-4132-adcd-bb0ab6dfe5ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to