473,382 Members | 1,651 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Obtaining power values

34
Does anyone know if it is possible to obtain power consumption values of a monitor, hard disk and CPU of a PC from a IP address or something? It is for a project of mine. Using PHP codes.

Thanks
Jul 30 '08 #1
5 1617
henryrhenryr
103 100+
You would probably need to install a script on the target PC which sends the values to your server - eg, inserts into a database.

ie...

1. Shell Script:
Collects the information.
Goes to a URL (eg script.php?ip=192.168.2.2&power=240W) (you could have it launch this URL in a browser window or there is probably a command line way to do this too).
(You could do this with PHP but you would need a local version of PHP on the machine and you would still need exec() I think).

2. Server PHP: script.php
Expand|Select|Wrap|Line Numbers
  1. $ip=$_GET['ip'];
  2. $power=$_GET['power'];
  3. $query= "INSERT INTO power SET ip='$ip', power='$power'";
  4. //run query
  5.  
3. Schedule
Have the shell script run at regular intervals on the target PC.
Jul 30 '08 #2
mirainc
34
You would probably need to install a script on the target PC which sends the values to your server - eg, inserts into a database.

ie...

1. Shell Script:
Collects the information.
Goes to a URL (eg script.php?ip=192.168.2.2&power=240W) (you could have it launch this URL in a browser window or there is probably a command line way to do this too).
(You could do this with PHP but you would need a local version of PHP on the machine and you would still need exec() I think).

2. Server PHP: script.php
Expand|Select|Wrap|Line Numbers
  1. $ip=$_GET['ip'];
  2. $power=$_GET['power'];
  3. $query= "INSERT INTO power SET ip='$ip', power='$power'";
  4. //run query
  5.  
3. Schedule
Have the shell script run at regular intervals on the target PC.
Any way at all to do this without doing anything on the PC that i want the value from?

Thanks 4 the above info.. (:
Jul 30 '08 #3
pbmods
5,821 Expert 4TB
Heya, mirainc.

PHP runs on the server, not the client. So you could potentially fetch these values for the server, but that's it.
Jul 30 '08 #4
henryrhenryr
103 100+
Here is something you could use for the .bat script:

http://www.robvanderwoude.com/files/battrun_xp.txt
Jul 31 '08 #5
mirainc
34
Is there a way of obtaining System information of a PC through IP address? in PHP of course..

Thanks
Aug 1 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

29
by: John Devereux | last post by:
Hi, What is the best way to ensure an integer is a multiple of a given power of 2? How about int size; ...
1
by: Tim | last post by:
Hi, I'm trying to determine whether or not the volume is mute. I've been using the waveOutGetVolume API to determine volume levels, but I can't seem to determine whether the volume has been...
3
by: Biff | last post by:
Hello, I am bringing up an iFrame with a calendar control in it in coordination with a text box that holds a date field. In my code behind class I add a method call to the text box's OnFocus...
21
by: utab | last post by:
Hi there, Is there a way to convert a double value to a string. I know that there is fcvt() but I think this function is not a part of the standard library. I want sth from the standard if...
11
by: seannakasone | last post by:
Is there a way to get the callstack level in c++? for example, take the following code: void call3() { //callstack level would be 3 } void call2() { //callstack level would be 2 call3();
11
by: John Nagle | last post by:
The Python SSL object offers two methods from obtaining the info from an SSL certificate, "server()" and "issuer()". The actual values in the certificate are a series of name/value pairs in ASN.1...
3
by: greek | last post by:
the question is to calculate x^n(x power n) (whr n can be +ve or -ve) by using recursion. the algorithm is x= 1, n=0 1/x^n, n<0 x*x^(n-1), n>0 ...
11
by: gggram2000 | last post by:
Hi, I need some suggestions... I have created a form in visual studio 2005 in which a user chooses between two dates. I placed two dateTimePickers and a View Button. When the user clicks the view...
1
by: dmitrey | last post by:
hi all, howto check is function capable of obtaining **kwargs? i.e. I have some funcs like def myfunc(a,b,c,...):... some like def myfunc(a,b,c,...,*args):... some like
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.