hey boyz/girlz

i need to make a code for a server status checker, how would i do it?

at the moment the server is checked by using this


how can i convert that into a simple program that can run on the desktop?

Recommended Answers

All 27 Replies

The easiest solution is to shell a ping command, and redirect the output to a temporary file. Open the Temporary file, and have your VB Program read in the lines (compare using instr) and check if there is a timeout, or if there is a response from the server. If there is a response from the server, naturally, the server is up. If you get, instead, a ping timout, then the server is down. If you really want to get fancy about it, you could try to connect the server on port 80 (the web page port), rip apart the HTML, and have it figure if the image is Red or Green. The first option is clearly easier, and is just as effective. Let me know if you need any further assistance in this.

yea, thx, couyld you pls show me how to do this, i couldnt get it to work myself.

also ineed it to run in the system tray, but only if it is easy.

yea this is kinda the first time i have had to do something like this, so im kinda a bit lost. :P

Why not just look for a script that does this? Try searching HotScripts.com. There are plenty there that do just that.

thx ill chk that,

yea ill just put a better description of what i am trying to do.

this server is used to host the game World of Warcraft, and im trying to get a small program to run that will connect to the server, telling me if the server is up or down. but i dont know how to get it to connect to the server properly.

becasue i have never done anything like this before, i would like sum help doing it.

i can make the UI for it, or even better could someone tell me how to get it to run in the system try so that i can keep it running whilst doing other things.

or if anyone knows of somewhere that i can download a program that already does this simply.

For Additional Fun, Add A Timer Control To Do This Every 10 Seconds

tha very much mate

you can use cron or the at command on IX flavored systems for "timing"
SNMPD is designed for monitoring systems. Is also installed on IXs by default and sometimes fault on Windows. Loads of good suggestions on this thread guys.

Wow, Cain, Thanks for that. However, The Forum is "Visual Basic" and to my knowledge (even with the use of wine on a wicked system) VB will NOT Run on a *nix box. I've tried. So, Should the thread be related to merely checking a server's status, that would be awesome, but this is a windows computer programming forum.

Mkay, And The Updated Version, Which is still not perfect and contains some minor flaws, but does exactly what you want. You may need to copy the tray.ocx to your windows\system32 folder, or just replace the one in the project with the one in the zipped folder... either way, the program works like a charm for me.

thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx thx


hmm something is wrong.

when the server is down, it still shows up green and on.

umm, mby i shold chk how they restart the server, mby the server is always on, but the dedicated game console is what they shut down and restart.

ok ill talk to the owner and find out if that is what the do.
thx again though.

if u wanna see what i mean, open this page, http://deep.phpwebhosting.com/~paradox/Chaos%20Knights/ServCheck/ServerCheck.php
when it is red the game is offline, green = online.

the server ip is xaoswow.servegame.com

could u chk it out 4 me pls.

I'll tell you what, you need to either A) Ask the Admin What PORT it runs on (or if you know what port it is, that's cool. You could always be connected to the game, go to a DOS prompt, and run NetStat, and give me the statistics of it.) Once I know the PORT and the Server IP, I'll build you one using Sockets, which will connect to the Game Port of the server, and not just to see if the box itself is up or down.

The page is 8080, but I don't think the port for the game is.

my bad :p

the server runs of prt 3247
i think thats what he said.

It doesn't look like that's correct. I ran a port scan on the server: xaoswow.servegame.com, and that port doesn't show up as being open. At the same time, the web page shows a green box, meaning the server is up. Either you have the port wrong, or the server wrong.

hmmm, my really bad :(

While you are playing the game, hit cntrl-alt-delete, it will load task manager, but more importantly, will bring you back to windows While The Game Is Still Running!
Once Back in windows, click start, go to run, and type in cmd. You will get a black box window (a dos prompt), type in (at the black window) netstat. Take all the information it gives you, and either post it here, or e-mail me all that data. I'll sift through it, and find the server and port needed for this program.

Hi Slavrix,

If you want to know how they did it you could ask then for the source code of their status.php program. That is what determines the color of the square in the web page. In the code of ServerCheck.php you can see them calling it SRC="status.php?link=xaoswow.servegame.com"

Creds to Comatose for inventive uses of .bat files and their results.



i "love" you man thanks very much

one mre little itty bitty question/request is it possible to get it to refresh every 30 sec and for the ip and port to b made into text boxes so the chk is able to used on different servers/comps to?


so wassup, is it doing good?

if done pls somehow send to me cheers.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.