| @@ 68-79 (lines=12) @@ | ||
| 65 | * |
|
| 66 | * @return void |
|
| 67 | */ |
|
| 68 | private function _fans() |
|
| 69 | { |
|
| 70 | if (CommonFunctions::executeProgram("/Apps/opt/bin/snmpwalk", "-Ona -c public -v 1 -r 1 127.0.0.1 .1.3.6.1.4.1.24681.1.2.15.1.3", $buffer, PSI_DEBUG)) { |
|
| 71 | $lines = preg_split('/\r?\n/', $buffer); |
|
| 72 | foreach ($lines as $line) if (preg_match('/^[\.\d]+\.(\d+) = STRING:\s\"?(\d+)\sRPM/', $line, $data)) { |
|
| 73 | $dev = new SensorDevice(); |
|
| 74 | $dev->setName("Fan ".$data[1]); |
|
| 75 | $dev->setValue($data[2]); |
|
| 76 | $this->mbinfo->setMbFan($dev); |
|
| 77 | } |
|
| 78 | } |
|
| 79 | } |
|
| 80 | ||
| 81 | /** |
|
| 82 | * get the information |
|
| @@ 117-129 (lines=13) @@ | ||
| 114 | * |
|
| 115 | * @return void |
|
| 116 | */ |
|
| 117 | protected function _usb() |
|
| 118 | { |
|
| 119 | if (CommonFunctions::executeProgram('listusb', '', $bufr, PSI_DEBUG)) { |
|
| 120 | $devices = preg_split("/\n/", $bufr); |
|
| 121 | foreach ($devices as $device) { |
|
| 122 | if (preg_match("/^\S+\s+\S+\s+\"(.*)\"\s+\"(.*)\"/", $device, $ar_buf)) { |
|
| 123 | $dev = new HWDevice(); |
|
| 124 | $dev->setName(trim($ar_buf[1]." ".$ar_buf[2])); |
|
| 125 | $this->sys->setUSBDevices($dev); |
|
| 126 | } |
|
| 127 | } |
|
| 128 | } |
|
| 129 | } |
|
| 130 | ||
| 131 | /** |
|
| 132 | * Haiku Version |
|