Toutes les heures via une tache CRON je lance le script suivant depuis un Raspberry PI.
Si la box distante ne répond pas, j’en suis informé par Email.
send("88.198.110.25", 1);
if ($serverPing->isAlive()) {
echo "Box Pouldu On Line";
$connexion=true;
} else {
echo "Box Inaccessible !!!";
$connexion=false;
}
//Si la box est inaccessible on envoie un Email
if ($connexion== false) {
// Le corps du message
$msg = "La box du est injoignable";
// On envoie le mail
mail("patrice.witte@gmail.com","Alerte Box",$msg);
}
?>
Attention le script fait appel à la fonction ServerPing.php.
Vous pouvez la récupérer ICI.