+ Reply to Thread
Results 1 to 4 of 4

Thread: Server Status & Server Load

  1. #1
    coolv1994's Avatar
    coolv1994 is offline x10 Elder coolv1994 is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    505

    Server Status & Server Load

    I got really bored and made a server status and server load script.
    PHP Code:
    <?php
    // Server Info
    $name "";
    $ip "";
    // Ports
    $http "80";
    $mysql "3306";
    $exim "25";
    $cpanel "2082";
    $ftp "21";
    $dns "53";
    // Checks The Server
    $chhttp = @fsockopen(server($ip), $http$errno$errstr20);
    $chmysql = @fsockopen(server($ip), $mysql$errno$errstr20);
    $chexim = @fsockopen(server($ip), $exim$errno$errstr20);
    $chcpanel = @fsockopen(server($ip), $cpanel$errno$errstr20);
    $chftp = @fsockopen(server($ip), $ftp$errno$errstr20);
    $chdns = @fsockopen(server($ip), $dns$errno$errstr20);
    // Online Or Offline
    $on "Online";
    $off "Offline";
    //Server Load
    $loadresult = @exec('uptime');
    preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/",
    $loadresult,$avgs);
    $svrld=(($avgs[1]/8)*100);
    ?> 
    Server Name: <?php echo $name?>
    IP Address: <?php echo $ip?>
    Server Load: <?php echo $svrld?>
    HTTP: <?php if (!$chhttp){ echo $off; } else { echo $on; }; ?>
    MySQL: <?php if (!$chmysql){ echo $off; } else { echo $on; }; ?>
    Exim: <?php if (!$chexim){ echo $off; } else { echo $on; }; ?>
    cPanel: <?php if (!$chcpanel){ echo $off; } else { echo $on; }; ?>
    FTP: <?php if (!$chftp){ echo $off; } else { echo $on; }; ?>
    DNS: <?php if (!$chdns){ echo $off; } else { echo $on; }; ?>
    I made it for the x10Panel but it probally won't be used so if you want to use it go ahead.
    For the server load you need to change the 8 to how many cores your processer has.
    PHP Code:
    $svrld=(($avgs[1]/change this)*100); 

  2. #2
    vikasghj is offline x10Hosting Member vikasghj is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    22

    Re: Server Status & Server Load

    I thanked you . It was an useful script

  3. #3
    Danielx386 is offline x10 Elder Danielx386 is an unknown quantity at this point
    Join Date
    Oct 2009
    Location
    Australia
    Posts
    698

    Re: Server Status & Server Load

    Can this be used as a php page in my wordpress admin panel?

  4. #4
    felabria is offline x10Hosting Member felabria is an unknown quantity at this point
    Join Date
    Sep 2009
    Location
    The Netherlands
    Posts
    88

    Re: Server Status & Server Load

    I give it a 7 not good described
    Greetz, Brian

+ Reply to Thread

Similar Threads

  1. Starka server status?
    By ipodtouchforum in forum Free Hosting
    Replies: 13
    Last Post: 05-26-2009, 02:40 AM
  2. Free Teamspeak2 Virtual Private Server (VPS)
    By lokiklown in forum Gamer's Lounge
    Replies: 8
    Last Post: 01-03-2009, 07:12 PM
  3. My server status just like a flickering lamp!
    By anhminh in forum Free Hosting
    Replies: 1
    Last Post: 05-23-2008, 05:22 AM
  4. samba server issue
    By hopper in forum Computers & Technology
    Replies: 2
    Last Post: 04-13-2008, 11:59 PM
  5. Server Status API
    By knightcon in forum Free Hosting
    Replies: 2
    Last Post: 03-17-2008, 10:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers