Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Jan 2003
    Posts
    1
    Member #
    499
    If there's one script I can't find, its the server load one on ur site. Would you care to post the source cuz my webserver's loads have been astronomical in the past week and that bit of code would be handy.

  2.  

  3. #2
    Senior Member nsr81's Avatar
    Join Date
    Oct 2002
    Posts
    1,132
    Member #
    250
    Liked
    15 times
    Try this if you have a linux server.

    PHP Code:
    <?
    $load 
    = `uptime`;
    echo 
    substr($loadstrpos($load": ")+strlen($load));
    ?>
    There and Back Again :Ogre:

  4. #3
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Here's an excerpt from http://www.turtletips.com/ , WDF's parent site. It colors server loads where appropriate.
    PHP Code:
    if ($output = @exec('uptime'))
                {
                    
    $pre 'load average: ';
                    
    $post substr($outputstrpos($output$pre) + strlen($pre));
                    
    $averages explode(', '$post);
                    
    $flag false;
                    for (
    $i 0$i sizeof($averages); $i++)
                    {
                        if (
    $averages[$i] > 10)
                        {
                            
    $flag true;
                            
    $averages[$i] = '<b><font color="#FF0000">' $averages[$i] . '</font></b>';
                        }
                        else if (
    $averages[$i] > 5)
                        {
                            
    $averages[$i] = '<b><font color="#D29E00">' $averages[$i] . '</font></b>';
                        }
                    }
                    if (
    $flag)
                    {
                        echo 
    '<img align="absmiddle" src="/warning.gif" hspace="5" width="16" height="16">';
                    }
                    echo 
    'Load Averages: ' implode(', '$averages);
                } 
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:29 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com