Jump to content

Server Status for HostNine


ask21900

Recommended Posts

Here is a server status for all you HostNine resellers...

 

Just make the serverstatus.tpl file of your template look like this:

 

<p>{$LANG.serverstatusheadingtext}</p>

<table class="clientareatable" align="center" cellspacing="1">
<tr class="clientareatableheading">
<td>{$LANG.servername}</td>
<td>Server Location</td>
<td>FTP</td>
<td>SMTP</td>
<td>HTTP</td>
<td>POP</td>
<td>MYSQL</td>
</tr>

{php}

@set_time_limit(300);

$servers2 = array(
'node 1' => 'Illinois, US',
'node 2' => 'Illinois, US',
'node 3' => 'Iowa, US',
'node 4' => 'Texas, US',
'node 5' => 'Virginia, US',
'node 6' => 'Berkshire, UK',
'node 7' => 'Georgia, US',
'node 8' => 'California, US',
'node 9' => 'New York, US',
'node 10' => 'Illinois, US',
'node 11' => 'Florida, US',
'node 12' => 'Singapore, ASIA',
'node 13' => 'Berkshire, UK',
'node 14' => 'Texas, US',
'node 15' => 'New York, US',
'node 16' => 'Berkshire, UK',
'node 17' => 'California, US',
'node 18' => 'Berkshire, UK',
'node 19' => 'Texas, US',
'node 20' => 'New York, US',
'node 21' => 'Iowa, US',
'node 22' => 'Illinois, US',
'node 23' => 'Georgia, US',
'node 24' => 'Singapore, ASIA',
'node 25' => 'Florida, US',
'node 26' => 'Berkshire, UK',
'node 27' => 'Virginia, US',
'node 28' => 'California, US',
'node 29' => 'Texas, US'
);

$servershost = array(
'node 1' => 'node1,.myserverhosts.com',
'node 2' => 'node2.myserverhosts.com',
'node 3' => 'node3.myserverhosts.com',
'node 4' => 'node4.myserverhosts.com',
'node 5' => 'node5.myserverhosts.com',
'node 6' => 'node6.myserverhosts.com',
'node 7' => 'node7.myserverhosts.com',
'node 8' => 'node8.myserverhosts.com',
'node 9' => 'node9.myserverhosts.com',
'node 10' => 'node10.myserverhosts.com',
'node 11' => 'node11.myserverhosts.com',
'node 12' => 'node12.myserverhosts.com',
'node 13' => 'node13.myserverhosts.com',
'node 14' => 'node14.myserverhosts.com',
'node 15' => 'node15.myserverhosts.com',
'node 16' => 'node16.myserverhosts.com',
'node 17' => 'node17.myserverhosts.com',
'node 18' => 'node18.myserverhosts.com',
'node 19' => 'node19.myserverhosts.com',
'node 20' => 'node20.myserverhosts.com',
'node 21' => 'node21.myserverhosts.com',
'node 22' => 'node22.myserverhosts.com',
'node 23' => 'node23.myserverhosts.com',
'node 24' => 'node24.myserverhosts.com',
'node 25' => 'node25.myserverhosts.com',
'node 26' => 'node26.myserverhosts.com',
'node 27' => 'node27.myserverhosts.com',
'node 28' => 'node28.myserverhosts.com',
'node 29' => 'node29.myserverhosts.com'
);

$services2 = array(
'FTP' => 21,
//'SSH' => 22,
'SMTP' => 25,
'HTTP' => 80,
'POP' => 110,
'MYSQL' => 3306
);

foreach($servershost as $svrName  => $host)
{
echo "<tr class=\"clientareatableactive\"><td>$svrName</td><td>$servers2[$svrName]</td>";
foreach($services2 as $svcName => $port)
{
	$status2 = "<td><img src=\"http://diversehosting.net/green.jpg\"></td>\n";
	if(!($f = @fsockopen($host, $port, $errno, $errstr, 10)))
		$status2 = "<td><img src=\"http://diversehosting.net/red.jpg\"></td>\n";
	else fclose($f);

	echo $status2;
} // foreach port
echo "</tr>";
} // foreach host

{/php}

</table>

 

 

That's it... I just threw this together real quick, but when I have time I will mod it better. I will post when I do, but as for now it works.

 

You can check it out here: http://diversehosting.net/hostsys/serverstatus.php

 

 

Enjoy

 

 

David Goodman

Diverse Hosting

Link to comment
Share on other sites

It won't let me edit that post now... The script has been changed now anyway... DaveyC helped me out with some mods... The script is now ran by cron and populates a DB... The page then pulls the info from the DB for faster loads.

 

You can find the mods and the instructions at the H9 forums. Here is the link: http://forums.hostnine.com/showthread.php?t=1637

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated