Results 1 to 5 of 5

Thread: Public page with status of server load

  1. #1
    Member
    Join Date
    Jun 2007
    Posts
    9

    Default Public page with status of server load

    Hello,

    I want to put a server load status on a public page.

    Does anyone know the steps to do this. It's basically an html page that obtain from server the load.

    Something like service status:

    Server Load 0.00 (4 cpus)
    Memory Used 14.5 %



    Thank you.
    Last edited by yoseman; 10-29-2010 at 12:09 AM. Reason: Title not descriptive

  2. #2
    Member
    Join Date
    Sep 2010
    Posts
    6

    Default

    same search here ...
    Thanks

  3. #3
    Member
    Join Date
    Oct 2010
    Posts
    34

    Default

    A simple free solution would be to write a quick bash script, stick it on a cron job, and have it generate a html page inside your webroot, or even ftp it to your www. website if it's hosted offsite.

    If you don't mind paying a bit for a license, Server Load and Performance Notification | Status2K is looks like a really good product.

  4. #4
    kjg
    kjg is offline
    Member
    Join Date
    Mar 2004
    Posts
    104

    Default

    The server load can easliy be done using the API.

    Get the cpanel API class at:
    http://sdk.cpanel.net/lib/xmlapi/php..._v1.0.6.tar.gz

    (Read about it on this thread:
    http://forums.cpanel.net/f42/xml-api...-a-136449.html )

    Unpack and upload it on the server where you want to display the load

    I have made a script that will show the load below.

    Just create a file called whateveryouwant.php, paste the code below (add ip and pass or hash) and upload it to the same directory as you have uploaded the xmlapi.php to.


    <?php
    include("xmlapi.php");

    ############### ENTER YOUR SERVER IP HERE
    # Enter your server IP here
    $ip = "";

    ############# ENTER PASSWORD OR HASH HERE
    # Enter your root password between the " and " if you want to use password
    $root_pass = "";

    # If you want to use hash instead: In WHM go to Cluster/Remote Access - Setup Remote Access Key and copy the entire key (all lines) and paste it between " and " below.
    $root_hash = "";


    if ( $ip && ip2long($ip) ) { # checking that IP is OK
    $xmlapi = new xmlapi($ip);
    if ($root_pass || $root_hash) { # has to be one of theese
    if ($root_pass) {
    $xmlapi->password_auth("root",$root_pass);
    }
    else if ($root_hash) {
    $xmlapi->hash_auth("root",$root_hash);
    }
    $xmlapi->set_output("array");
    $xmlapi->set_debug(0);

    $result = $xmlapi->loadavg();
    echo "Average load <br />last minute: " . $result['one'] . "<br />last 5 minutes: " . $result['five'] . "<br />last 15 minutes: " . $result['fifteen'] . "<br />";
    }
    else {
    echo "You have to set password or hash";
    }
    }
    else {
    echo "You have to set a correct IP";
    }

    ?>

    If you have checked the "Require security tokens for all interfaces" under WHM - Server Configuration - Tweak Settings . Security you might run into problems with the api


    // kjg

  5. #5
    Member
    Join Date
    Jun 2007
    Posts
    9

    Default

    Hello,

    Thank you very much, That's excellent.

    Thx

Similar Threads

  1. Public server status
    By PyRoAcIdK in forum New User Questions
    Replies: 1
    Last Post: 10-08-2007, 10:46 AM
  2. Server Status Page explained, where?
    By stickymu in forum New User Questions
    Replies: 3
    Last Post: 03-11-2006, 11:22 AM
  3. Service Status: Server Load
    By MakassarNET in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 03-22-2005, 12:54 AM
  4. Server Status Page
    By SonServers in forum cPanel & WHM Discussions
    Replies: 5
    Last Post: 03-21-2005, 10:55 PM
  5. Getting Service Status, and Displaying on Public Page
    By Aysar in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 02-01-2005, 09:59 PM