kapacitor
kapacitor copied to clipboard
Ability to read env variables in tick scripts
This may be available already but I couldn't find it documented anywhere on how to do it.
It would be great if there was a way for tick scripts to read env variables. The immediate use case here is for providing a link to a dashboard in an alert message. I would like to be able to pull the dashboard host from a env variable. This way we can deploy the same kapacitor alerts across all our envs
same here, unbelievable if it is not supported as I think this is the basic requirement for any alerting system, zabbix, cacti, nagios can read environment variable very easily.
var message = ' nginx active connections is in {{.Level}}, value is {{ index .Fields "value" }} from $HOST'
I want to send alert with $HOST so that we know where is the alert coming from,
Thanks.
agree this would be useful. @robertchen, as a workaround for your message issue, you should be able to say something like {{ index .Tags "host" }}
in the message for most measurements. See https://docs.influxdata.com/kapacitor/v1.4/tick/syntax/#string-templates