| @@ 274-299 (lines=26) @@ | ||
| 271 | * |
|
| 272 | * @return void |
|
| 273 | */ |
|
| 274 | private function _filesystems() |
|
| 275 | { |
|
| 276 | if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) { |
|
| 277 | $mounts = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY); |
|
| 278 | if (CommonFunctions::executeProgram('mount', '-v', $s, PSI_DEBUG)) { |
|
| 279 | $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY); |
|
| 280 | while (list(, $line) = each($lines)) { |
|
| 281 | $a = preg_split('/ /', $line, -1, PREG_SPLIT_NO_EMPTY); |
|
| 282 | $fsdev[$a[0]] = $a[4]; |
|
| 283 | } |
|
| 284 | } |
|
| 285 | foreach ($mounts as $mount) { |
|
| 286 | $ar_buf = preg_split("/\s+/", $mount, 6); |
|
| 287 | $dev = new DiskDevice(); |
|
| 288 | $dev->setName($ar_buf[0]); |
|
| 289 | $dev->setTotal($ar_buf[1] * 1024); |
|
| 290 | $dev->setUsed($ar_buf[2] * 1024); |
|
| 291 | $dev->setFree($ar_buf[3] * 1024); |
|
| 292 | $dev->setMountPoint($ar_buf[5]); |
|
| 293 | if (isset($fsdev[$ar_buf[0]])) { |
|
| 294 | $dev->setFsType($fsdev[$ar_buf[0]]); |
|
| 295 | } |
|
| 296 | $this->sys->setDiskDevices($dev); |
|
| 297 | } |
|
| 298 | } |
|
| 299 | } |
|
| 300 | ||
| 301 | /** |
|
| 302 | * Distribution |
|
| @@ 315-340 (lines=26) @@ | ||
| 312 | * |
|
| 313 | * @return void |
|
| 314 | */ |
|
| 315 | private function _filesystems() |
|
| 316 | { |
|
| 317 | if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) { |
|
| 318 | $mounts = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY); |
|
| 319 | if (CommonFunctions::executeProgram('mount', '-v', $s, PSI_DEBUG)) { |
|
| 320 | $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY); |
|
| 321 | while (list(, $line) = each($lines)) { |
|
| 322 | $a = preg_split('/ /', $line, -1, PREG_SPLIT_NO_EMPTY); |
|
| 323 | $fsdev[$a[0]] = $a[4]; |
|
| 324 | } |
|
| 325 | } |
|
| 326 | foreach ($mounts as $mount) { |
|
| 327 | $ar_buf = preg_split("/\s+/", $mount, 6); |
|
| 328 | $dev = new DiskDevice(); |
|
| 329 | $dev->setName($ar_buf[0]); |
|
| 330 | $dev->setTotal($ar_buf[1] * 1024); |
|
| 331 | $dev->setUsed($ar_buf[2] * 1024); |
|
| 332 | $dev->setFree($ar_buf[3] * 1024); |
|
| 333 | $dev->setMountPoint($ar_buf[5]); |
|
| 334 | if (isset($fsdev[$ar_buf[0]])) { |
|
| 335 | $dev->setFsType($fsdev[$ar_buf[0]]); |
|
| 336 | } |
|
| 337 | $this->sys->setDiskDevices($dev); |
|
| 338 | } |
|
| 339 | } |
|
| 340 | } |
|
| 341 | ||
| 342 | /** |
|
| 343 | * Distribution |
|