Forum Thread
  Posts  
Server status checks. (Forums : Coding & Scripting : Server status checks.) Locked
Thread Options
jacksonj04
jacksonj04 Over 9000
Feb 22 2003 Anchor

OK, I give in. How the hell do you do them (i.e. it gives you an online/offline report). I've tried sockets, file opening etc. and really can't be bothered going through every option that *may* do it.

--

Barcode Imagejacksonj04 the generally helpful one
Lost, confused or just need a virtual cuddle? PM me.
Need urgent help from staff? PM us all.

Feb 22 2003 Anchor

First off, Hotscripts.com is the bible.

Server Status 2
Price: Free (GPL)

Server Status 2 is primarily aimed at web hosts who wish to display the status of their servers to clients but this software has found other uses. One unique feature is that it allows the grouping of servers based on the services they provide (HTTP,FTP etc) so you can display the status of DNS servers etc. It includes an announcement feature, easy addition of new service monitoring (for less used ports), full online administration panel and template based design for easy customisation.

Found in: PHP/Scripts and Programs/Server Management

--

Why wont it save me?

jacksonj04
jacksonj04 Over 9000
Feb 22 2003 Anchor

Another PHP bible!

Edit: Too bulky, I need a very slim one which literally says if a server is online or not.

At the moment I'm using fsockopen. This works perfectly (except for a timeout bug which I'm ironing out) but the errors it generates when the server is unavailable include an exit(); which means I can't report the problem back. error_reporting (0); doesn't help since they still exit.

- Edited By jacksonj04 On Sat 22nd, Feb 2003 @ 7:23:39pm

--

Barcode Imagejacksonj04 the generally helpful one
Lost, confused or just need a virtual cuddle? PM me.
Need urgent help from staff? PM us all.

Feb 22 2003 Anchor

[url=http://www.hotscripts.com/PHP/Scripts and Programs/Server Management]You checked [/url] through all those?

- Edited By azz0r On Sat 22nd, Feb 2003 @ 6:57:31pm

--

Why wont it save me?

Feb 22 2003 Anchor

grrrr

--

Why wont it save me?

jacksonj04
jacksonj04 Over 9000
Feb 22 2003 Anchor

Yep, Ive gone through them all and they all use the exact commands and syntax I'm using, except they seem to somehow avoid killing the script on error.

--

Barcode Imagejacksonj04 the generally helpful one
Lost, confused or just need a virtual cuddle? PM me.
Need urgent help from staff? PM us all.

INtense!
INtense! End Boss
Feb 23 2003 Anchor

instead of just going fsockopen(); add an @ to the front i.e. @fsockopen(); that shall supress all errors and hence your script shall still work. Just outta interest, what servers are you quering? game servers?

--

Scott Reismanis
DBolical | @scottreismanis

jacksonj04
jacksonj04 Over 9000
Feb 23 2003 Anchor

Tried @fsockopen(); before, no different...

It's to check the status of a streaming server which suffers occasional downtime (i.e. power failure, connection failure). Dad incapable of a decent static server, so I run the script off mine and tell him to point links to it.

edit: OK I've tracked down the problem and now I'm officially scared. The output includes stuff that I didn't even add...

When the server is up it's a straight server-side redirect. It works fine.

When the server is down, however, this should happen:

}else{
echo ("<html>

<head>
<title>Streaming Server Check</title>
<style>
<!--
body         { color: #000000; font-family: Arial; background-color: #FFFFFF }
-->
</style>
</head>

<body>

<table border="0" width="600" cellspacing="0" cellpadding="0">
<tr>
<td width="140" height="75"><img border="0" src="bubbles.gif" align="middle" width="140" height="75"></td>
<td width="10">
<p align="left"></td>
<td width="450"><font size="6">Streaming Server Check</font></td>
</tr>
</table>

&lt;p&gt;The server is <b>&lt;font color=&quot;red&quot;&gt;offline&lt;/font&gt;</b> and unavailable, please try again later.&lt;/p&gt;

&lt;/body&gt;

&lt;/html&gt;&quot;);
};

However, this is what the source appears as:

&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt;
&lt;HTML&gt;&lt;HEAD&gt;
&lt;META http-equiv=Content-Type content=&quot;text/html; charset=iso-8859-1&quot;&gt;&lt;/HEAD&gt;
&lt;BODY&gt;&lt;/BODY&gt;&lt;/HTML&gt;

before you ask, yes the quotes in the echo are commented out.

- Edited By jacksonj04 On Sun 23rd, Feb 2003 @ 6:00:00pm

Edit 2: There should be bold < b>< /b> tags around the font coloring, but HTML and mDBcode seem to work in code samples *cough*bug*cough*

- Edited By jacksonj04 On Sun 23rd, Feb 2003 @ 6:02:03pm
- Edited By jacksonj04 On Sun 23rd, Feb 2003 @ 6:03:35pm

--

Barcode Imagejacksonj04 the generally helpful one
Lost, confused or just need a virtual cuddle? PM me.
Need urgent help from staff? PM us all.

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.