got error for connecting to database failure, caused by insufficient disk size?

We have a WordPress multisites installed on GCP via Bitnami, got an error for connecting to database failure, it seems caused by insufficient disk size, when we resized the disk the problem solved.

The question is, how can we get warning before the website will be stopped, how to setup the notification for caution on GCP?


Solution 1:

To be able to monitor the usage of your disk in GCE, you will have to install the Monitoring Agent[1], for Cloud Monitoring service.

With this Agent you will be able to monitor the Disk, besides a lot of other resources; let me share with you the complete list of the metrics available[2]

However I believe the metrics you are looking for is: “Disk Percent Used.”[3], Follow this documentation in order to install the Monitoring Agent in your Instance.[4]

Then, you will have to configure an Alert that uses the mentioned metric. Here you have an example/how-to that will allow you configure an Alert[5]


[1] https://cloud.google.com/monitoring/support/notification-options#creating_channels [2]https://cloud.google.com/monitoring/api/metrics_agent [3]https://cloud.google.com/monitoring/api/metrics_agent#agent-disk [4]https://cloud.google.com/monitoring/agent/installation#joint-install [5]https://cloud.google.com/monitoring/quickstart-lamp#create_an_uptime_check_and_an_alerting_policy