CPU Usage program

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Fri Jun 10, 2005 5:31 pm    Post subject: CPU Usage program Reply with quote

Hello,

My friend has designed this program to store CPU Usage as an ENV variable but I cannot get PHP to echo it. I know it is there because I looked in the variables box in windows.

It is stored as CPU_Usage

I used the following method:

Code:
<?php
$cpuusage=$_ENV['CPU_Usage'];
echo ($cpuusage);
?>


but it didnt work. Any ideas? The link for the program is http://homepages.nildram.co.uk/~vwlowen/files/cpuusage.zip feel free to download it.
_________________
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 11, 2005 2:43 pm    Post subject: Reply with quote

Can you ask him to make it into a command line program?
That would probably be easier.
_________________
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 11, 2005 6:02 pm    Post subject: Reply with quote

I asked him but he said it is difficult to get cpu usage to display anyway, let alone using a command line to get it.

I just discovered that this program wont even load on my server. It just gives the error 'Cannot find the processor object'. And thats the end of that.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
jlp09550
-


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

PostPosted: Sat Jun 11, 2005 6:23 pm    Post subject: Reply with quote

Hold on... I'm getting an error too, but different! Look:

Quote:

Notice: Undefined index: CPU_Usage in C:\Documents and Settings\Jared\Desktop\web-server\system\1.php on line 2


P.S. He should make the cpuusage program be able to minimize to the toolbar or whatever they call it! =P
_________________
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
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Sat Jun 11, 2005 6:41 pm    Post subject: Reply with quote

I've asked him but he is a very busy man. He only makes things for me in his spare time. I don't think this project will be going much further.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
roganty
-


Joined: 08 Jun 2004
Posts: 357
Location: Bristol, UK

PostPosted: Sun Jun 12, 2005 10:25 am    Post subject: Reply with quote

The Inquisitor wrote:
Hello,

My friend has designed this program to store CPU Usage as an ENV variable but I cannot get PHP to echo it. I know it is there because I looked in the variables box in windows.

It is stored as CPU_Usage

I used the following method:

Code:
<?php
$cpuusage=$_ENV['CPU_Usage'];
echo ($cpuusage);
?>


but it didnt work. Any ideas? The link for the program is http://homepages.nildram.co.uk/~vwlowen/files/cpuusage.zip feel free to download it.


use the phpinfo() function and check the list to see if the variable is included in the list.
if is is listsed, then it is a problem with your code.
try using capitals inside the _ENV variable instead

Code:
<?php
$cpuusage=$_ENV['CPU_USAGE'];
echo ($cpuusage);
?>


does that work?
_________________
Anthony R

Roganty
| Links-Links.co.uk
Back to top View user's profile Send private message Visit poster's website
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Sun Jun 12, 2005 11:55 am    Post subject: Reply with quote

I already tried that and had no luck. If I am correct in thinking, ENV names are case sensetive so it would have to be CPU_Usage.

I may give up on this approach to getting cpu usage for now. Its not important, it just would have been nice to have it. If only the WMI way worked properly...
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Mon Jun 13, 2005 2:00 pm    Post subject: Reply with quote

OK Guy's I have just been informed that my friend is making another CPU Usage program and this one works on my server. It should have the following features:

(BTW its for WINDOWS only and should work on all OS's but is being designed on XP Pro)

- Save to text file
- Ability to set the update interval between 1 and 30 seconds
- Auto start
- Auto minimise to tray

The txt file should be 'included' with php or can be opened in an iFrame for those who dont have PHP or dont have the knowledge to make scripts.

I'll let everyone know when its done and I will also provide some code for PHP to put it onto your page. ( I may be able to get hold of the source code too, its being made in Borland Delphi )
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Mon Jun 13, 2005 6:11 pm    Post subject: Reply with quote

OK here is release number 1!

http://abyssunderground.co.uk/serverinfo.zip - 280KB ish

It contains all the files including a few I have been working on. All the instructions are there too.

Remember, its for WINDOWS only

If anyone gets it working and wants to post a live version of it, feel free!

Enjoy! (If you have problems let me know!)
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
jlp09550
-


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

PostPosted: Mon Jun 13, 2005 7:01 pm    Post subject: Reply with quote

Good job!

View it here: http://lfu.no-ip.org/system2/

P.S. I see an image for temp, how do I display the temp?
_________________
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
Goatie.dk
-


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

PostPosted: Tue Jun 14, 2005 1:44 am    Post subject: Reply with quote

It keeps saying "Invalid filename" when i open up cpuusage.exe... Don't know if it has anything to do with my pagefile. Where do i enable/disable it?

Edit: Just did a search on my computer and couldn't find any file called pagefile.sys... That puzzles me a bit :S
_________________
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: Tue Jun 14, 2005 3:08 am    Post subject: Reply with quote

You need the right windows. Wat windows do you have?
_________________
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
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Tue Jun 14, 2005 8:45 am    Post subject: Reply with quote

If its to do with cpuusage.exe then it shouldn't have anything to do with pagefile.sys. You can only see this file if you have see system files enabled on it. The error you are getting is to do with cpuusage.exe

If you want to display the temps then you need a program called MBM MotherBoard sensors monitor. I am currently working on this part of it but bear with me.

I'll give you all an update when I'm done. In about a month or two all of these bits of the script will be running on my own server so you can see a live demo of it.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
jlp09550
-


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

PostPosted: Tue Jun 14, 2005 4:47 pm    Post subject: Reply with quote

The Inquisitor wrote:
If its to do with cpuusage.exe then it shouldn't have anything to do with pagefile.sys. You can only see this file if you have see system files enabled on it. The error you are getting is to do with cpuusage.exe

If you want to display the temps then you need a program called MBM MotherBoard sensors monitor. I am currently working on this part of it but bear with me.

I'll give you all an update when I'm done. In about a month or two all of these bits of the script will be running on my own server so you can see a live demo of it.



Awsome! :) I can't wait until it is done!
_________________
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
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Tue Jun 14, 2005 4:54 pm    Post subject: Reply with quote

I currently have it working on my server now, its just not on the web yet. I'll see if I can post a screenshot of it for you some time soon.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
Goatie.dk
-


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

PostPosted: Tue Jun 14, 2005 6:49 pm    Post subject: Reply with quote

I'm running windows xp pro sp2 and i did set it up so i can see hidden and system files
_________________
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
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Wed Jun 15, 2005 5:07 am    Post subject: Reply with quote

The Inquisitor wrote:
If its to do with cpuusage.exe then it shouldn't have anything to do with pagefile.sys. You can only see this file if you have see system files enabled on it. The error you are getting is to do with cpuusage.exe

If you want to display the temps then you need a program called MBM MotherBoard sensors monitor. I am currently working on this part of it but bear with me.

I'll give you all an update when I'm done. In about a month or two all of these bits of the script will be running on my own server so you can see a live demo of it.


I prefer the WMI Thing Aprelium pointed me to, it has a lot of possibilities.
But this is a good alternative for those who cant get it to work =)
_________________
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: Fri Jun 17, 2005 9:12 am    Post subject: Reply with quote

I agree, this is why I got my friend to make the program, for the simple reason that WMI wouldn't work on my server. As you say, great for those that WMI doesnt work for.
_________________
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
Page 1 of 1

 
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