@@ 200-217 (lines=18) @@ | ||
197 | * includes also rx/tx bytes |
|
198 | * @return void |
|
199 | */ |
|
200 | private function _network() |
|
201 | { |
|
202 | if (CommonFunctions::executeProgram('netstat', '-ni | tail -n +2', $netstat)) { |
|
203 | $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY); |
|
204 | foreach ($lines as $line) { |
|
205 | $ar_buf = preg_split("/\s+/", $line); |
|
206 | if (! empty($ar_buf[0]) && ! empty($ar_buf[3])) { |
|
207 | $dev = new NetDevice(); |
|
208 | $dev->setName($ar_buf[0]); |
|
209 | $dev->setRxBytes($ar_buf[4]); |
|
210 | $dev->setTxBytes($ar_buf[6]); |
|
211 | $dev->setErrors($ar_buf[5] + $ar_buf[7]); |
|
212 | //$dev->setDrops($ar_buf[8]); |
|
213 | $this->sys->setNetDevices($dev); |
|
214 | } |
|
215 | } |
|
216 | } |
|
217 | } |
|
218 | ||
219 | /** |
|
220 | * Physical memory information and Swap Space information |
@@ 253-270 (lines=18) @@ | ||
250 | * |
|
251 | * @return void |
|
252 | */ |
|
253 | private function _network() |
|
254 | { |
|
255 | if (CommonFunctions::executeProgram('netstat', '-ni | tail -n +2', $netstat)) { |
|
256 | $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY); |
|
257 | foreach ($lines as $line) { |
|
258 | $ar_buf = preg_split("/\s+/", $line); |
|
259 | if (! empty($ar_buf[0]) && ! empty($ar_buf[3])) { |
|
260 | $dev = new NetDevice(); |
|
261 | $dev->setName($ar_buf[0]); |
|
262 | $dev->setRxBytes($ar_buf[4]); |
|
263 | $dev->setTxBytes($ar_buf[6]); |
|
264 | $dev->setErrors($ar_buf[5] + $ar_buf[7]); |
|
265 | $dev->setDrops($ar_buf[8]); |
|
266 | $this->sys->setNetDevices($dev); |
|
267 | } |
|
268 | } |
|
269 | } |
|
270 | } |
|
271 | ||
272 | /** |
|
273 | * Physical memory information and Swap Space information |