Changeset 33 for measure_scripts


Ignore:
Timestamp:
Aug 23, 2008, 7:28:53 PM (16 years ago)
Author:
george
Message:
  • Přidáno: Funkce pro měření teploty procesoru.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • measure_scripts/system.php

    r32 r33  
    140140}
    141141
     142function ProcessorTemperature($Sensor)
     143{
     144  $Output = array();
     145  exec('/usr/bin/sensors', $Output);
     146  foreach($Output as $Line)
     147  {
     148    if(substr($Line, 0, strlen($Sensor)) == $Sensor)
     149    {
     150      $Line = substr($Line, strpos($Line, '+') + 1);
     151      $Line = substr($Line, 0, strpos($Line, '°'));
     152      return($Line);
     153    }
     154  }
     155  return(0);
     156}
     157
    142158function SystemUptime()
    143159{
     
    149165}
    150166
     167
    151168?>
Note: See TracChangeset for help on using the changeset viewer.