Skip to content

Instantly share code, notes, and snippets.

@russorat
Last active August 18, 2020 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save russorat/cf4b8fd876463c0ec50c074490c95f09 to your computer and use it in GitHub Desktop.
Save russorat/cf4b8fd876463c0ec50c074490c95f09 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Setting up local instance..."
influx setup -f -b telegraf -o influxdata -u admin -p something
echo "Initializing our stack..."
MONITORING_STACK_ID=$(influx stacks init -n monitoring --json | jq -r '.ID')
# Setting the base path
BASE_PATH="$(pwd)"
echo "Applying our stack..."
cat $BASE_PATH/monitoring/*.yml | \
influx apply --force true --stack-id $MONITORING_STACK_ID -q
# Check the last response to see if everything is ok
if [ $? -eq 0 ]; then
echo "Everything was set up successfully!"
else
echo "There was a problem applying the stack."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment