Obtaining various information from other servers

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
TheOracle
Forum Commoner
Posts: 64
Joined: Mon Nov 22, 2004 4:56 am
Location: Bedford, UK

Obtaining various information from other servers

Post by TheOracle »

Hi All,

I want to write a script which basically 'polls' a specified IP address for certain info. I need to monitor the 'server uptime', 'webserver status', and or any other ports i.e. for game servers.

Can this be done in PHP?

Hope you can help.
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

you can use the exec() command. you can also try a fopen() or a file_get_contents() on a webserver. i don't know how to check a different port with anything but exec()
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

depending on the protocol supported, fsockopen() or curl may also be of use.
Post Reply