Server Status Script

Something else for Armagetron? Goody!
Post Reply
User avatar
numinit
On Lightcycle Grid
Posts: 23
Joined: Sat Dec 06, 2008 5:52 am

Server Status Script

Post by numinit »

Hi all-

I made an Armagetron server status script with armagetron-php-client.php. It's free to use for all. :D

For all you server admins out there, here's how it works.

The URL is http://www.internaldrive.info/scripts/server_info.php. This script uses PHP's $_GET[] array so it takes some parameters and can deal with spaces.

Parameters:
host: The host IP or domain name of the server you want to poll
port: The port of the server you want to poll
name: The static name of the server you want to poll. The script uses this name if the server is down.

You can poll as many servers as you want at once. Just append numbers to the query vars.

For example, this one polls my server (internalDrive -=- iD Tech Camps) which happen to be hosted on the same server as the script.

http://www.internaldrive.info/scripts/server_info.php?host1=localhost&port1=4534&name1=internalDrive%20-=-%20iD%20Tech%20Camps

This one polls both of my servers.
http://www.internaldrive.info/scripts/server_info.php?host1=localhost&port1=4534&name1=internalDrive%20-=-%20iD%20Tech%20Camps&host2=localhost&port2=4535&name2=internalDrive%20-=-%20iD%20Tech%20Racing

You can add as many servers as you want simply by using query vars. This one polls 5 servers at once.

http://www.internaldrive.info/scripts/server_info.php?host1=localhost&port1=4534&name1=internalDrive%20-=-%20iD%20Tech%20Camps&host2=localhost&port2=4535&name2=internalDrive%20-=-%20iD%20Tech%20Racing&host3=mastercontrolprogram.de&port3=4534&name3=WILDCAT&host4=lagtest.net&port4=4534&name4=Wild%20West%20=Fortress%20Shootout=&host5=lagtest.net&port5=4535&name5=Wild%20West%20=Wild%20Fortress=

Of course, you don't have to use %20 for a space, as it converts automatically. Anyway, have fun and feel free to embed it on your server. Go insane with it! I want to see someone put together a URL that polls 50 servers. :P
Anyway, about embedding...

If you run PHP on your server, it's pretty easy. Just set the query vars with $_GET[]. Otherwise, make an iframe or something.

Code: Select all

<?php
$_GET["host1"] = "localhost";
$_GET["port1"] = 4534;
$_GET["name1"] = "internalDrive -=- iD Tech Camps";

$_GET["host2"] = "localhost";
$_GET["port2"] = 4535;
$_GET["name2"] = "internalDrive -=- iD Tech Racing";

include("http://www.internaldrive.info/scripts/server_info.php");
?>
It echoes the information as plain text, so it adjusts to your page format. This is what I have running on http://www.internaldrive.info.

If you guys have any questions, suggestions, or something just doesn't work, just post about it here and I'll try to fix it. You want a new query var to change how it displays stuff? You got it. How about query vars for colors? Sure! Player counters? Ladder logs? I'm open for suggestions. I just made this script last night, but it works pretty well. The only thing that may need some adjustment is IP address validation. :)

-Morgan [a.k.a. Master Chief, admin of internalDrive servers]
User avatar
-=VcL.Rajinn
Round Winner
Posts: 242
Joined: Fri Aug 29, 2008 9:35 pm

Re: Server Status Script

Post by -=VcL.Rajinn »

Very nice :) Thanks!
Image
CodeBlock
Posts: 2
Joined: Mon Jun 22, 2009 7:23 pm

Re: Server Status Script

Post by CodeBlock »

Hey, any chance of releasing the source to this?
CodeBlock
Posts: 2
Joined: Mon Jun 22, 2009 7:23 pm

Re: Server Status Script

Post by CodeBlock »

Also I keep getting "Error Resolving Hostname". It was working a few hours ago. Is this going to be fixed soon? :(
User avatar
numinit
On Lightcycle Grid
Posts: 23
Joined: Sat Dec 06, 2008 5:52 am

Re: Server Status Script

Post by numinit »

It should work now. I don't know why it didn't work earlier... I will release other versions that fix stuff like that.

Here's the source code, released under GPL.
server_info.zip
Server Info Script version 1.0.0: GPL Source Code
(7.73 KiB) Downloaded 382 times
Post Reply