Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    Join Date
    Feb 2006
    Location
    Inside your PC
    Posts
    1,626
    Tokens
    0

    Latest Awards:

    Default [TUT] Making a Server Status/ System Check page

    Today i bring to you my first piece of php work which i find to be quite nice.

    It may not be the hardest thing to do but some people will like this

    This is an adaption of a simple free existing script but vastly improved and styles so using images instead of words to show online services and offline services and it has had more added to it

    Example: http://www.xtremehosts.co.uk/server

    First off start by opening up a blank notepad

    Then copy and paste this into it:
    PHP Code:
    <style type="text/css">
    <!--
    .style3 {
     font-family: verdana;
     font-size: 12px;
    }
    -->
    </style>
    <p class="style3"> Use this page to check the status of any system on our server</p>
    <p class="style3">Server Status:<br />
    </p>
    <?php
    //You can replace the domain with an IP if you wish 
    $site "Your IP Goes here";
    $http fsockopen($site80);
    $ftp fsockopen($site21);
    $pop3 fsockopen($site110);
    $cPanel fsockopen($site2082);
    $WHM fsockopen($site2086);
    if (
    $http) { 
     
    $status .= '<p><font face="Verdana" size="2">Http Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">Http Status: <img src="/images/ball_red.gif"></p>';

    if (
    $ftp) { 
     
    $status .= '<p><font face="Verdana" size="2">FTP Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">FTP Status: <img src="/images/ball_red.gif"></p>';

    if (
    $pop3) { 
     
    $status .= '<p><font face="Verdana" size="2">POP3/SMTP Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">POP3/SMTP Status: <img src="/images/ball_red.gif"></p>';

    if (
    $cPanel) { 
     
    $status .= '<p><font face="Verdana" size="2">cPanel Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">cPanel Status: <img src="/images/ball_red.gif"></p>';

    if (
    $WHM) { 
     
    $status .= '<p><font face="Verdana" size="2">WHM Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">WHM Status: <img src="/images/ball_red.gif"></p>';

    echo(
    "$status");

    ?>
    Ok now the breakdown

    This code is the IP/Domain of the server we are going to check:
    PHP Code:
    $site "Your IP Goes here"
    This code checks the status of each port. For example we have Port 80 and Port 21 which are http and Ftp. You can have it check any Port on the server but in this it checks:
    HTTP
    FTP
    POP3/SMTP
    cPanel
    WHM
    PHP Code:
    $http fsockopen($site80);
    $ftp fsockopen($site21);
    $pop3 fsockopen($site110);
    $cPanel fsockopen($site2082);
    $WHM fsockopen($site2086); 
    This part of the code displays the results of the check
    PHP Code:
    if ($http) { 
     
    $status .= '<p><font face="Verdana" size="2">Http Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">Http Status: <img src="/images/ball_red.gif"></p>';

    if (
    $ftp) { 
     
    $status .= '<p><font face="Verdana" size="2">FTP Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">FTP Status: <img src="/images/ball_red.gif"></p>';

    if (
    $pop3) { 
     
    $status .= '<p><font face="Verdana" size="2">POP3/SMTP Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">POP3/SMTP Status: <img src="/images/ball_red.gif"></p>';

    if (
    $cPanel) { 
     
    $status .= '<p><font face="Verdana" size="2">cPanel Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">cPanel Status: <img src="/images/ball_red.gif"></p>';

    if (
    $WHM) { 
     
    $status .= '<p><font face="Verdana" size="2">WHM Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">WHM Status: <img src="/images/ball_red.gif"></p>';

    And finally this part of the code echo's the output and makes it visible on the PHP page we have created:
    PHP Code:
    echo("$status"); 
    This is my first tutorial on how to make a Server System check page. This is a seriously modified version of a simple PHP code on hostpapers

    There is obviously room for expansion and more for what you can do with this and if you do modify do share your changes with people so that we can all update our script to include any new features you may develop. Remember to leave a link to a working Demo

    Thanks and Enjoy

    (please note replace the path to the online and offline images with your own as the ones i have are the ones i have chosen to use. You may have a different choice as to what you wish to use. Mine are from WHMCS billing system)

    J1MI (Forum Moderator) - Thread moved to Website Tutorials. Nice Tut
    Last edited by J1MI; 22-09-2006 at 09:19 AM.

  2. #2

    Default

    ent this from techtuts

    OK edit veryt sorry as daves just explained on msn
    Last edited by Speed-networks2; 21-09-2006 at 03:52 PM.

  3. #3
    Join Date
    Feb 2006
    Location
    Inside your PC
    Posts
    1,626
    Tokens
    0

    Latest Awards:

    Default

    No techtuts one displays this http://www.xtremehosts.co.uk/serverload.php

  4. #4
    Join Date
    May 2005
    Location
    /etc/passwd
    Posts
    19,110
    Tokens
    1,139

    Latest Awards:

    Default

    wont work on non cpanel hosts though
    Quote Originally Posted by Chippiewill View Post
    e-rebel forum moderator
    :8

  5. #5
    Join Date
    Feb 2006
    Location
    Inside your PC
    Posts
    1,626
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by :.:Numark:.: View Post
    wont work on non cpanel hosts though

    Thats easy change the ports to their respective ports for Plesk etc

    This was written for cPanel

    Can be easily modified to work with plesk if you change the ports

  6. #6
    Join Date
    May 2005
    Location
    /etc/passwd
    Posts
    19,110
    Tokens
    1,139

    Latest Awards:

    Default

    how would i get it to work with 1and1 CP?
    Quote Originally Posted by Chippiewill View Post
    e-rebel forum moderator
    :8

  7. #7
    Join Date
    Jul 2005
    Location
    -
    Posts
    2,995
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Dude2892 View Post
    Today i bring to you my first piece of php work which i find to be quite nice.

    It may not be the hardest thing to do but some people will like this

    This is an adaption of a simple free existing script but vastly improved and styles so using images instead of words to show online services and offline services and it has had more added to it

    Example: http://www.xtremehosts.co.uk/server

    First off start by opening up a blank notepad

    Then copy and paste this into it:
    PHP Code:
    <style type="text/css">
    <!--
    .style3 {
     font-family: verdana;
     font-size: 12px;
    }
    -->
    </style>
    <p class="style3"> Use this page to check the status of any system on our server</p>
    <p class="style3">Server Status:<br />
    </p>
    <?php
    //You can replace the domain with an IP if you wish 
    $site "Your IP Goes here";
    $http fsockopen($site80);
    $ftp fsockopen($site21);
    $pop3 fsockopen($site110);
    $cPanel fsockopen($site2082);
    $WHM fsockopen($site2086);
    if (
    $http) { 
     
    $status .= '<p><font face="Verdana" size="2">Http Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">Http Status: <img src="/images/ball_red.gif"></p>';

    if (
    $ftp) { 
     
    $status .= '<p><font face="Verdana" size="2">FTP Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">FTP Status: <img src="/images/ball_red.gif"></p>';

    if (
    $pop3) { 
     
    $status .= '<p><font face="Verdana" size="2">POP3/SMTP Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">POP3/SMTP Status: <img src="/images/ball_red.gif"></p>';

    if (
    $cPanel) { 
     
    $status .= '<p><font face="Verdana" size="2">cPanel Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">cPanel Status: <img src="/images/ball_red.gif"></p>';

    if (
    $WHM) { 
     
    $status .= '<p><font face="Verdana" size="2">WHM Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">WHM Status: <img src="/images/ball_red.gif"></p>';

    echo(
    "$status");

    ?>
    Ok now the breakdown

    This code is the IP/Domain of the server we are going to check:
    PHP Code:
    $site "Your IP Goes here"
    This code checks the status of each port. For example we have Port 80 and Port 21 which are http and Ftp. You can have it check any Port on the server but in this it checks:
    HTTP
    FTP
    POP3/SMTP
    cPanel
    WHM
    PHP Code:
    $http fsockopen($site80);
    $ftp fsockopen($site21);
    $pop3 fsockopen($site110);
    $cPanel fsockopen($site2082);
    $WHM fsockopen($site2086); 
    This part of the code displays the results of the check
    PHP Code:
    if ($http) { 
     
    $status .= '<p><font face="Verdana" size="2">Http Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">Http Status: <img src="/images/ball_red.gif"></p>';

    if (
    $ftp) { 
     
    $status .= '<p><font face="Verdana" size="2">FTP Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">FTP Status: <img src="/images/ball_red.gif"></p>';

    if (
    $pop3) { 
     
    $status .= '<p><font face="Verdana" size="2">POP3/SMTP Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">POP3/SMTP Status: <img src="/images/ball_red.gif"></p>';

    if (
    $cPanel) { 
     
    $status .= '<p><font face="Verdana" size="2">cPanel Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">cPanel Status: <img src="/images/ball_red.gif"></p>';

    if (
    $WHM) { 
     
    $status .= '<p><font face="Verdana" size="2">WHM Status: <img src="/images/ball_green.gif"></p>'

    else { 
     
    $status .= '<p><font face="Verdana" size="2">WHM Status: <img src="/images/ball_red.gif"></p>';

    And finally this part of the code echo's the output and makes it visible on the PHP page we have created:
    PHP Code:
    echo("$status"); 
    This is my first tutorial on how to make a Server System check page. This is a seriously modified version of a simple PHP code on hostpapers

    There is obviously room for expansion and more for what you can do with this and if you do modify do share your changes with people so that we can all update our script to include any new features you may develop. Remember to leave a link to a working Demo

    Thanks and Enjoy

    (please note replace the path to the online and offline images with your own as the ones i have are the ones i have chosen to use. You may have a different choice as to what you wish to use. Mine are from WHMCS billing system)
    hmm that is perfectly coded, also works, maybe put in tut section (mod)

  8. #8
    Join Date
    Feb 2006
    Location
    Inside your PC
    Posts
    1,626
    Tokens
    0

    Latest Awards:

    Default

    Thanks

    Im continuing to develop the server file and may look into adding more pages to it

    Im working on uptime and showing space used in a bar

    Its not easy making a bar show space used out of 100%

    If anyone feels like helping feel free to try and post on this thread

  9. #9
    Join Date
    Feb 2006
    Location
    Inside your PC
    Posts
    1,626
    Tokens
    0

    Latest Awards:

    Default

    harder than i thought to develop

  10. #10
    Join Date
    Sep 2006
    Posts
    61
    Tokens
    0

    Default

    Nice tut I Would of +rep but nah I only +reps to people who are kind!

Page 1 of 3 123 LastLast

Posting Permissions

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