Rails sites went down without my knowledge

I found that both of my Rails sites went down tonight without my knowledge, and I was getting 502 errors when I tried to visit these sites. Both are hosted by the same company. Fortunately, I was able to get the sites back up and running simply by restarting them.

Are there any services out there that I can use to automatically monitor my sites and send me an email and/or text message if my sites go down?

Additionally, would it be a good idea to set the cron jobs on my sites to automatically restart the sites on a regular basis? If so, how often should my sites be restarted?

Are there any services out there that I can use to automatically monitor my
sites and send me an email and/or text message if my sites go down?

There are literally thousands, Google is your best bet for this solution.

Additionally, would it be a good idea to set the cron jobs on my sites to
automatically restart the sites on a regular basis? If so, how often should
my sites be restarted?

No, that would be a horrible idea... first you need o figure out why
the it went down and correct it, then you should look into something
like God (not so Godly ironically) or monit or anything of the sorts
that will hearbeat your site and kick it back on if it falls down.
You should probably be tracking errors with something like honeybadger
or airbrake so you can see this kind of shit coming.

Thanks, Jordon. The best web site monitoring solution I found is through Google Docs. For more on this solution, go to:
http://www.labnol.org/internet/website-uptime-monitor/21060/

I found that both of my Rails sites went down tonight without my knowledge, and I was getting 502 errors when I tried to visit these sites. Both are hosted by the same company. Fortunately, I was able to get the sites back up and running simply by restarting them.

Are there any services out there that I can use to automatically monitor my sites and send me an email and/or text message if my sites go down?

New Relic, Datadog, Pingdom, and lots of others have arisen recently. Additionally, you should think about having your own health check responder(s).

Additionally, would it be a good idea to set the cron jobs on my sites to automatically restart the sites on a regular basis? If so, how often should my sites be restarted?

It often depends on why your sites went down. It also depends on what sort of infrastructure you have for your application. Some server setups can manage this if a single server processor (such as a unicorn worker) goes down or hangs, but if the whole thing goes belly up then you may have something quite a bit more catastrophic.