Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISPConfig
ISPConfig 3
Commits
1fd9f130
Commit
1fd9f130
authored
Mar 04, 2009
by
tbrehm
Browse files
Fixed a bug in cpu info in the monitor module.
parent
e1f89db2
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/mods-available/monitor_core_module.inc.php
View file @
1fd9f130
...
@@ -312,12 +312,15 @@ class monitor_core_module {
...
@@ -312,12 +312,15 @@ class monitor_core_module {
*/
*/
$cpuData
=
shell_exec
(
"cat /proc/cpuinfo"
);
$cpuData
=
shell_exec
(
"cat /proc/cpuinfo"
);
$cpuInfo
=
explode
(
"
\n
"
,
$cpuData
);
$cpuInfo
=
explode
(
"
\n
"
,
$cpuData
);
$processor
=
0
;
foreach
(
$cpuInfo
as
$line
){
foreach
(
$cpuInfo
as
$line
){
$part
=
preg_split
(
"/:/"
,
$line
);
$part
=
preg_split
(
"/:/"
,
$line
);
$key
=
trim
(
$part
[
0
]);
$key
=
trim
(
$part
[
0
]);
$value
=
trim
(
$part
[
1
]);
$value
=
trim
(
$part
[
1
]);
$data
[
$key
]
=
$value
;
if
(
$key
==
'processor'
)
$processor
=
intval
(
$value
);
$data
[
$key
.
' '
.
$processor
]
=
$value
;
}
}
/* the cpu has no state. It is, what it is */
/* the cpu has no state. It is, what it is */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment