Kapacitor tasks enabled on service restart


#1

We are currently using the “load” functionality to create our tasks/templates in kapacitor. https://docs.influxdata.com/kapacitor/v1.5/working/template_tasks/. We maintain a cold standby of kapacitor that has the tasks/templates created but disabled. Our alert deployment copies out the files and then restarts kapacitor to force a load. Problem is the act of restarting kapacitor enables the tasks. We can then immediately disable them via the api but this creates race conditions. Is it possible in the task definition to define we want to create the task in a disabled state? Or is it possible to force a load without restarting kapacitor that preserves the task state?


#2

Hi Michael,
maybe you can use this KAPACITOR_OPTS environment variabele ?
.

Environment variables not in configuration file

These variables are not found in the configuration file.

  • KAPACITOR_OPTS : Found in the systemd startup script and used to pass command line options to kapacitord started by systemd

#3

I reviewed that link and then looked at the default configuration file https://github.com/influxdata/kapacitor/blob/master/etc/kapacitor/kapacitor.conf. I don’t see any configuration parameter that lets you set the default state for a task.

Is there an additional list of environment variables that are supported or did I miss something?