Process not starting Alert

Dear All,

Got multiple issue with deadman.

  1. Alert is not trigger for application not started using below code, below will work if application is started already and stop.
    But point is to detect application which fail to start as well not only running application which stop only
    .
    var groupBy = [‘host’, ‘pattern’, ‘process_name’]

var whereFilter = lambda: (“host” == ‘hostA’) AND
(“pattern” == ‘instanceA’) AND
(“process_name” == ProcessA’))

var data = stream
|from()
.database(db)
.retentionPolicy(rp)
.measurement(measurement)
.groupBy(groupBy)
.where(whereFilter)
|eval(lambda: “pid”)
.as(‘value’)
|window()
.period(1m)
.every(1m)
|deadman(0.0, 1m)
.stateChangesOnly()
.noRecoveries()
.id(’ {{ index .Tags “host” }} - {{ index .Tags “pattern” }} {{ index .Tags “process_name” }} - Process’)
.message(’{{ .ID }} is DOWN’)

I was able to trigger alert only using hardcode for each param. as below but this not sustainable x host x instance x process

var groupBy = [‘host’, ‘pattern’, ‘process_name’]

// GMT - SUN 17:30 - FRI 23:35
var whereFilter = lambda: (“host” == ‘hostA’) AND
(“pattern” == ‘instanceA’) AND
(“process_name” == ProcessA’) )

2.Deadman trigger wrong alert for process running but flag as down.