kapacitor icon indicating copy to clipboard operation
kapacitor copied to clipboard

Alert rule with retention policy doesn't trigger

Open 12nick12 opened this issue 3 years ago • 5 comments

Steps to reproduce: List the minimal actions needed to reproduce the behavior.

  1. Add alert rule with retention policy
  2. Rule is never triggered

Expected behavior: I expect the rule to trigger an alert

Actual behavior: An alert does not get triggered

Environment info: RHEL 7 Chronograf 1.8.10-1 InfluxDB: 1.8.4

12nick12 avatar Jun 07 '21 15:06 12nick12

Can you please share the TICKscript of your alert rule? Do you have other alert rules / tickscripts that work fine?

sranka avatar Jun 08 '21 09:06 sranka

I used the alert rule builder and so far none of them seem to work on this system. I see devices under the

image

var db = 'servers' var rp = '90days' var measurement = 'disk' var groupBy = [] var whereFilter = lambda: isPresent("used_percent") var name = 'Disk Usage' var idVar = name var message = '{{ .ID }} is {{ .Level }} value:{{ index .Fields "value" }}, {{ if not .Recoverable }}non-recoverable{{ end }}' var idTag = 'alertID' var levelTag = 'level' var messageField = 'message' var durationField = 'duration' var outputDB = 'chronograf' var outputRP = 'autogen' var outputMeasurement = 'alerts' var triggerType = 'threshold' var details = '{{ .ID }} is {{ .Level }} value:{{ index .Fields "value" }}, {{ if not .Recoverable }}non-recoverable{{ end }}' var crit = 15 var data = stream |from() .database(db) .retentionPolicy(rp) .measurement(measurement) .groupBy(groupBy) .where(whereFilter) |eval(lambda: "used_percent") .as('value') var trigger = data |alert() .crit(lambda: "value" > crit) .message(message) .id(idVar) .idTag(idTag) .levelTag(levelTag) .messageField(messageField) .durationField(durationField) .details(details) .email() .to('[email protected]') trigger |eval(lambda: float("value")) .as('value') .keep() |influxDBOut() .create() .database(outputDB) .retentionPolicy(outputRP) .measurement(outputMeasurement) .tag('alertName', name) .tag('triggerType', triggerType) trigger |httpOut('output')

12nick12 avatar Jun 08 '21 13:06 12nick12

Any more info you'd like from me?

12nick12 avatar Jun 11 '21 14:06 12nick12

Anything else I can try?

12nick12 avatar Jun 22 '21 14:06 12nick12

Any potential reasons you can think of?

12nick12 avatar Jul 08 '21 13:07 12nick12