You can find a simple script attached that will set up a netwatch rule to ping an address then email you once it either goes online or offline, the netwatch function just allows you to run a script once an address is reachable/unreachable.
As well as this please remember that this is biased on state changes so the scripts that you put in there will only be run once, for example if the address is reachable it will do the up script once then it will do nothing until the address is unreachable and it will run the down script once and so on.