vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Programming Discussion :: UPD Port Checking Server Status ??? - View Topic
Topic Rating: *****
Printable View
dog199200
Guest
UPD Port Checking Server Status ??? (22nd Dec 09 at 8:43am UTC)
OK people, i've finally got my server for my game back up and running, the problem is that the server status script I have been using ain't exactly working to well. The one i have checks the ports on the sever and echos back its online if it see's the port is open. And with that said obviously the port is closed when the server is offline. Now the problem is that the codes doesn't check to see if my server is online because it only checks for TCP ports and not UDP, and the game software runs on UDP. Does anyone know of a code that will work that checks a UDP port to see if its open?

I would just use a code that checks to even see if the server is online, but the problem is the game software has its own internal server which talks to the database. So i have to check the ports.
Ross
Administrator
*****

[Avatar]

Posts: 3,709
Status: Offline
Gender: Male
Age: 9 14
Joined:  

Additional Groups:
Support Team
***


Reputation: 45%  


pmwwwtwittergtalkvForum
Re: UPD Port Checking Server Status ??? (22nd Dec 09 at 10:04am UTC)
To the best of my knowledge, you cannot have a status checker automatically connect to a UDP port to see if it is online.

The only setup I can think of is a little long winded. Rather than monitoring a port it would be monitoring the service. You'd have your status checker do some form of file_get_contents which would fetch a (web) file from your server. This file would be dynamically produced (either via cron or as a php script) and would search the list of active processes for your game server. That kind of process list can be produced via bash with something along the lines of: "ps aux". How that works exactly depends on how your server is setup and what OS it uses.

Image
dog199200
Guest
Re: UPD Port Checking Server Status ??? (22nd Dec 09 at 10:08am UTC)
Ah yea i know, you've explained that to me before. I kept the pm in cased I had to go back and use it. Now here is a question, couldn't I have the server check fall to a file on the server, and the file on the server checks to see if a program is running, and if the program is running it calls back to the server check as being online?
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: UPD Port Checking Server Status ??? (22nd Dec 09 at 10:12am UTC)
When I had wImg open, I followed Ross' tutorial on this and how it worked was:

The 'Check Server' would every 5 mins access a page on the "Site Server", and it would contain a list of usage stats, MySQL, CPU, Memory etc... This would then be read by "file_get_contents()", and then manipulated further.

Then it would be stored on the 'Check Server's' side, and used later to check if a server is still offline etc...

But yea, the best way to do it would be for the way outlined just above. Have the file updated constantly (perhaps by the 'game server' and then read that from the check server. If the time for the last update is more than 5 mins then the server is offline!) {Smile}
dog199200
Guest
Re: UPD Port Checking Server Status ??? (22nd Dec 09 at 10:20am UTC)
OK now, the question is how would I go about calling the file when the server is not a website in any kind of way? I don't have the web ports or anything opened. I don't even have the IP address assigned to a domain name yet, which I plan on doing later on.
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: UPD Port Checking Server Status ??? (22nd Dec 09 at 10:27am UTC)
Is there not a file at all that you can make accessible via IP address eg: x.x.x.x/~check/check.php

or something? {Smile}
dog199200
Guest
Re: UPD Port Checking Server Status ??? (22nd Dec 09 at 10:32am UTC)
Well I can, but not sure how to call files access from a server {Unsure} I don't have IIS installed, which I guess I can do, and then add the file in there, and assign it to the main ip address. And if its needed to know i'm running Windows Server 2008, my games server engine only works on a windows client sadly, unless i'd use linux for a server OS.


Edit: Anyways ok thanks, i'll start seeing what i can do for the code. I tihnk it be easiest to start with coding the part that outputs f the server is online or off.
 Printable View

All times are GMT+0 :: The current time is 11:56am
Page generated in 0.3766 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums