+ Post New Thread
Page 4 of 13 FirstFirst 12345678 ... LastLast
Results 46 to 60 of 187
Wireless Networks Thread, Helpdesk network status. in Technical; Fixed got it working had forgot to restart the server :P...
  1. #46
    DSapseid's Avatar
    Join Date
    Feb 2007
    Location
    West Sussex
    Posts
    1,154
    Thank Post
    130
    Thanked 54 Times in 47 Posts
    Rep Power
    38
    Fixed got it working had forgot to restart the server :P

  2. #47
    DSapseid's Avatar
    Join Date
    Feb 2007
    Location
    West Sussex
    Posts
    1,154
    Thank Post
    130
    Thanked 54 Times in 47 Posts
    Rep Power
    38
    Quote Originally Posted by ittech View Post
    I went a bit far with this Looks cool though!

    How did you get the three columns to appear properly i have spent the last hour trying to do it and it just isnt liking it. I have punched the desk so many times my hand hurts Is it possible for you to send me the full code for that page so i can just change the ip address'.

    Thanks

    Dan

  3. #48

    Join Date
    Feb 2008
    Posts
    90
    Thank Post
    3
    Thanked 3 Times in 3 Posts
    Rep Power
    15
    Hmm i cam getting the following error:

    "PHP Notice: Undefined index: debug in C:\Inetpub\wwwroot\ns\index.php on line 67"

    which is:

    if( $_GET["debug"] == "true" ) { $namesonly = false; }

  4. #49
    stratisphere's Avatar
    Join Date
    Apr 2007
    Posts
    295
    Thank Post
    33
    Thanked 87 Times in 31 Posts
    Rep Power
    31
    Guys, can I just throw my 2 cents worth in here?

    We have a system kind of like what you've all been doing at our school (written myself etc, like much of you!), however i found a problem... once some of the brighter kids figured out that it pinged and connected to several servers to see if they were up (wasnt that hard really... it's the most obvious way of doing it), they spammed it by refreshing a page.

    Now one person doing this doesnt dent the intranet server... but multiply that by a class and boy does it go down quick.

    We solved this by making a php script which did all the checks, then put the results into a DB. This script is run once a minute and can only be run by the server.

    Then the public side of the system, simply iterates through the database and shows the systems and their status.

    This might not be a problem for your schools... but it was for ours as soon as the cat got out the bag!

  5. #50
    stratisphere's Avatar
    Join Date
    Apr 2007
    Posts
    295
    Thank Post
    33
    Thanked 87 Times in 31 Posts
    Rep Power
    31
    Quote Originally Posted by Valentine View Post
    Hmm i cam getting the following error:

    "PHP Notice: Undefined index: debug in C:\Inetpub\wwwroot\ns\index.php on line 67"

    which is:

    if( $_GET["debug"] == "true" ) { $namesonly = false; }
    it's a debug notice... you dont have to listen to it. nothing is wrong that will stop it working. Simple solution is, disable debug notices in your php.ini.

    E.g. mine is
    Code:
    error_reporting  =  E_ALL & ~E_NOTICE
    This shows all errors except for notices and coding standards warnings.

  6. #51

    Join Date
    Feb 2008
    Posts
    90
    Thank Post
    3
    Thanked 3 Times in 3 Posts
    Rep Power
    15
    I see, then in that case i am just having the same problem as John D. Must be something to do with checking the result of the ping command.

    Quote Originally Posted by Doudar View Post
    Have got the code to display ok (IIS) but it says everything is up even when I point it to names/ip address that do not exist? Am I missing something here?

  7. #52

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,417
    Thank Post
    644
    Thanked 965 Times in 665 Posts
    Blog Entries
    2
    Rep Power
    328
    We now use Monit running on a linux box and checks essential ports on our other servers. Our monitrc file is here.

  8. #53
    tomscaper's Avatar
    Join Date
    Jul 2006
    Posts
    814
    Thank Post
    118
    Thanked 29 Times in 15 Posts
    Rep Power
    22
    Quote Originally Posted by stratisphere View Post
    Guys, can I just throw my 2 cents worth in here?

    We have a system kind of like what you've all been doing at our school (written myself etc, like much of you!), however i found a problem... once some of the brighter kids figured out that it pinged and connected to several servers to see if they were up (wasnt that hard really... it's the most obvious way of doing it), they spammed it by refreshing a page.

    Now one person doing this doesnt dent the intranet server... but multiply that by a class and boy does it go down quick.

    We solved this by making a php script which did all the checks, then put the results into a DB. This script is run once a minute and can only be run by the server.

    Then the public side of the system, simply iterates through the database and shows the systems and their status.

    This might not be a problem for your schools... but it was for ours as soon as the cat got out the bag!
    I can see this being a problem in our school too, some of the more clever kids have found out differnt commands and are messing around, not long before they figure out the ping command.

    Any chance of seeing your php script.

  9. #54
    DSapseid's Avatar
    Join Date
    Feb 2007
    Location
    West Sussex
    Posts
    1,154
    Thank Post
    130
    Thanked 54 Times in 47 Posts
    Rep Power
    38
    I can now get it to display in 3 columns but they are 'under' each other (see image). How can i tell it to display these 'next' to each other.
    Attached Images Attached Images

  10. #55

    russdev's Avatar
    Join Date
    Jun 2005
    Location
    Leicestershire
    Posts
    6,975
    Thank Post
    735
    Thanked 557 Times in 372 Posts
    Blog Entries
    3
    Rep Power
    206
    Quote Originally Posted by Valentine View Post
    I see, then in that case i am just having the same problem as John D. Must be something to do with checking the result of the ping command.
    I know the reason I was not getting reports of down servers was due to folk error (once I turned debug on the error msg came up)

    As for undefined error think this will work at line 62:-

    Code:
    if (isset($_GET["debug"])) {
    if( $_GET["debug"] == "true" ) { $namesonly = false; }
    } else {
    }
    Russell

  11. #56

    russdev's Avatar
    Join Date
    Jun 2005
    Location
    Leicestershire
    Posts
    6,975
    Thank Post
    735
    Thanked 557 Times in 372 Posts
    Blog Entries
    3
    Rep Power
    206
    Ok got bored

    Started editing (or maybe hacking away with a big pick axe) the script so will put my version up.

    All credit to above people who made this script etc.

    Main difference are : -

    - adding the above code to stop the debug error
    - Adding a msg at the bottom of the screen that says how many and what servers are down (the as I call it the idiots msg as I can't be bothered to work the table out)
    -If add ?portal=true to the end give you a cutdown view you can add to a portal

    Code:
    <?php
    
    $hosts['10.56.156.16'] = 'LHS-SR-001';
    $hosts['10.56.156.18'] = 'LHS-SR-002';
    $hosts['10.56.157.16'] = 'LHS-SR-SIMS';
    $hosts['10.56.156.15'] = 'Internal Support Server';
    
    
    $ReportedErrors= "";
    $portalview ="";
    
    
    
    if (isset($_GET["portal"])) {
    if( $_GET["portal"] == "true" ) { $portalview = true; }
    } else {
    }
    
    
    						
    ?>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <html>
    <head>
    <style type="text/css">
    <!--
    
    body{margin:0px;padding:0px;font-family: Tahoma, Verdana, Arial, sans-serif;}
    p{font-size:11px;margin:15px;line-height:150%;}
    td{font-size:10px;font-family:Verdana, Tahoma, Verdana, Arial;}
    input{font-size:11px;font-family:Tahoma;}
    img{border:0px;}
    -->
    </style>
    
    <title>Network Status</title>
    </head>
    <body>
    <p style="margin:1px;">
    <table cellspacing="8" align="center">
    <tr>
    
    <?PHP
    if ($portalview == False){
    echo '<td colspan="3" align="center" style="border-bottom:4px solid gray;">
    <span style="color:0080c0;font-size:18pt;font-weight:bold;font-family:tahoma;">Limehurst High School</span><br>
    <span style="color:gray;font-size:13pt;font-weight:normal;font-family:tahoma;"><b>Network</b> Status</span>
    <br>
    
    <!--<img src="printericon.jpg" width="147" height="143"> -->
    <br>
    <br>
    
    </td>';
    }
    ?>
    
    </tr>
    <?php
    function ping($host){
    	$hostconnect = "Ping request could not find host ". $host . ". Please check the name and try again." ;
    	$ipconnect = "    Packets: Sent = 1, Received = 0, Lost = 1 (100% loss)," ;
    	$rv = exec("ping $host -n 1 -w 1");
    	if( $ipconnect == $rv )	{
    		return false;
    	} else {
    		if( $hostconnect == $rv ) {
    		return false;
    	} else {
    		return true;
    	}
    	}
    }
    
    $namesonly = true;
    
    if (isset($_GET["debug"])) {
    if( $_GET["debug"] == "true" ) { $namesonly = false; }
    } else {
    }
    
    
    
    $faultcount = 0;
    
    foreach($hosts as $ip=>$name){
    	if( $namesonly == true ){
    		$txt = "$name";
    	} else {
    		$txt = "$name <span style=\"font-weight: normal;\">($ip)</span>";
    	}
    
    	if(ping($ip)){
      		echo '<tr><td style="font-size:11px;">'.$txt.'</td><td width="16">&nbsp;</td><td align="center"><span style="color:#008000;"><strong>Up</strong></span></td></tr>'."\n";
    	} else {
    		echo '<tr><td style="font-size:11px;">'.$txt.'</td><td width="16">&nbsp;</td><td align="center"><span style="color:red;"><strong>Down</strong></span></td></tr>'."\n";
    		$ReportedErrors = $ReportedErrors . $name . ", ";
    		$faultcount++;
    		
    	}
    }
    
    ?>
    </table>
    <?PHP
    
    if ($faultcount>0) {
    echo "<center> <SPAN style=\"font-size: 11pt\"><span style=\"color:red;\"><strong>There Are Currently $faultcount Connection Errors. <br> The Servers That Have Errors Are $ReportedErrors</strong></center></span></span>";}
    
    ?>
    
    
    
    </p>
    </body>
    </html>
    Last edited by russdev; 2nd April 2008 at 04:26 PM.

  12. #57

    russdev's Avatar
    Join Date
    Jun 2005
    Location
    Leicestershire
    Posts
    6,975
    Thank Post
    735
    Thanked 557 Times in 372 Posts
    Blog Entries
    3
    Rep Power
    206
    I have asked fn to put this thread on the wiki...

    Thought might be interested just got bored again and started hacking the script and now made it so that when added portal=true value to end of the url it either displays either

    "All Servers Are Fine" or
    "There Are Currently 1 Connection Errors. The Servers That Have Errors Are.."

    Again all credit goes to above people I just hacked away the code.

    Code:
    <?php
    
    $hosts['90.56.156.16'] = 'LHS-SR-001';
    $hosts['10.56.156.18'] = 'LHS-SR-002';
    $hosts['10.56.157.16'] = 'LHS-SR-SIMS';
    $hosts['10.56.156.15'] = 'Internal Support Server';
    
    
    $ReportedErrors= "";
    $portalview ="";
    
    function ping($host){
    	$hostconnect = "Ping request could not find host ". $host . ". Please check the name and try again." ;
    	$ipconnect = "    Packets: Sent = 1, Received = 0, Lost = 1 (100% loss)," ;
    	$rv = exec("ping $host -n 1 -w 1");
    	if( $ipconnect == $rv )	{
    		return false;
    	} else {
    		if( $hostconnect == $rv ) {
    		return false;
    	} else {
    		return true;
    	}
    	}
    }
    
    if (isset($_GET["portal"])) {
    
    if( $_GET["portal"] == "true" ) { $portalview = true; }
    } else {
    }
    
    
    						
    ?>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <html>
    <head>
    <style type="text/css">
    <!--
    
    body{margin:0px;padding:0px;font-family: Tahoma, Verdana, Arial, sans-serif;}
    p{font-size:11px;margin:15px;line-height:150%;}
    td{font-size:10px;font-family:Verdana, Tahoma, Verdana, Arial;}
    input{font-size:11px;font-family:Tahoma;}
    img{border:0px;}
    -->
    </style>
    
    <title>Network Status</title>
    </head>
    <body>
    <p style="margin:1px;">
    <table cellspacing="8" align="center">
    <tr>
    
    <?PHP
    if ($portalview == False){
    echo '<td colspan="3" align="center" style="border-bottom:4px solid gray;">
    <span style="color:0080c0;font-size:18pt;font-weight:bold;font-family:tahoma;">Limehurst High School</span><br>
    <span style="color:gray;font-size:13pt;font-weight:normal;font-family:tahoma;"><b>Network</b> Status</span>
    <br>
    
    <!--<img src="printericon.jpg" width="147" height="143"> -->
    <br>
    <br>
    
    </td>';
    }
    ?>
    
    </tr>
    <?php
    
    
    $namesonly = true;
    
    if (isset($_GET["debug"])) {
    if( $_GET["debug"] == "true" ) { $namesonly = false; }
    } else {
    }
    
    
    $txt = "";	
    $faultcount = 0;
    
    foreach($hosts as $ip=>$name){
    	if( $namesonly == true ){
    		if ($portalview == False){
    			$txt = "$name";
    		}
    	} else {
    		if ($portalview == False){
    			$txt = "$name <span style=\"font-weight: normal;\">($ip)</span>";
    		}
    	}
    
    	if(ping($ip)){
      		if ($portalview == False){
    			echo '<tr><td style="font-size:11px;">'.$txt.'</td><td width="16">&nbsp;</td><td align="center"><span style="color:#008000;"><strong>Up</strong></span></td></tr>'."\n";
    		}
    	} else {
    		if ($portalview == False){
    			echo '<tr><td style="font-size:11px;">'.$txt.'</td><td width="16">&nbsp;</td><td align="center"><span style="color:red;"><strong>Down</strong></span></td></tr>'."\n";
    		}
    		$ReportedErrors = $ReportedErrors . $name . ", ";
    		$faultcount++;
    		
    	}
    }
    
    ?>
    </table>
    <?PHP
    
    if ($faultcount>0) {
    echo "<center> <SPAN style=\"font-size: 11pt\"><span style=\"color:red;\"><strong>There Are Currently $faultcount Connection Errors. <br> The Servers That Have Errors Are $ReportedErrors</strong></center></span></span>";
    }else {
    echo "<center> <SPAN style=\"font-size: 11pt\"><span style=\"color:#008000;\"><strong>All Servers Are Fine</strong></span></span>";}
    ?>
    
    
    
    </p>
    </body>
    </html>
    Russ

  13. #58

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,323
    Thank Post
    903
    Thanked 1,801 Times in 1,550 Posts
    Blog Entries
    12
    Rep Power
    467
    Its been on the wiki for a while, but not the new code. You can find it here: Helpdesk network status - EduGeek.net Wiki

    I did announce it in this post: New & Updated Wiki Pages

  14. #59

    russdev's Avatar
    Join Date
    Jun 2005
    Location
    Leicestershire
    Posts
    6,975
    Thank Post
    735
    Thanked 557 Times in 372 Posts
    Blog Entries
    3
    Rep Power
    206
    Sorry missed that one.

  15. #60

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,323
    Thank Post
    903
    Thanked 1,801 Times in 1,550 Posts
    Blog Entries
    12
    Rep Power
    467
    no worries



SHARE:
+ Post New Thread
Page 4 of 13 FirstFirst 12345678 ... LastLast

Similar Threads

  1. BCS Charter Status
    By russdev in forum Educational IT Jobs
    Replies: 13
    Last Post: 14th February 2008, 02:40 PM
  2. Just got a letter about Single Status through
    By j17sparky in forum General Chat
    Replies: 17
    Last Post: 31st October 2007, 02:33 PM
  3. Single Status
    By faza in forum General Chat
    Replies: 36
    Last Post: 2nd February 2007, 10:37 AM
  4. Just got ICT college status YAY!!!
    By Mr_T in forum General Chat
    Replies: 3
    Last Post: 1st February 2007, 01:20 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •