hey Guys,
i've got my own admin panel for my site. And i was wondering if theres a script i can get if services are offline/online.
Eg.
HTTP: Online!
FTP: Offline
It will be great if you have one of these.
Cheers
hey Guys,
i've got my own admin panel for my site. And i was wondering if theres a script i can get if services are offline/online.
Eg.
HTTP: Online!
FTP: Offline
It will be great if you have one of these.
Cheers
sk1tL1L
You can use the images of this thread: http://forums.x10hosting.com/showthread.php?t=13706
Federico Lerner
Former x10Hosting Administrator - Staff Manager
but is there a script? Thats what i'm really looking for
sk1tL1L
This seems to be along the lines of what you want:
http://www.schwebdesigns.com/serverstatus/
ill talk alook, thanks
sk1tL1L
Use this:
Change $port to a port, and change Online and Offline to w/e you want, use HTML code here too;)PHP Code:<?php
function serviceStatus(66.232.109.231, $port) {
$handle = @fsockopen($ip, $port, $errno, $errstr, 30);
if (!$handle) {
$string = 'Down';
} else {
$string = 'Online';
@fclose($handle);
}
return $string;
}
echo $string;
?>
Last edited by Brandon; 12-07-2006 at 06:07 PM.
Thanks,
Brandon Long
I changed the $port to the port 80 (HTTP) and i'm getting this error:
Code:Parse error: syntax error, unexpected T_DNUMBER, expecting '&' or T_VARIABLE in /home/fedlerne/public_html/x10/includes/status.php on line 3
Federico Lerner
Former x10Hosting Administrator - Staff Manager
You have to use that function like this:
The $ip and $port vars in the function are the default ones, but you can override them by setting them in function call eg.:PHP Code:<?php
function serviceStatus($ip = "66.232.109.231", $port = 80){
$handle = @fsockopen($ip, $port, $errno, $errstr, 30);
if (!$handle) {
$string = 'Down';
} else {
$string = 'Online';
@fclose($handle);
}
return $string;
}
echo serviceStatus();
?>
PHP Code:echo serviceStatus("123.123.123.123",8080);
Tysil Chronicles (redesigning)SigChat Service (in development)Torch's PHP Functions Library (not finished)
Thanks Torch!
That worked![]()
Federico Lerner
Former x10Hosting Administrator - Staff Manager
Thatnks Torch, i was busy doing other things posting and forgot it was a function.
Thanks,
Brandon Long