Search code examples
influxdbkapacitor

Group by with Deadman alert


I have dnsmasq running on all my hosts and would like to monitor when it goes down and notify for each host individually. So far I’m not having any luck being able to do this. Any help is appreciated.

var db = 'telegraf'

var rp = 'autogen'

var measurement = 'procstat'

var groupBy = []

var whereFilter = lambda: ("process_name" == 'dnsmasq')

var period = 1m

var name = 'Dnsmasq Deadman'

var idVar = name + ':{{.Group}}'

var message = 'Dnsmasq not responding. {{.Time}} Restarting dnsmasq. {{ index .Tags "host"}}'

var idTag = 'alertID'

var levelTag = 'level'

var messageField = 'message'

var durationField = 'duration'

Solution

  • change your group by variable to var groupBy = ['host']

    AFAIK you need to group by the tags or fields you want to work with in the alerts.