Skip to content

Instantly share code, notes, and snippets.

@ryanvgates
Created March 11, 2022 15:42
Show Gist options
  • Save ryanvgates/80d3699fcc580bd223cab19536a52f84 to your computer and use it in GitHub Desktop.
Save ryanvgates/80d3699fcc580bd223cab19536a52f84 to your computer and use it in GitHub Desktop.
Update Sensu Config
client_json=/etc/sensu/conf.d/client.json
sudo apt install --assume-yes jq && \
sudo cp $client_json $client_json.backup.$(date +"%Y_%m_%d-%H_%M_%S") && \
contents="$(sudo jq '.client.environment = "new environment"' $client_json)" && \
sudo echo "${contents}" | sudo tee $client_json && \
sudo systemctl restart sensu-client.service && \
sudo systemctl status sensu-client.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment