As for the site, if you don't want to ping, you could open a connection (curl and I believe fsocket) and grab just the header. If you get a header with a groovy status number, then you could assume the web server is up. If you get something like a 500 error, then you know you have problems.
For SQL, I'm not sure the best way to do that. One approach might be to put something on the web server to check the sql connection every now and then and report it to you. Another approach would be to setup a script to talk to the sql server. Like have it do something silly like: "SELECT NOW() AS currenttime" and have a remote script call the test script and verify the output is a time value and not an error. If the security allows, you could also go for a remote direct connect to the SQL server. For security reasons, this may not be an option though.