Search code examples
google-cloud-platformstackdrivergoogle-compute-engine

Stackdriver: monitor free disk space


How can I monitor free disk space in a GCE instance?

I already installed Stackdriver Monitoring and Logging agents according to the Stackdriver documentation.

curl -O https://repo.stackdriver.com/stack-install.sh
sudo bash stack-install.sh --write-gcm

curl -sSO https://dl.google.com/cloudagents/install-logging-agent.sh
sudo bash install-logging-agent.sh

Now what are the next steps?

If I create a new dashboard in stackdriver, I can not found any metrics related to disk space available or used.


Solution

  • Depending on how you have your access scope settings when you created the instance, you may not have the proper stackdriver api permissions. By default, stackdriver will pull the cpu and some other basic stats via the GCE apis, but in order for the agent to work you need to make sure the stackdriver monitoring api has full or write access.

    See https://cloud.google.com/monitoring/agent/install-agent for reference on permissions.