Obtaining power values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mirainc
    New Member
    • Jul 2008
    • 34

    Obtaining power values

    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
  • henryrhenryr
    New Member
    • Jun 2007
    • 103

    #2
    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=1 92.168.2.2&powe r=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
    [code=php]
    $ip=$_GET['ip'];
    $power=$_GET['power'];
    $query= "INSERT INTO power SET ip='$ip', power='$power'" ;
    //run query
    [/code]

    3. Schedule
    Have the shell script run at regular intervals on the target PC.

    Comment

    • mirainc
      New Member
      • Jul 2008
      • 34

      #3
      Originally posted by henryrhenryr
      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=1 92.168.2.2&powe r=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
      [code=php]
      $ip=$_GET['ip'];
      $power=$_GET['power'];
      $query= "INSERT INTO power SET ip='$ip', power='$power'" ;
      //run query
      [/code]

      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.. (:

      Comment

      • pbmods
        Recognized Expert Expert
        • Apr 2007
        • 5821

        #4
        Heya, mirainc.

        PHP runs on the server, not the client. So you could potentially fetch these values for the server, but that's it.

        Comment

        • henryrhenryr
          New Member
          • Jun 2007
          • 103

          #5
          Here is something you could use for the .bat script:

          Comment

          • mirainc
            New Member
            • Jul 2008
            • 34

            #6
            Is there a way of obtaining System information of a PC through IP address? in PHP of course..

            Thanks

            Comment

            Working...