diff --git a/plugins/dynamix/include/SystemInformation.php b/plugins/dynamix/include/SystemInformation.php
index 922482a98..40d488a26 100644
--- a/plugins/dynamix/include/SystemInformation.php
+++ b/plugins/dynamix/include/SystemInformation.php
@@ -45,7 +45,7 @@ echo empty($var['SYS_MODEL']) ? 'N/A' : "{$var['SYS_MODEL']}";
M/B:
-echo exec("dmidecode -q -t 2|awk -F: '/^\tManufacturer:/{m=$2;}; /^\tProduct Name:/{p=$2;} END{print m\" -\"p}'");
+echo exec("dmidecode -qt2|awk -F: '/^\tManufacturer:/{m=\$2};/^\tProduct Name:/{p=\$2} END{print m\" -\"p}'");
?>
CPU:
@@ -54,7 +54,7 @@ function write($number) {
$words = ['zero','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen','twenty','twenty-one','twenty-two','twenty-three','twenty-four','twenty-five','twenty-six','twenty-seven','twenty-eight','twenty-nine','thirty'];
return $number<=count($words) ? $words[$number] : $number;
}
-$cpu = explode('#',exec("dmidecode -q -t 4|awk -F: '/^\tVersion:/{v=$2;}; /^\tCurrent Speed:/{s=$2;} END{print v\"#\"s}'"));
+$cpu = explode('#',exec("dmidecode -qt4|awk -F: '/^\tVersion:/{v=\$2};/^\tCurrent Speed:/{s=\$2} END{print v\"#\"s}'"));
$cpumodel = str_ireplace(["Processor","(C)","(R)","(TM)"],["","©","®","™"],$cpu[0]);
if (strpos($cpumodel,'@')===false) {
$cpuspeed = explode(' ',$cpu[1]);
@@ -116,7 +116,7 @@ if (strpos($cpumodel,'@')===false) {
Cache:
-$cache = explode('#',exec("dmidecode -q -t 7|awk -F: '/^\tSocket Designation:/{c=c$2\";\";}; /^\tInstalled Size:/{s=s$2\";\";} END{print c\"#\"s}'"));
+$cache = explode('#',exec("dmidecode -qt7|awk -F: '/^\tSocket Designation:/{c=c\$2\";\"};/^\tInstalled Size:/{s=s\$2\";\"} END{print c\"#\"s}'"));
$socket = array_map('trim',explode(';',$cache[0]));
$volume = array_map('trim',explode(';',$cache[1]));
$name = [];
@@ -133,18 +133,24 @@ echo $size;
Memory:
-// Memory Device (16) will get us each ram chip. By matching on MB it'll filter out Flash/Bios chips
-// Sum up all the Memory Devices to get the amount of system memory installed. Convert MB to GB
-$memory_installed = exec("dmidecode -t 17 | awk -F: '/^\tSize: [0-9]+ MB$/{t+=$2} /^\tSize: [0-9]+ GB$/{t+=$2*1024} END{print t}'")/1024;
-// Physical Memory Array (16) usually one of these for a desktop-class motherboard but higher-end xeon motherboards
-// might have two or more of these. The trick is to filter out any Flash/Bios types by matching on GB
-// Sum up all the Physical Memory Arrays to get the motherboard's total memory capacity
-// Extract error correction type, if none, do not include additional information in the output
-list($memory_maximum, $ecc_support) = array_map("trim", explode("#", exec("dmidecode -t16|awk -F: '/^\tMaximum Capacity: [0-9]+ GB$/{t+=$2};/^\tError Correction Type:/{e=$2} END{print t\"#\"e}'")));
-// If maximum < installed then roundup maximum to the next power of 2 size of installed. E.g. 6 -> 8 or 12 -> 16
-$star = "";
-if ($memory_maximum < $memory_installed) {$memory_maximum = pow(2,ceil(log($memory_installed)/log(2))); $star = "*";}
-echo "$memory_installed GB ".($ecc_support == "None" ? "" : "$ecc_support ")."(max. installable capacity $memory_maximum GB)$star";
+/*
+ Memory Device (16) will get us each ram chip. By matching on MB it'll filter out Flash/Bios chips
+ Sum up all the Memory Devices to get the amount of system memory installed. Convert MB to GB
+ Physical Memory Array (16) usually one of these for a desktop-class motherboard but higher-end xeon motherboards
+ might have two or more of these. The trick is to filter out any Flash/Bios types by matching on GB
+ Sum up all the Physical Memory Arrays to get the motherboard's total memory capacity
+ Extract error correction type, if none, do not include additional information in the output
+ If maximum < installed then roundup maximum to the next power of 2 size of installed. E.g. 6 -> 8 or 12 -> 16
+*/
+$memory_installed = exec("dmidecode -qt17|awk -F: '/^\tSize: [0-9]+ MB\$/{t+=\$2};/^\tSize: [0-9]+ GB\$/{t+=\$2*1024} END{print t}'");
+list($memory_maximum,$ecc_support) = array_map('trim',explode('#',exec("dmidecode -qt16|awk -F: '/^\tMaximum Capacity: [0-9]+ GB\$/{t+=\$2*1024};/^\tError Correction Type:/{e=\$2} END{print t\"#\"e}'")));
+if ($memory_installed >= 1024) {
+ $memory_installed /= 1024;
+ $memory_maximum /= 1024;
+ $unit = 'GB';
+} else $unit = 'MB';
+if ($memory_maximum < $memory_installed) {$memory_maximum = pow(2,ceil(log($memory_installed)/log(2))); $star = '*';} else $star = '';
+echo "$memory_installed $unit ".($ecc_support == "None" ? "" : "$ecc_support ")."(max. installable capacity $memory_maximum $unit)$star";
?>
Network: