Am trying to setup a uptime check for my VM instances that do not have any external IPs associated with them.
As per the documentation for Uptime checks, there is a mention it cannot be configured for resources without any external IPs. Is there any workaround for the same to keep these checks with only the internal IP for VMs?
Appreciate your timely input and suggestions
The first thing that came to my mind is to create another VM with public IP, in the same VPC with your private VMs.
There 2 things to consider:
Now, if you serve a website internally (for instance, with an internal HTTPS load balancer) and you want to have a uptime check on it, AFAIK, you can’t for now.
Many thanks for the prompt responses
@ilias & @guillaume blaquiere
My ask is simple. I have a few internal facing VMs that I used for log information and other such requirements which doesn’t need a http/https checks. I was interested with the TCP configuration of the uptime checks.
I see you have mentioned having a VM within the same VPC with an external IP. How does that help in getting this configuration working? Can you please throw some more light on this suggestion?
You could use “uptime ec2-instance-connect -p “ cli
From stack exchange server fault:
There is no specific 'uptime' measure in Amazon EC2.
If AWS Config has been configured, you could use
get-resource-config-historyto retrieve the history of an instance, eg:
AWS Config will show the state change of an Amazon EC2 instance (eg
running) as a
Configuration.State.Namevalue. The change will also have a timestamp.
Using this configuration history, you could piece together enough information to calculate uptime.
Alternatively, you could calculate the uptime from within the instance (eg from system logs or via a custom app) rather than obtaining it from EC2.
Improve this answer
answered Oct 16 '16 at 10:30
Thanks a lot for your response -
@Mykle I am only interested for the GCE instances within the GCP scope. AWS EC2 instances are not scoped in for the checks yet.
I believe instead of these uptime checks (under Monitoring → Uptime Checks), the standard Cloud operations alerting policy (Monitoring → Alerting) with the uptime metric might be worthwhile option. I tried to test it out but somehow couldn’t make it work as expected. I created a metric alert policy for the VM (compute.googleapis.com/instance/uptime) and brought the VM down manually. The email was not triggered (as per notification policy) on time and as well the uptime metric was active although the instance was stopped (instance stopped around 1 AM but uptime metric was active even after - check attached image). May have to check this further and test the suggested MQL and see if that proves effective
Apologies Vijay. I forgot this is only a GCP community.
In Who should be notified? Try the SMS option. Faster than email notification - don’t know why.