We are using Google Cloud Platform for our solution, and we have hundreds of vm's running in multiple projects, as part of a change in Stackdriver alerting system, Google has requested to upgrade monitoring agent in all the VM's by running :-
sudo apt-get install stackdriver-agent
sudo /opt/stackdriver/stack-config --write-gcm
Is the any script or utility which I use to run the upgrade commands on all VM's at a time rather than ssh into each one and run individually.
Also while running the command "sudo apt-get install stackdriver-agent", asks for a
"API key for use with Stackdriver" - "Stackdriver requires an API key to submit metrics. You can get an API key from https://app.stackdriver.com/settings/"
Is there any way to provide this key as well in the script or utility.
for instance in $(cat my_instances) do file=$(gcloud compute ssh $instance --command '<command to execute>') donewithmy_instancesthe list of instance names (obtained viagcloud compute instances list) - bjorndv