AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Sat Feb 19, 2005 11:13 pm Post subject: A Server Status Script |
|
|
Hello,
I have made a server status script for those of you who have multiple servers. It is quite straight forward and is made in JavaScript. Here goes:
Code: |
<html>
<body bgcolor="#000000" text="#FFFFFF" topmargin="0" leftmargin="0" onload="wait()">
<font size="2" face="tahoma">
<script type="text/javascript">
var Pic= new Array(10);
Pic[0] = new Image();
Pic[0].src = "images/offline.gif";
Pic[1] = new Image();
Pic[1].src = "http://your_website_to_check/online.gif";
function wait() {
setTimeout("swappic1()", 2000);
}
function swappic1() {
if (Pic[1].complete)
document.linetest1.src = Pic[1].src
else
document.linetest1.src = Pic[0].src;
}
</script>
Server One <img src="images/wait.gif" name="linetest1" alt="checking site 1" align="middle">
</body>
</html>
|
This is designed to go in an iFrame which I use on my site. It works by looking for a picture called 'online.gif'. If it has found it, it displays the picture from that server, if not, it times out after the time you specify.
I hope this script will help people with multiple servers.
NB: You will need to change the 'your_website_to_check' bit in the JavaScript to your own website first!
Cheers,
Andy (aka, The Inquisitor) _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|