Group By with Deadman


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'

var outputDB = 'chronograf'

var outputRP = 'autogen'

var outputMeasurement = 'alerts'

var triggerType = 'deadman'

var threshold = 0.0

var data = stream

var trigger = data
    |deadman(threshold, period)

    |eval(lambda: "emitted")
        .keep('value', messageField, durationField)
        .tag('alertName', name)
        .tag('triggerType', triggerType)


Did you ever figure out a solution for this? I have the same question…


Yes, you should group by host.