Created
April 13, 2012 12:35
-
-
Save ataliba/2376634 to your computer and use it in GitHub Desktop.
A simple script I create in the past to monitoring my blog/site
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$arquivo = "$HOME/logs/uptime"; | |
$abre = fopen($arquivo,"a+"); | |
$ip = "mysite.com.br"; | |
$comando = "/arpa/af/c/cerebro/bin/commands/httping -c 1 -g http://".$ip; | |
$saida = shell_exec($comando); | |
$texto = "Site : $ip"; | |
if ( ereg("1 ok",$saida) ) { | |
$texto = $texto. " you site is up [ "; | |
} else { | |
$texto = $texto." you site is down [ "; | |
} | |
$texto = $texto; | |
$data = date(r); | |
$texto = $texto.$data." ] \n"; | |
fwrite($abre,$texto); | |
fclose($abre); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment