View previous topic :: View next topic |
Author |
Message |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Fri Jun 10, 2005 5:31 pm Post subject: CPU Usage program |
|
|
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 |
|
 |
MonkeyNation -
Joined: 05 Feb 2005 Posts: 921 Location: Cardiff
|
Posted: Sat Jun 11, 2005 2:43 pm Post subject: |
|
|
Can you ask him to make it into a command line program?
That would probably be easier. _________________
 |
|
Back to top |
 |
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Sat Jun 11, 2005 6:02 pm Post subject: |
|
|
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 |
|
 |
jlp09550 -
Joined: 05 Jun 2005 Posts: 123 Location: Louisiana, USA
|
Posted: Sat Jun 11, 2005 6:23 pm Post subject: |
|
|
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 |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Sat Jun 11, 2005 6:41 pm Post subject: |
|
|
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 |
|
 |
roganty -
Joined: 08 Jun 2004 Posts: 357 Location: Bristol, UK
|
Posted: Sun Jun 12, 2005 10:25 am Post subject: |
|
|
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 |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Sun Jun 12, 2005 11:55 am Post subject: |
|
|
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 |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Mon Jun 13, 2005 2:00 pm Post subject: |
|
|
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 |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Mon Jun 13, 2005 6:11 pm Post subject: |
|
|
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 |
|
 |
jlp09550 -
Joined: 05 Jun 2005 Posts: 123 Location: Louisiana, USA
|
|
Back to top |
|
 |
Goatie.dk -
Joined: 11 Feb 2005 Posts: 125 Location: Denmark > Herning
|
Posted: Tue Jun 14, 2005 1:44 am Post subject: |
|
|
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 |
|
 |
jlp09550 -
Joined: 05 Jun 2005 Posts: 123 Location: Louisiana, USA
|
|
Back to top |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Tue Jun 14, 2005 8:45 am Post subject: |
|
|
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 |
|
 |
jlp09550 -
Joined: 05 Jun 2005 Posts: 123 Location: Louisiana, USA
|
Posted: Tue Jun 14, 2005 4:47 pm Post subject: |
|
|
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 |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Tue Jun 14, 2005 4:54 pm Post subject: |
|
|
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 |
|
 |
Goatie.dk -
Joined: 11 Feb 2005 Posts: 125 Location: Denmark > Herning
|
Posted: Tue Jun 14, 2005 6:49 pm Post subject: |
|
|
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 |
|
 |
MonkeyNation -
Joined: 05 Feb 2005 Posts: 921 Location: Cardiff
|
Posted: Wed Jun 15, 2005 5:07 am Post subject: |
|
|
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 |
 |
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Fri Jun 17, 2005 9:12 am Post subject: |
|
|
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 |
|
 |
|