How can I get alerts when my site is down?

Solution 1:

If you need an alert when your site goes down you should consider an online service for notifications: They will see the outside perspective.

If you monitor from "inside your own box" you will never get an email if it crashes completely or looses its network connectivity because your script will not be able to run or alert you anymore.

Bello or Pingdom both offer free accounts that are great to get you started.

More services are listed in Can anyone recommend a website monitoring service?

Solution 2:

I'm surprised nobody's mentioned Nagios. It's incredibly powerful, does uptime percentages, notification via email/IM, can run scripts on downtime, etc. It's probably the best out there.

Solution 3:

Check out AreMySitesUp (http://aremysitesup.com) and Pingdom. Both have free options, and will send an email and SMS when your site is down. AreMySitesUp has an iPhone app as well.