简体   繁体   中英

Google Cloud Platform: “Update Google Stackdriver monitoring agent”

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.

When using --write-gcm , the API key is no longer needed, so you can just leave it blank in the install script. You're seeing a bit of legacy code shining through -- apologies for the confusion.

As far as upgrading multiple VMs at once, Google doesn't provide a ready solution, but you can use one of the popular configuration management tools (eg, Puppet, Chef, Salt, Ansible) to script such an upgrade. There are (somewhat stale) solutions for Puppet, Chef, and Ansible available that you can try to adapt for your use case.

您也可以使用mussh对多个ssh主机并行执行命令。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM