Great, that does the job. I have to learn how the reason to nail these behaviours and this helps.
Thanks On Tuesday, 2 August 2016 00:27:54 UTC+2, [email protected] wrote: > > First off thanks for reposting the question here. > > Saying you want to trigger an alert when `used_percent` is above 95% for > more than 5 minutes is the same as saying that the minimum value for the > last 5 min is greater than 95%. > > stream > |from() > .measurement('mem') > .groupBy('host') > |window() > // keep the most recent 5m of data > .period(5m) > // Every minute emit the last 5 minutes of data to check if the > min is greater than 95 > // this could be any value, depending on how often you want to > recheck the window. > .every(1m) > |min('used_percent') > .as('used_percent') > |alert() > .id('{{index .Tags "host" }} memory utilization') > .message('{{ .ID }} is {{ .Level }} value:{{ index .Fields > "used_percent" }}') > .crit(lambda: "used_percent" > 95) > .stateChangesOnly() > .log('/tmp/alerts.log') > > > > Hope that helps. > > On Monday, August 1, 2016 at 11:53:50 AM UTC-6, [email protected] wrote: >> >> What should I add to this definition so that the critical alert gets >> triggered when the 'used_percent' is above 95 % *for more than 5 minutes* >> ? >> >> Thanks! >> >> stream >> |from() >> .measurement('mem') >> .groupBy('host') >> |alert() >> .id('{{index .Tags "host" }} memory utilization') >> .message('{{ .ID }} is {{ .Level }} value:{{ index .Fields >> "used_percent" }}') >> .crit(lambda: "used_percent" > 95) >> .stateChangesOnly() >> .log('/tmp/alerts.log') >> >> -- 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/41781b26-dbd5-449a-802b-be62e523a212%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
