hddtemp again

R2-D2
2004-08-24
2012-12-12
  • R2-D2
    R2-D2
    2004-08-24

    Hi,
    I'm using latest cvs now with lm_sensors support... runs nice.
    But I want to have the output from hddtemp displayed additionally. There is a thread already but the patchlink is broken :/ Can sbd give me a hint on that?

    - R2-D2

     
    • Add this in class.lmsensors.inc.php before return array_values($results);

         // temp. sd?
          $sensors_hdd = explode("\n", execute_program("hddtemp", "/dev/sd?"));
          foreach($sensors_hdd as $line) {
            if (ereg("(.*):(.*):(.*)", $line, $data)) {
               $results[$i]['label'] = trim($data[2]);
               $results[$i]['value'] = trim($data[3]);
               $i++;
            }
          }

          // temp. hd?
          $sensors_hdd = explode("\n", execute_program("hddtemp", "/dev/hd?"));
          foreach($sensors_hdd as $line) {
            if (ereg("(.*):(.*):(.*)", $line, $data)) {
               $results[$i]['label'] = trim($data[2]);
               $results[$i]['value'] = trim($data[3]);
               $i++;
            }
          }