|
|
#127 (permalink) |
|
Lost in code...
Fresh Surpasser
Joined in Mar 2007
Lives in UK
Hosted on Sh120
20 posts
Gave thanks: 0
Thanked 2 times
|
Copy paste to Textwrangler, save as serverload.php, drop in public_html, edit signature, voila!
Although now I know it hasn't dropped below 4 since I did it ! ![]() |
|
|
|
|
|
#129 (permalink) |
|
Race Surpass
Super #1
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,219 posts
Gave thanks: 18
Thanked 86 times
|
Hmm.. I just noticed a bug with this script. Here's the old section of code:
PHP Code:
PHP Code:
__________________
|
|
|
|
|
|
#130 (permalink) |
|
Registered User
Seasoned Poster
Joined in May 2007
Lives in Manila, Philippines
Hosted on Pass68
32 posts
Gave thanks: 3
Thanked 1 Time in 1 Post
|
Thank you for this cool script.
MarkRH, I'm using your fix now.
__________________
Reseller - Pass68 BrinkNotes Hosting | My Boring Life...Now A Blog! | Just Jeric | So Sick of Taxi |
|
|
|
|
|
#131 (permalink) |
|
4-8-15-16-23-42
Excelling Contributor
Joined in Jul 2007
Lives in Australia, turn left at America
Hosted on Luna & Nexus (dedicated)
775 posts
Gave thanks: 36
Thanked 29 times
|
I wanted a pretty girly one, >_> so I have my own version that rotates through different backgrounds.
![]()
__________________
|
|
|
|
|
|
#134 (permalink) |
|
Registered User
Excelling Contributor
Joined in Feb 2005
536 posts
Gave thanks: 84
Thanked 24 times
|
Anyway to have this working in a Windows server?
And how to make the green bar turns red when the load goes over the "safe limit"?
__________________
Patty Pass 57 |
|
|
|
|
|
#135 (permalink) |
|
Registered User
Excelling Contributor
Joined in Feb 2005
536 posts
Gave thanks: 84
Thanked 24 times
|
I've found this script, but it's giving an error:
Warning: (null)(): Invalid ProgID, GUID string, or Moniker: No description available in <b>C:\Inetpub\vhosts\user\httpdocs\windowsuptime.p hp</b> on line <b>8</b><br /> PHP has encountered an Access Violation at 01C3E3F8 Maybe it's just a matter of few tweaks... anybody??? Code:
<?php
// PHP 5
header("Content-type: image/png");
function getServerLoad(){
$wmi = new COM("Winmgmts://");
$server = $wmi->execquery("SELECT LoadPercentage FROM Win32_Processor");
foreach($server as $cpu){
return $cpu->loadpercentage;
}
}
$load = getServerLoad();
$img = @imagecreate(107, 12) or die("Server ondersteunt geen GD library...");
$background_color = imagecolorallocate($img, 255, 255, 255);
$border_color = imagecolorallocate($img, 197, 197, 197);
$procent = imagecolorallocate($img, 0, 0, 0);
if($load < 33){
$load_color = imagecolorallocate($img, 149, 191, 77); // Green
}elseif($load >= 33 && $load < 66){
$load_color = imagecolorallocate($img, 213, 184, 55); // Orange
}else{
$load_color = imagecolorallocate($img, 186, 83, 83); // Red
}
imagerectangle($img, 0, 0, 106, 11, $border_color);
imagefilledrectangle($img, 3, 3, 3 + $load, 8, $load_color);
imagestring($img, 1, 50, 2, $load . "%", $procent);
// Create Image
imagepng($img);
imagedestroy($img);
?>
__________________
Patty Pass 57 |
|
|
|