diff --git a/scripts/clmc-service/install-tick-stack.sh b/scripts/clmc-service/install-tick-stack.sh index d2f639d68218b22e69d9c6bea6b9503770ed1706..74de3854ca772e1aef7c9b028ad62a8e4fcc387d 100755 --- a/scripts/clmc-service/install-tick-stack.sh +++ b/scripts/clmc-service/install-tick-stack.sh @@ -49,3 +49,19 @@ systemctl start influxdb systemctl start kapacitor systemctl start chronograf +# wait for kapacitor to start +while ! nc -z localhost 9092 +do + echo "Waiting for kapacitor port 9092 to be ready on localhost..." + sleep 1 +done + +# define the TICK script templates within Kapacitor +echo "----> Creating alert templates in Kapacitor" +cd ${REPO_ROOT}/src/service/clmcservice/resources/TICKscript +for template_file in *.tick; do + template_id=$(basename ${template_file} .tick) + echo ${template_id} ${template_file} + kapacitor define-template ${template_id} -tick ${template_file} +done +