exec
Reference for the `exec` action.
exec· action · runnanook doc execfor the same content in your terminal.
Runs a shell command on alert. The cmd option is a template rendered against the alert event before exec; NANOOK_ALERT_* env vars are also exported.
Options
| Option | Type | Default | Description |
|---|---|---|---|
cmd | string | required | shell command template (e.g. notify {{ kind }} {{ rule }}) |
Examples
Run a script on every fire
[]
= "exec"
[]
= "/usr/local/bin/notify.sh {{ kind }} {{ rule }}"
Use the rendered body
[]
= "exec"
[]
= "logger -t nanook \"$NANOOK_ALERT_BODY\""
[[]]
= "cpu.usage > 90%"
= "page"
= "host hot at {{ trigger.val }}%"