motov.net

  • Increase font size
  • Default font size
  • Decrease font size
  • default color
  • black color
Home arrow Tutorials arrow PHP arrow PHP host monitor script for use with crontab sends you e-mail
PHP host monitor script for use with crontab sends you e-mail Print E-mail
Sunday, 30 September 2007
<?php
//Mofify here
$hosts[] = 'gmail.com';
$hosts[] = 'google.com';
$hosts[] = 'yahoo.com';
 
$mail = 'YourEmailAddressHere';
 
//don't tuch after this line if you don't know what you're doing
foreach ($hosts as $host) {
     $out = exec("ping -c 3 $host");
     if (strpos($out,'min/avg/max/mdev') == false) {
          echo "$host - FAILED\r\nSending email $mail\r\n";
          mail($mail,"$host - FAILED on " . date("Y-m-d H:i:s"),"HOST $host FAILED!");
     } else {
          echo "$host - SUCCESS\r\n";
     }
}
?>
Last Updated ( Sunday, 30 September 2007 )
 
< Prev   Next >

Proof of Verification

Login Form






Lost Password?
No account yet? Register

Instant Messaging

My status  bbh2k3
171-881-244

Let us know

Do you think our products are too expensive?
 

Syndicate