simotunes
simotunes

Reputation: 187

get alert when instance is not active in GCE

For Compute Engine of GCE, I use stackdriver monitoring for monitoring and alert. For most of the general metrics like CPU, disk IO, memory ... etc is available and can set alert for those metrics based or dead-or-alive by process name.

However I cannot find any metrics related to status of GCE instance itself.

My use-case is so simply. I'd like to know if the instance id down or not. Any suggestion appreciated. thanks.

Upvotes: 1

Views: 1224

Answers (2)

gavenkoa
gavenkoa

Reputation: 48753

You could monitor the parameter absence (like CPU), it is the only official way:

https://cloud.google.com/monitoring/alerts/metric-absence

Upvotes: 0

Martin Zeitler
Martin Zeitler

Reputation: 76669

think the instance status not a monitoring metric; there's just instance/uptime available.

(and I have no clue what it would return when it is terminated, possibly worth a try).

but one can check for servers with Uptime Checks and then report the Incident.

and one can get the instance status with gcloud compute instances describe instance01.

Upvotes: 4

Related Questions