CPU Usage
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
Goatie.dk
-


Joined: 11 Feb 2005
Posts: 125
Location: Denmark > Herning

PostPosted: Fri Jun 17, 2005 12:11 am    Post subject: Reply with quote

No no no... when I right click and select view source it only shows the start of the source code..
Code:
<html>
<head>
<title>title</title>
</head>
<body>

It doesn't show anything after that..
_________________
The insane dane who loves AWS :D
http://home.goatie.dk <- pic = online.. no pic, guess ;P
Back to top View user's profile Send private message
jlp09550
-


Joined: 05 Jun 2005
Posts: 123
Location: Louisiana, USA

PostPosted: Fri Jun 17, 2005 5:15 am    Post subject: Reply with quote

I have that issue too, but I find out that it wasn't saved to my server. Did you save that to your server??
_________________
Hosted Abyss Sites-
http://jared.chibipaws.com/ - My Stuffs
http://jaredblog.chibipaws.com/ - My Blog
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Fri Jun 17, 2005 9:32 pm    Post subject: Reply with quote

jlp09550 wrote:
I have that issue too, but I find out that it wasn't saved to my server. Did you save that to your server??


Save what? =/
Ive been playing around with WMI and its pretty cool =)
It can show most things about your system.
_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Sat Jun 18, 2005 8:56 am    Post subject: Reply with quote

WMI does work for me, just not the CPUUsage part, can you post some of the WMI commands we can use and explain simply what they do please? I have looked all over the place and it doesnt give me any commands, just what WMI is.

Cheers.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Sat Jun 18, 2005 9:27 am    Post subject: Reply with quote

The Inquisitor wrote:
WMI does work for me, just not the CPUUsage part, can you post some of the WMI commands we can use and explain simply what they do please? I have looked all over the place and it doesnt give me any commands, just what WMI is.

Cheers.


This is pointing you further in the correct direction.

A very simple example of WMI is...
Code:

if(class_exists("COM")) {
  $wmi = new COM("WinMgmts:\\\\.");
  $drives = $wmi->InstancesOf("Win32_CDROMDrive");

  $count = 1;
  foreach ($drives as $drv) {
 
   echo "Drive #".$i." : " . $drv->Name . " <br> ";
   $count++;
   
  }
}

... Which will list your optical drives. (Thank you to Aprelium for letting me totally steal his snippet.)
_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sat Jun 18, 2005 11:47 am    Post subject: Reply with quote

MonkeyNation wrote:
(Thank you to Aprelium for letting me totally steal his snippet.)

It was meant to be shared, reused, and improved. So that's not stealing. :-)
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
chewzzqq
-


Joined: 28 Sep 2005
Posts: 198

PostPosted: Mon Apr 17, 2006 5:09 pm    Post subject: Reply with quote

i have problem ,when using it version2
original is
Code:
<?php

if($cpu_speed_display=="1"){

echo("<b>CPU Speed:</b> ");


if(class_exists("COM")) {
  $wmi = new COM("WinMgmts:\\\\.");
  $cpus = $wmi->InstancesOf("Win32_Processor");
 
  $i = 1;
 
[color=red]      // Use the while loop on PHP 4 and foreach on PHP 5
  while ($cpu = $cpus->Next()) {
     //foreach ($cpus as $cpu) {[/color]
 
   $clockSpeed = $cpu->CurrentClockSpeed;
   $cpuDATA = $cpu->LoadPercentage;
   $i++;
   
  }
}

echo($clockSpeed);
echo("MHz<br>");



}


flush();
ob_flush();

?>


i edit it,and with no problem
Code:
<?php

if($cpu_speed_display=="1"){

echo("<b>CPU Speed:</b> ");


if(class_exists("COM")) {
  $wmi = new COM("WinMgmts:\\\\.");
  $cpus = $wmi->InstancesOf("Win32_Processor");
 
  $i = 1;
 
[color=red]      // Use the while loop on PHP 4 and foreach on PHP 5
  //while ($cpu = $cpus->Next()) {
     foreach ($cpus as $cpu) {[/color]
   $clockSpeed = $cpu->CurrentClockSpeed;
   $cpuDATA = $cpu->LoadPercentage;
   $i++;
   
  }
}

echo($clockSpeed);
echo("MHz<br>");



}


flush();
ob_flush();

?>

_________________
Back to top View user's profile Send private message Visit poster's website
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Mon Apr 17, 2006 5:28 pm    Post subject: Reply with quote

As this is part of my status script, you dont need to edit the script. You only edit the config.php. If it doesnt work then its simply not compatable with your system.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group