kkenny
Active Member
- Messages
- 1,950
- Reaction score
- 0
- Points
- 36
Hey guys. I'm planning to do this new script for my x10Portal.
It's a server status script, but this time I'm going to add the percentage of uptime that the service is up.
This is my code
The main code
The second part of the code for every individual service for every server.
What I need is a php script that instead of just displaying the status of the server, I will also display the uptime percentage of that service right below that status.
Any ideas?
It's a server status script, but this time I'm going to add the percentage of uptime that the service is up.
This is my code
The main code
PHP:
<?php
function serverStatus($server, $port, $service, $serverName) {
$status = @fsockopen($server, $port, $errno, $errstr, 10);
if (!$status) {
echo "<div align='center'><font color='red' size='6'><blink>•</blink></font></div>";
} else {
echo "<div align='center'><font color='green' size='6'>•</font></div>";
fclose($status);
}
}
?>
PHP:
<?php
serverStatus("IP", PORT, "SERVICE NAME", "SERVER NAME")
?>
What I need is a php script that instead of just displaying the status of the server, I will also display the uptime percentage of that service right below that status.
Any ideas?