@@ 234-238 (lines=5) @@ | ||
231 | $dev->setStatus(trim($status)); |
|
232 | } |
|
233 | ||
234 | if (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.3\.3\.1\.0 = Gauge32:\s(.*)/m', $result, $data)) { |
|
235 | $dev->setLineVoltage(trim($data[1])/10); |
|
236 | } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.3\.2\.1\.0 = Gauge32:\s(.*)/m', $result, $data)) { |
|
237 | $dev->setLineVoltage(trim($data[1])); |
|
238 | } |
|
239 | if (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.4\.3\.3\.0 = Gauge32:\s(.*)/m', $result, $data)) { |
|
240 | $dev->setLoad(trim($data[1])/10); |
|
241 | } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.4\.2\.3\.0 = Gauge32:\s(.*)/m', $result, $data)) { |
|
@@ 239-243 (lines=5) @@ | ||
236 | } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.3\.2\.1\.0 = Gauge32:\s(.*)/m', $result, $data)) { |
|
237 | $dev->setLineVoltage(trim($data[1])); |
|
238 | } |
|
239 | if (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.4\.3\.3\.0 = Gauge32:\s(.*)/m', $result, $data)) { |
|
240 | $dev->setLoad(trim($data[1])/10); |
|
241 | } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.4\.2\.3\.0 = Gauge32:\s(.*)/m', $result, $data)) { |
|
242 | $dev->setLoad(trim($data[1])); |
|
243 | } |
|
244 | if (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.2\.3\.4\.0 = INTEGER:\s(.*)/m', $result, $data)) { |
|
245 | $dev->setBatteryVoltage(trim($data[1])/10); |
|
246 | } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.2\.2\.8\.0 = INTEGER:\s(.*)/m', $result, $data)) { |
|
@@ 244-248 (lines=5) @@ | ||
241 | } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.4\.2\.3\.0 = Gauge32:\s(.*)/m', $result, $data)) { |
|
242 | $dev->setLoad(trim($data[1])); |
|
243 | } |
|
244 | if (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.2\.3\.4\.0 = INTEGER:\s(.*)/m', $result, $data)) { |
|
245 | $dev->setBatteryVoltage(trim($data[1])/10); |
|
246 | } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.2\.2\.8\.0 = INTEGER:\s(.*)/m', $result, $data)) { |
|
247 | $dev->setBatteryVoltage(trim($data[1])); |
|
248 | } |
|
249 | if (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.2\.3\.1\.0 = Gauge32:\s(.*)/m', $result, $data)) { |
|
250 | $dev->setBatterCharge(trim($data[1])/10); |
|
251 | } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.2\.2\.1\.0 = Gauge32:\s(.*)/m', $result, $data)) { |
|
@@ 249-253 (lines=5) @@ | ||
246 | } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.2\.2\.8\.0 = INTEGER:\s(.*)/m', $result, $data)) { |
|
247 | $dev->setBatteryVoltage(trim($data[1])); |
|
248 | } |
|
249 | if (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.2\.3\.1\.0 = Gauge32:\s(.*)/m', $result, $data)) { |
|
250 | $dev->setBatterCharge(trim($data[1])/10); |
|
251 | } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.2\.2\.1\.0 = Gauge32:\s(.*)/m', $result, $data)) { |
|
252 | $dev->setBatterCharge(trim($data[1])); |
|
253 | } |
|
254 | if (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.2\.2\.3\.0 = Timeticks:\s\((\d*)\)/m', $result, $data)) { |
|
255 | $dev->setTimeLeft(trim($data[1])/6000); |
|
256 | } |
|
@@ 257-261 (lines=5) @@ | ||
254 | if (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.2\.2\.3\.0 = Timeticks:\s\((\d*)\)/m', $result, $data)) { |
|
255 | $dev->setTimeLeft(trim($data[1])/6000); |
|
256 | } |
|
257 | if (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.2\.3\.2\.0 = Gauge32:\s(.*)/m', $result, $data)) { |
|
258 | $dev->setTemperatur(trim($data[1])/10); |
|
259 | } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.2\.2\.2\.0 = Gauge32:\s(.*)/m', $result, $data)) { |
|
260 | $dev->setTemperatur(trim($data[1])); |
|
261 | } |
|
262 | if (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.2\.1\.3\.0 = STRING:\s(.*)/m', $result, $data)) { |
|
263 | $dev->setBatteryDate(trim($data[1], "\" \r\t")); |
|
264 | } |
|
@@ 265-269 (lines=5) @@ | ||
262 | if (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.2\.1\.3\.0 = STRING:\s(.*)/m', $result, $data)) { |
|
263 | $dev->setBatteryDate(trim($data[1], "\" \r\t")); |
|
264 | } |
|
265 | if (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.3\.3\.4\.0 = Gauge32:\s(.*)/m', $result, $data)) { |
|
266 | $dev->setLineFrequency(trim($data[1])/10); |
|
267 | } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.3\.2\.4\.0 = Gauge32:\s(.*)/m', $result, $data)) { |
|
268 | $dev->setLineFrequency(trim($data[1])); |
|
269 | } |
|
270 | ||
271 | $this->upsinfo->setUpsDevices($dev); |
|
272 | } |