@@ 48-53 (lines=6) @@ | ||
45 | } else { |
|
46 | $upses = array(PSI_UPS_APCUPSD_LIST); |
|
47 | } |
|
48 | foreach ($upses as $ups) { |
|
49 | CommonFunctions::executeProgram('apcaccess', 'status '.trim($ups), $temp); |
|
50 | if (! empty($temp)) { |
|
51 | $this->_output[] = $temp; |
|
52 | } |
|
53 | } |
|
54 | } else { //use default if address and port not defined |
|
55 | CommonFunctions::executeProgram('apcaccess', 'status', $temp); |
|
56 | if (! empty($temp)) { |
@@ 62-67 (lines=6) @@ | ||
59 | } else { //use default if address and port not defined |
|
60 | CommonFunctions::executeProgram('upsc', '-l', $output); |
|
61 | $ups_names = preg_split("/\n/", $output, -1, PREG_SPLIT_NO_EMPTY); |
|
62 | foreach ($ups_names as $ups_name) { |
|
63 | CommonFunctions::executeProgram('upsc', trim($ups_name), $temp); |
|
64 | if (! empty($temp)) { |
|
65 | $this->_output[trim($ups_name)] = $temp; |
|
66 | } |
|
67 | } |
|
68 | } |
|
69 | } |
|
70 |