You could do something as simple as:
if ! ping -c 1 $HOSTNAME >/dev/null 2>&1
then echo $HOSTNAME is not pinging |mailx -s "$HOSTNAME Down Alert" <firstname.lastname@example.org>
Where <hostname> is replaced by the host you want to check and <email@example.com> is the user to whom you wish to send the email.
However, there are Open Source Software (OSS) packages for doing full monitoring.
We use Nagios central server with NRPE plugin on the UNIX/Linux hosts.
It depends on what you mean by "down" of course. A server's OS could be up and running and every process but the one that is critical to your operation might be up however that one process may mean your operation is "down". The Nagios/NRPE framework allows you determine exactly what you want to monitor. We have monitors for specific processes, server pingability, CPU load, memory utilization , disk space utilization, web page availability, and I've even written monitors to tell me when services have failed over from a primary node to a secondary in a cluster.