问题
My GCP project vm installed below agents: google_osconfig_agent /opt/stackdriver/collectd/sbin/stackdriver-collectd. Can i use the stackdriver-agent to get some data? eg. run some commands to get all instances storage, uptime etc.
回答1:
The Cloud Monitoring agent gathers metrics from VM instances and sends them to Google Cloud Monitoring. Among many there are metrics for uptime and disk utilization.
Gathered metrics are represented in the customizable Dashboards of the Cloud Console.
If you need to filter and process metrics in a more sophisticated way, you can use the Monitoring API available for C#, Go, Java, Node.js, PHP, Python, Ruby.
来源:https://stackoverflow.com/questions/61335593/get-vm-uptime-data-from-stackdriver-agent-in-gcp