Topic awaiting preservation: How to show the status of a site on another page? |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: under your rug, |
posted 06-15-2002 09:55
Sorry if this isn't the correct section for this, i'm not really sure how it would be done so i'm here |
Bipolar (III) Inmate From: |
posted 06-15-2002 18:30
I'm still a php novice myself but the first thing that came to mind is to make a mysql database on your server, it can be empty, then wherever you want the on off graphics to be on your page include a php script that tries to connect to the database. If it connects, the server is up, have it display your on graphic if it doesn't just tell it to die nice and show the off graphic. I'm sure there has to be a better way but I don't know it yet heh. |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 06-16-2002 01:08
I always recommend PHP for all scripting and many here will agree: |
Paranoid (IV) Inmate From: under your rug, |
posted 06-16-2002 09:31
Thanks for all the info |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 06-16-2002 10:55
Synthetic, I wrote you a PHP script that can do what you want. You can get it from here: http://www.maxworld.co.yu/ozone/server_status.php.txt All necessary information are located inside the script as comments... |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 06-17-2002 17:53 |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 06-17-2002 23:07
In addition to that function, PHP also comes with a full set of various TCP/IP socket related functions, which can be used to write full featured web server. Just take a look at nanoweb... |
Maniac (V) Inmate From: Florida |
posted 06-18-2002 10:47
Max the script looks good. |
Paranoid (IV) Inmate From: under your rug, |
posted 06-18-2002 11:26
Wow thanks maX, your the man as usual !!! |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 06-18-2002 17:38
Kriek, did you set correct file permissions on 'server_status.inc' file (CHMOD 666 or 777). Also, after running the 'server_status.php' script, open 'server_status.inc' file in you favorite text editor and see if it contains the message or not (if it doesn't contain anything, php script can't write to that file for some reason). If it still doesn't work, show me how you configured the script and how you're calling it... |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 06-18-2002 18:45
I swear the first time I tried this, I just got a blank page. No errors, nothing. Everything was configured right. |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 06-18-2002 19:25
Ahhhhh, I completely forgot about this. Since 'server_status.inc' is newly created file and since the script checks its modification status, it won't update it until amount of time specified in $interval variable passes. So, I can classify this as desired behavior, although it can be fixed very easy... |
Maniac (V) Inmate From: Florida |
posted 06-19-2002 06:22
quote:
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 06-19-2002 07:02
Just create an array of servers. |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 06-19-2002 09:47 |
Paranoid (IV) Inmate From: under your rug, |
posted 06-19-2002 17:01
Thanks a lot to everyone that helped, super thanks to maX for the custom script |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 06-19-2002 22:45
ohhh I get it, nah MAx I was asking about your's I thought the interval was for some sort of timeout or perl sleep function but it's just there to prevent the check from happening everytime the page is hit correct? |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 06-19-2002 23:05
Synthetic, you can also use IP address instead of domain name. No changes are necessary... |
Paranoid (IV) Inmate From: under your rug, |
posted 06-20-2002 23:27
thanks maX i'll try it out right now, hey what if I wanted to check the status of a ftp server or a web site that was run of a port other than the default port 80 |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 06-21-2002 03:07
The port is the second bit passed to fsockopen so you can switch the port there. |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 06-21-2002 06:35 |
Paranoid (IV) Inmate From: under your rug, |
posted 05-26-2003 07:24
Hey thanks again this has been working just great |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 05-26-2003 19:43
afaik you shouldn't need to. when in doubt you can always give it a try though |
Paranoid (IV) Inmate From: under your rug, |
posted 05-27-2003 01:44
Server was down last night so actually I couldn't lol, kinda why I came to ask about it in the meantime |