Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Stackdriver monitoring agent in Google Container VM images?

I followed this instruction https://cloud.google.com/monitoring/agent/install-agent#linux-install

$ curl -O "https://repo.stackdriver.com/stack-install.sh"
$ sudo bash stack-install.sh --write-gcm
Unidentifiable or unsupported platform.

The content of /etc/os-release.

$ cat /etc/os-release
BUILD_ID=8820.0.0
NAME="Container-VM Image"
GOOGLE_CRASH_ID=Lakitu
VERSION_ID=55
BUG_REPORT_URL=https://crbug.com/new
PRETTY_NAME="Google Container-VM Image"
VERSION=55
GOOGLE_METRICS_PRODUCT_ID=26
HOME_URL="https://cloud.google.com/compute/docs/containers/vm-image/"
ID=gci

https://cloud.google.com/compute/docs/containers/vm-image/faq#what_is_the_software_package_manager_for_container-vm_image

In order to update a particular package, the entire OS image needs to be updated

So, it seems that we must wait till update for a stackdriver agent installed version of image or give it up.

Also this vm image is not my choice. Newly created GKE nodes use Container-VM images by default. So for now I'll try to create nodes via gcloud container node-pools create --image-type

like image 587
hiroshi Avatar asked Oct 05 '16 01:10

hiroshi


People also ask

How do I enable Stackdriver monitoring?

Search for "Monitoring". In the search results, click through to "Stackdriver Monitoring API". If "API enabled" is displayed, then the API is already enabled. If not, then click Enable.

On what virtual machine instances can you install the monitoring agent?

You can install the agent on one or more Compute Engine VMs from the pre-configured Monitoring VM Instances dashboard.


1 Answers

You can enable Stackdriver Monitoring Agent on Container OS VM Instances, just run this command (and restart it) in order to enable the monitoring agent:

gcloud compute instances add-metadata instance-name --metadata=google-monitoring-enabled=true
like image 137
kubii2 Avatar answered Sep 24 '22 23:09

kubii2