Non so se si puo` fare lato server, ma credo sia piu` semplice farlo lato client (con JS)
1. caricare una immagine velocissima dal server 1
2. inserire un timeout e verificare se l'immagine e` arrivata
codice:
var imm = new Image();
var tt;
function testserver() {
imm.onload = testok; /* nota: senza parentesi */
tt = setTimeout('testfail()', 500);
imm.src = "http://dominio_server1/path/immvuota.gif";
}
function testok() {
clearTimeout(tt);
alert ("server on");
}
function testfail() {
alert("server down");
}
Nota che i 500 msec del test sono un valore indicativo: alcuni server hanno bisogno di un tempo piu` lungo.