Skip to content

Commit 1fd9f13

Browse files
committed
Fixed a bug in cpu info in the monitor module.
1 parent e1f89db commit 1fd9f13

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

server/mods-available/monitor_core_module.inc.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,15 @@ function monitorCpu()
312312
*/
313313
$cpuData = shell_exec("cat /proc/cpuinfo");
314314
$cpuInfo = explode("\n", $cpuData);
315+
$processor = 0;
315316

316317
foreach($cpuInfo as $line){
317-
$part = preg_split("/:/", $line);
318+
319+
$part = preg_split("/:/", $line);
318320
$key = trim($part[0]);
319321
$value = trim($part[1]);
320-
$data[$key] = $value;
322+
if($key == 'processor') $processor = intval($value);
323+
$data[$key.' '.$processor] = $value;
321324
}
322325

323326
/* the cpu has no state. It is, what it is */

0 commit comments

Comments
 (0)