Question

How to automatically reboot droplet when server is down?

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! :)


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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