If you have a separate server to run your check script on, something like this would do a simple Ping test to see if the server is alive:
#!/bin/bash
SERVERIP=192.168.2.3
NOTIFYEMAIL=test@example.com
ping -c 3 $SERVERIP > /dev/null 2>&1
if [ $? -ne 0 ]
then
# Use your favorite mailer here:
mailx -s "Server $SERVERIP is down" -t "$NOTIFYEMAIL" < /dev/null
fi
You can cron the script to run periodically.
If you don't have mailx, you'll have to replace that line with whatever command line email program you have and probably change the options. If your carrier provides an SMS email address, you can send the email to that address. For example, with AT&T, if you send an email to phonenumber@txt.att.net, it will send the email to your phone.
Here's a list of email to SMS gateways:
http://en.wikipedia.org/wiki/List_of_SMS_gateways
If your server is a publicly accessible webserver, there are some free services to monitor your website and alert you if it's down, search the web for free website monitoring to find some.