Kapacitor - Email results of an Exec

Hello, Im very new to TICK, wanted to do basic CPU and MEM usage monitoring,

my aim is to email a general alert (ie, CPU usage at 90%), and I can do this easily w Chronograf + Kapacitor

My question is how to also email an added output from an Exec, for example, I want to also email the Top results as part of 90% CPU usage (top 10 procs that use most CPU),
ie,

.exec(’/usr/bin/top’, ‘-b’, ‘-n’, ‘1’)

how can I write a Tick script that will email results of this Exec? Thanks

Hi ,

this link contains some examples ,
https://docs.influxdata.com/kapacitor/v1.5/event_handlers/exec/

```
stream
  |from()
    .measurement('cpu')
  |alert()
    .crit(lambda: "usage_idle" < 10)
    .exec('/usr/bin/python', 'sound-the-alarm.py')
```

best regards