Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 21:39

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Server Status Checker

Discussion on Server Status Checker within the Web Development forum part of the Coders Den category.

Closed Thread
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2013
Posts: 82
Received Thanks: 16
Server Status Checker

Hi ePvP, i need a status checker for a darkorbit server, i need something like in this thread:

Please, if you could help me, thanks.
AndreiStanilaAK is offline  
Old 07/16/2013, 18:30   #2
 
elite*gold: 159
Join Date: Jun 2013
Posts: 1,776
Received Thanks: 2,004
google "server status checker"
Brendan Jordan is offline  
Old 07/17/2013, 08:23   #3
 
elite*gold: 0
Join Date: Jun 2013
Posts: 82
Received Thanks: 16
Quote:
Originally Posted by M3BF05B View Post
google "server status checker"
Thanks for nothing, i already searched and for something but don't work.
AndreiStanilaAK is offline  
Old 07/20/2013, 07:35   #4
 
PizzaGuy's Avatar
 
elite*gold: 0
Join Date: Jul 2013
Posts: 435
Received Thanks: 480
Quote:
Originally Posted by AndreiStanilaAK View Post
Thanks for nothing, i already searched and for something but don't work.
Took 30 seconds to write up an example, knock yourself out.

Code:
<?php

$fp = fsockopen("127.0.0.1", 80, $errno, $errstr, 3);
if (!$fp) {
  echo "<img src='http://icons.iconarchive.com/icons/fatcow/farm-fresh/32/status-offline-icon.png'>";
} else {
  echo "<img src='http://icons.iconarchive.com/icons/fatcow/farm-fresh/32/status-online-icon.png'>";
}

?>
Replace 127.0.0.1 with the servers IP, and 80 with the port of the server to check for.
PizzaGuy is offline  
Thanks
1 User
Old 07/20/2013, 10:31   #5
 
elite*gold: 0
Join Date: Jun 2013
Posts: 82
Received Thanks: 16
Quote:
Originally Posted by PizzaGuy View Post
Took 30 seconds to write up an example, knock yourself out.

Code:
<?php

$fp = fsockopen("127.0.0.1", 80, $errno, $errstr, 3);
if (!$fp) {
  echo "<img src='http://icons.iconarchive.com/icons/fatcow/farm-fresh/32/status-offline-icon.png'>";
} else {
  echo "<img src='http://icons.iconarchive.com/icons/fatcow/farm-fresh/32/status-online-icon.png'>";
}

?>
Replace 127.0.0.1 with the servers IP, and 80 with the port of the server to check for.
It's possible to make that check more than 1 port? i mean, for 80, 443 and 3306?
And ... Thanks for help.
AndreiStanilaAK is offline  
Old 07/20/2013, 17:29   #6
 
elite*gold: 10
Join Date: Aug 2012
Posts: 813
Received Thanks: 106
Quote:
Originally Posted by AndreiStanilaAK View Post
It's possible to make that check more than 1 port? i mean, for 80, 443 and 3306?
And ... Thanks for help.
Code:
<?php

$fp = fsockopen("127.0.0.1", 80, $errno, $errstr, 3);
if (!$fp) {
  echo "127.0.0.1:80"
  echo "<img src='http://icons.iconarchive.com/icons/fatcow/farm-fresh/32/status-offline-icon.png'>";
} else {
  echo "127.0.0.1:80"
  echo "<img src='http://icons.iconarchive.com/icons/fatcow/farm-fresh/32/status-online-icon.png'>";
}

$fp = fsockopen("127.0.0.1", 443, $errno, $errstr, 3);
if (!$fp) {
  echo "127.0.0.1:443"
  echo "<img src='http://icons.iconarchive.com/icons/fatcow/farm-fresh/32/status-offline-icon.png'>";
} else {
  echo "127.0.0.1:443"
  echo "<img src='http://icons.iconarchive.com/icons/fatcow/farm-fresh/32/status-online-icon.png'>";
}

$fp = fsockopen("127.0.0.1", 3306, $errno, $errstr, 3);
if (!$fp) {
  echo "127.0.0.1:3306"
  echo "<img src='http://icons.iconarchive.com/icons/fatcow/farm-fresh/32/status-offline-icon.png'>";
} else {
  echo "127.0.0.1:3306"
  echo "<img src='http://icons.iconarchive.com/icons/fatcow/farm-fresh/32/status-online-icon.png'>";
}
?>
I think that´s ok... but i didn´t know it because i can´t PHP (i have start to learn it for ~3 weeks)
GodHacker is offline  
Thanks
1 User
Old 07/20/2013, 17:30   #7


 
MrSm!th's Avatar
 
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,904
Received Thanks: 25,394
Arrow General Coding -> Web Development

#moved
MrSm!th is offline  
Thanks
1 User
Old 07/20/2013, 19:52   #8

 
マルコ's Avatar
 
elite*gold: 1329
Join Date: Jun 2009
Posts: 1,873
Received Thanks: 960
No, It's not ok. Why would there be functions in PHP if you do not use them?
Also you do not close the connections in case they opened successfully.

PHP Code:
/**
 * Ping IP @ Port
 * 
 * @param string $ip The IP of the computer you want to ping
 * @param integer $port The port that should be pinged
 * 
 * @return boolean
 */
function ping($ip$port 22)
{
    
$serror 0;
    
$serrorstr 0;
    
$ps = @fsockopen($ip$port$serror$serrorstr1);
    if(!
$ps)
    {
        return 
false;
    }
    else
    {
        
fclose($ps);
        return 
true;
    }

BTW, it's not good to open the database port to the world. You should better close that port and only connect to it locally on the remote machine.
マルコ is offline  
Thanks
1 User
Old 07/21/2013, 10:18   #9
 
elite*gold: 0
Join Date: Jun 2013
Posts: 82
Received Thanks: 16
Quote:
Originally Posted by マルコ View Post
No, It's not ok. Why would there be functions in PHP if you do not use them?
Also you do not close the connections in case they opened successfully.

PHP Code:
/**
 * Ping IP @ Port
 * 
 * @param string $ip The IP of the computer you want to ping
 * @param integer $port The port that should be pinged
 * 
 * @return boolean
 */
function ping($ip$port 22)
{
    
$serror 0;
    
$serrorstr 0;
    
$ps = @fsockopen($ip$port$serror$serrorstr1);
    if(!
$ps)
    {
        return 
false;
    }
    else
    {
        
fclose($ps);
        return 
true;
    }

BTW, it's not good to open the database port to the world. You should better close that port and only connect to it locally on the remote machine.
There should be "$ip = "127.0.0.1" and $port = "443" " for example?
AndreiStanilaAK is offline  
Old 07/21/2013, 11:19   #10
 
Thr!ce's Avatar
 
elite*gold: 20
Join Date: Aug 2005
Posts: 652
Received Thanks: 189
Quote:
Originally Posted by AndreiStanilaAK View Post
There should be "$ip = "127.0.0.1" and $port = "443" " for example?

PHP Code:
if (ping("127.0.0.1"443))
    echo 
"Yay";
else echo 
"Nay"
?
Thr!ce is offline  
Thanks
1 User
Old 07/22/2013, 09:54   #11
 
elite*gold: 0
Join Date: Jun 2013
Posts: 82
Received Thanks: 16
Quote:
Originally Posted by Thr!ce View Post
PHP Code:
if (ping("127.0.0.1"443))
    echo 
"Yay";
else echo 
"Nay"
?
Thanks for help.
#CloseRequest
AndreiStanilaAK is offline  
Old 07/22/2013, 20:45   #12

 
xxfabbelxx's Avatar
 
elite*gold: 900
Join Date: Apr 2009
Posts: 14,976
Received Thanks: 11,388
closed as requested
xxfabbelxx is offline  
Closed Thread


Similar Threads Similar Threads
Darkorbit Bot Status Checker V1.0
01/05/2013 - DarkOrbit - 5 Replies
Darkorbit Bot Status Checker V1.0 Checking Bots: Profibot Pbdo-bot Boxybot Kbot SCREENSHOT: http://b1301.hizliresim.com/15/5/hnuvg.png
[How To]ICQ Status-checker
09/04/2010 - Tutorials - 2 Replies
Hier zeige ich euch wie ihr euren ICQ-Status zum Beispiel in eure Signatur stellen könnt. Es funktioniert nur bei Nummern, die über die Suchfunktion gefunden werden können! Das heißt sie müssen clean sein.(dürfen nicht invisible sein) 1. Sucht euch eins von diesen Bildern aus: 1. http://informer.uinov.ru/status/8/123456789.png 2. http://informer.uinov.ru/status/9/123456789.png 3. http://informer.uinov.ru/status/10/123456789.png 4. http://informer.uinov.ru/status/11/123456789.png 5....
[Help]Status Checker!
07/23/2009 - CO2 Private Server - 0 Replies
Hey Guys, I have a problem with the status of my server, i execute CoMy.exe when the window finish loading says : Server Running on Ip: and my ip but in Blackout Gaming - Projects says my server is off? my firewall isnt connected and i dont know why the problem... who can help me?
SJSRO and Sun SRO Status checker!
07/12/2009 - SRO Private Server - 10 Replies
Hey guys, I made this simple program to check server registration status, be sure to read the ReadMe. It's an HTML document so you don't have to install it.
I need a status Checker!
04/13/2009 - CO2 Private Server - 3 Replies
Ok this is kinda difficult but it can be done i need a status checker to tell how many people are online but the problem is our db is ini files not a mysql so if you could please help me that would be great! thanks, LeGend andreaco.tk



All times are GMT +2. The time now is 21:39.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.