Web Hosting Talk







View Full Version : Monitoring a server


hoot
03-14-2002, 05:39 AM
Hi I have had an idea and I think that I have worked out how to do it, but I stil need a bit of help with the code.
I've got 2 servers and I want to have an up or down status bar for each of them.
So this is what I think would work:

Have the dns for my main domain set to
IP1 : 1st server
IP2 : 2nd server

This way when server 1 is down I can have it say Server 1 DOWN
Server 2 UP
And on the site on server 1 I can always have : server 1 UP
Now the only problem is checking server 2 is up.
All I need is server 1 to go and try to read a file and if it manages say server UP and if it fails says the server is down
This way I think that I have all the combinations except for when they are both down but in this case the site would be down anyway :)
Does any one know how to do this with PHP ?
Also is there a way to ping a server with php??

Thanks in advance,

hoot

hoot
03-14-2002, 08:28 AM
maybe this isn't possible ...
if not could someone tell me how rackshack does it? I'm sure there must be some free script that should enable me to do this ....

Any ideas??

cyrusTvirus
03-14-2002, 09:29 AM
Hi,

I'm looking for the same sort of script. Which enables us to use some sort of loadbalancing.

Robbert

hoot
03-14-2002, 01:38 PM
I think that you misunderstood what I'm looking for, nothing to do with loadbalancing , just to show when each server is up or not. With just the dns set so that if one server goes down the other one will take over ...

Any ideas how I could show from the site which servers are down or up?

ScottD
03-14-2002, 01:43 PM
The DNS trick would be kind of overkill. I would recommend you let DNS to DNS and only DNS and use something like Netsaint (www.netsaint.org) to do your network monitoring.

CagedTornado
03-20-2002, 10:23 PM
If you wanted some kind of 'hot spare' failover system, I highly recommend you don't re-invent the wheel. Check out the Linux 'High availability' project at http://linux-ha.org/ -- specifically the work they've done with the heartbeat protocol.

Dan