Report this

What is the reason for this report?

How to automatically reboot droplet when server is down?

Posted on March 5, 2020

Hey guys,

I’ve been on Google and this forum for days now, and I think I am really far already, but I still have some questions regarding my setup.

I am using this tutorial: https://www.tompec.com/blog/automatically-reboot-server-when-its-down

I already succesfully installed the script on a seperate Droplet.

The questions I have:

  1. Which URL do I insert in Uptime Robot to notify? I assume the URL of the droplet which has the script installed right? For example: https://api.digitalocean.com/v2/droplets/DIGITAL_OCEAN_DROPLET_ID/?

  2. Which ID’s do I use in “config/servers.php”? // UptimeRobot monitor’s name => DigitalOcean server ID ‘Your-server-name’ => 12345678,

Your-Server-Name = Friendly Name of the UptimeRobot Monitor or the Friendly Name Uptime Robot Alert Contact?

DigitalOcean server ID = The Droplet ID of the droplet with the script running or the ID of the droplet which is actually down?

Hopefully you can point me in the right direction! :)



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey Bobby,

Thanks for your follow up!

Do you maybe have suggestions for my last questions as well?

“DigitalOcean server ID = The Droplet ID of the droplet with the script running or the ID of the droplet which is actually down?”

Hello,

This seems like a nice script, I’ve not used it myself but I’ll definitely give it a try.

Regarding your questions:

  • URL to notify

This needs to be the IP address or the hostname of the separate Droplet that you’ve created to run the script on

  • Friendly name

I believe that this needs to be the friendly name of the monitor as this is one of the parameters that the webhook is going to pass over.

Hope that this helps! Regards, Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.