This is a simple and no frills way to monitor your servers.
You will need to create the file “urls.txt” in the same folder as the “active-servers.php” file.
Examples – urls.txt:
https://www.my-website.com/
http://localhost/
http://www.my-website.com/some/page.php
Navigate to the active-servers.php file. ( http://www.your-site.com/scripts/active-servers.php)
Online Servers will be Lime and Offline Servers, Red.
active-servers.php
<head>
<title>Active Servers</title>
</head>
<body style=”background-color: #0c0c0c;”>
<div>
<table width=”100%” height=”100%”>
<tr>
<td>
<table style=”margin-bottom: 100%;text-transform: uppercase;”>
<?php
$fn = fopen(“urls.txt”,”r”);
while(! feof($fn)) {
$result = fgets($fn);
$server=gethostbyname(parse_url($result, PHP_URL_HOST));
if (fsockopen($server, 80)){
echo (‘ <tr><td><b><a style=”color: Lime; text-decoration: none;”href=”‘.$result.'” target=”viewer”>’.$result.'</b></td></tr>’. “\r\n”);
} else
{
echo (‘ <tr><td style=”color: #a00000″>’.$result.'</td></tr>’. “\r\n”);
}
} fclose($fn); ?>
</table>
</td>
<td width=”100%”><iframe align=”right” class=”viewpanel” src=”” name=”viewer” frameborder=”0″ width=”100%” height=”600px”></iframe></td>
</tr>
</table>
</div>
</body>