exec feature from Kapacitor
// Execute a command whenever an alert is triggered and pass the alert data over STDIN in JSON format. // tick:property func (n *AlertNodeData) Exec(executable string, args ...string) *ExecHandler { exec := &ExecHandler{ AlertNodeData: n, Command: append([]string{executable}, args...), } n.ExecHandlers = append(n.ExecHandlers, exec) return exec }
This has been extremely critical in our use of Kapacitor and remains a unique advantage for the TICK stack. I would hope that the Tasks in flux that run queries for alerts, can still call arbitrary path and executable along with passing results of the query. For example, query returns hostname of hosts not responding, pass the host name to my exec argument to run my third party cli tool that can restart that host. From my understanding UDF will still be available in Flux, but this path exec call expands the use cases to the point that without it, I would consider my alternatives long term as it would take too much effort to maintain all the features I use it for in separate UDFs.
@jordo1138 Thank you for the request. I expect that we will have an equivalent function in Flux. We are still in the process of porting over many of Kapacitor's features. We will keep this one in mind.
@nathanielc sounds great. Looking forward to seeing how else we'll use flux.