Results 1 to 5 of 5
  1. #1
    Join Date
    May 2004
    Location
    Malaysia
    Posts
    178

    Publish Server Load

    Hello,

    I have a typical Windows 2003 Server and IIS without any control panel. Anyone know a script or utility to publish server health to webpage?

  2. #2
    Join Date
    Sep 2008
    Location
    Dallas, TX
    Posts
    4,552
    Are you looking at something like Status 2k? http://www.status2k.com/
    Jacob Wall - GetCloak.com

  3. #3
    Join Date
    May 2004
    Location
    Malaysia
    Posts
    178
    but my server can not fulfill the requirement? i'm just a vanilla install windows 2003 server with iis for in-house applications. also hope the utility is free.

  4. #4
    Join Date
    Sep 2007
    Location
    New York, NY
    Posts
    109
    You could use PHP - try something like this:

    Code:
    <?php
    function getServerLoad($windows = true)
    {
        $os = strtolower(PHP_OS);
        if (strpos($os, "win") === false) {
            if (file_exists("/proc/loadavg")) {
                $data = file_get_contents("/proc/loadavg");
                $load = explode(' ', $data);
                return $load[0];
    
            } elseif (function_exists("shell_exec")) {
    
                $load = explode(' ', `uptime`);
                return $load[count($load)-1];
    
            } else {
    
                return false;
            }
    
        } elseif($windows) {
    
            if(class_exists("COM")) {
                $wmi = new COM("WinMgmts:\\\\.");
                $cpus = $wmi->InstancesOf("Win32_Processor");
        
                 $cpuload = 0;
                 $i = 0;
    
                if(version_compare('4.50.0', PHP_VERSION) == 1) {
                    // PHP 4
                    while ($cpu = $cpus->Next()) {
                        $cpuload += $cpu->LoadPercentage;
                        $i++;
                    }
    
                } else {
    
                    // PHP 5
                    foreach ( $cpus as $cpu ) {
                        $cpuload += $cpu->LoadPercentage;
                        $i++;
                    }
                }
    
                 $cpuload = round($cpuload / $i, 2);
                 return "$cpuload%";
    
            } else {
    
                return false;
            }
        }
    }
    echo get_server_load();
    ?>
    cPanelDesigns - High Quality & Mobile Ready cPanel Themes

  5. #5
    Join Date
    May 2004
    Location
    Malaysia
    Posts
    178
    my installation is just plain vanilla install windows 2003 server with iis for in-house applications

Similar Threads

  1. Replies: 0
    Last Post: 07-04-2007, 03:19 AM
  2. My server load is low but my site is taking VERY long to load.
    By xlogger in forum Hosting Security and Technology
    Replies: 6
    Last Post: 12-18-2005, 05:33 PM
  3. Server load not very high but pages load slowly
    By singtel22 in forum Hosting Security and Technology
    Replies: 17
    Last Post: 01-27-2005, 02:43 PM
  4. Server Uptime Stats - To publish or not to publish.
    By DTR1 in forum Running a Web Hosting Business
    Replies: 24
    Last Post: 07-31-2004, 11:13 PM
  5. Replies: 11
    Last Post: 07-29-2003, 06:25 PM

Posting Permissions

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