Monthly Archives: March 2010

Protected: Health Update

This post is password protected. To view it please enter your password below:


Protected: You keep saying that…I do not think it means what you think it does

This post is password protected. To view it please enter your password below:


Monitor a web server using PHP

function check($host, $find)
{
	$fp = fsockopen($host, 80, $errno, $errstr, 10);
	if (!$fp)
	{
		echo "$errstr ($errno)\n";
	}
	else
	{
		$header = "GET / HTTP/1.1\r\n";
		$header .= "Host: $host\r\n";
		$header .= "Connection: close\r\n\r\n";
		fputs($fp, $header);
		while (!feof($fp))
		{
			$str .= fgets($fp, 1024);
		}
		fclose($fp);
		return (strpos($str, $find) !== false);
	}
}

function alert($host)
{
	mail('youremail@gmail.com', 'Monitoring', $host.' down');
}

$host = 'www.monkeyguild.org';
$find = 'Monkeyninja Code';
if (!check($host, $find)) alert($host);

Protected: Changes

This post is password protected. To view it please enter your password below:


Protected: I forgot how much I love Truman Capote

This post is password protected. To view it please enter your password below: