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
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
