Updated YABs insert for version v2022-05-06
Updated YABs insert for version v2022-05-06
This commit is contained in:
parent
f6cf9c7a65
commit
908f8b904f
179
app/Process.php
179
app/Process.php
|
@ -192,24 +192,43 @@ class Process
|
||||||
}
|
}
|
||||||
|
|
||||||
$version_array = explode(' ', preg_replace('!\s+!', ' ', $this->trimRemoveR($array[2])));
|
$version_array = explode(' ', preg_replace('!\s+!', ' ', $this->trimRemoveR($array[2])));
|
||||||
if ($version_array[1] === 'v2021-12-28' || $version_array[1] === 'v2022-02-18' || $version_array[1] === 'v2022-04-30') {//YABs version
|
if ($version_array[1] === 'v2021-12-28' || $version_array[1] === 'v2022-02-18' || $version_array[1] === 'v2022-04-30' || $version_array[1] === 'v2022-05-06') {//YABs version
|
||||||
$cpu = $this->trimRemoveR(str_replace(':', '', strstr($array[10], ': ')));
|
if ($version_array[1] === 'v2022-05-06') {
|
||||||
$cpu_spec = explode(' ', strstr($array[11], ': '));//: 2 @ 3792.872 MHz
|
$cpu = $this->trimRemoveR(str_replace(':', '', strstr($array[11], ': ')));
|
||||||
|
$cpu_spec = explode(' ', strstr($array[12], ': '));//: 2 @ 3792.872 MHz
|
||||||
|
$ram_line = $this->trimRemoveR(str_replace(':', '', strstr($array[15], ': ')));
|
||||||
|
$ram = (float)$ram_line;
|
||||||
|
$ram_type = $this->datatype($ram_line);
|
||||||
|
$swap_line = $this->trimRemoveR(str_replace(':', '', strstr($array[16], ': ')));
|
||||||
|
$swap = (float)$swap_line;
|
||||||
|
$swap_type = $this->datatype($swap_line);
|
||||||
|
$disk_line = $this->trimRemoveR(str_replace(':', '', strstr($array[17], ': ')));
|
||||||
|
$disk = (float)$disk_line;
|
||||||
|
$disk_type = $this->datatype($disk_line);
|
||||||
|
$io_3 = explode(' ', preg_replace('!\s+!', ' ', $array[27]));
|
||||||
|
$io_6 = explode(' ', preg_replace('!\s+!', ' ', $array[33]));
|
||||||
|
(str_contains($array[13], 'Enabled')) ? $aes_ni = true : $aes_ni = false;
|
||||||
|
(str_contains($array[14], 'Enabled')) ? $vm_amd_v = true : $vm_amd_v = false;
|
||||||
|
} else {
|
||||||
|
$cpu = $this->trimRemoveR(str_replace(':', '', strstr($array[10], ': ')));
|
||||||
|
$cpu_spec = explode(' ', strstr($array[11], ': '));//: 2 @ 3792.872 MHz
|
||||||
|
$ram_line = $this->trimRemoveR(str_replace(':', '', strstr($array[14], ': ')));
|
||||||
|
$ram = (float)$ram_line;
|
||||||
|
$ram_type = $this->datatype($ram_line);
|
||||||
|
$swap_line = $this->trimRemoveR(str_replace(':', '', strstr($array[15], ': ')));
|
||||||
|
$swap = (float)$swap_line;
|
||||||
|
$swap_type = $this->datatype($swap_line);
|
||||||
|
$disk_line = $this->trimRemoveR(str_replace(':', '', strstr($array[16], ': ')));
|
||||||
|
$disk = (float)$disk_line;
|
||||||
|
$disk_type = $this->datatype($disk_line);
|
||||||
|
$io_3 = explode(' ', preg_replace('!\s+!', ' ', $array[24]));
|
||||||
|
$io_6 = explode(' ', preg_replace('!\s+!', ' ', $array[30]));
|
||||||
|
(str_contains($array[12], 'Enabled')) ? $aes_ni = true : $aes_ni = false;
|
||||||
|
(str_contains($array[13], 'Enabled')) ? $vm_amd_v = true : $vm_amd_v = false;
|
||||||
|
}
|
||||||
$cpu_cores = $cpu_spec[1];
|
$cpu_cores = $cpu_spec[1];
|
||||||
$cpu_freq = $cpu_spec[3];
|
$cpu_freq = $cpu_spec[3];
|
||||||
$ram_line = $this->trimRemoveR(str_replace(':', '', strstr($array[14], ': ')));
|
|
||||||
$ram = (float)$ram_line;
|
|
||||||
$ram_type = $this->datatype($ram_line);
|
|
||||||
$swap_line = $this->trimRemoveR(str_replace(':', '', strstr($array[15], ': ')));
|
|
||||||
$swap = (float)$swap_line;
|
|
||||||
$swap_type = $this->datatype($swap_line);
|
|
||||||
$disk_line = $this->trimRemoveR(str_replace(':', '', strstr($array[16], ': ')));
|
|
||||||
$disk = (float)$disk_line;
|
|
||||||
$disk_type = $this->datatype($disk_line);
|
|
||||||
$io_3 = explode(' ', preg_replace('!\s+!', ' ', $array[24]));
|
|
||||||
$io_6 = explode(' ', preg_replace('!\s+!', ' ', $array[30]));
|
|
||||||
(str_contains($array[12], 'Enabled')) ? $aes_ni = true : $aes_ni = false;
|
|
||||||
(str_contains($array[13], 'Enabled')) ? $vm_amd_v = true : $vm_amd_v = false;
|
|
||||||
|
|
||||||
$d4k_as_mbps = $this->diskSpeedAsMbps($io_3[3], $this->floatValue($io_3[2]));
|
$d4k_as_mbps = $this->diskSpeedAsMbps($io_3[3], $this->floatValue($io_3[2]));
|
||||||
$d64k_as_mbps = $this->diskSpeedAsMbps($io_3[7], $this->floatValue($io_3[6]));
|
$d64k_as_mbps = $this->diskSpeedAsMbps($io_3[7], $this->floatValue($io_3[6]));
|
||||||
|
@ -231,48 +250,94 @@ class Process
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isset($array[40])) {
|
if (isset($array[40])) {
|
||||||
if ($array[45] === "Geekbench 5 Benchmark Test:\r") {
|
if ($version_array[1] === 'v2022-05-06') {
|
||||||
//No ipv6
|
if ($array[43] === "Geekbench 5 Benchmark Test:\r") {
|
||||||
//Has short ipv4 network speed testing (-r)
|
//No ipv6
|
||||||
$has_ipv6 = false;
|
//Has short ipv4 network speed testing (-r)
|
||||||
$start_st = 36;
|
$has_ipv6 = false;
|
||||||
$end_st = 43;
|
$start_st = 39;
|
||||||
$gb_s = 49;
|
$end_st = 41;
|
||||||
$gb_m = 50;
|
$gb_s = 47;
|
||||||
$gb_url = 51;
|
$gb_m = 48;
|
||||||
} elseif ($array[45] === "Geekbench 4 Benchmark Test:\r") {
|
$gb_url = 49;
|
||||||
return array('error_id' => 6, 'error_message' => 'GeekBench 5 only allowed');
|
} elseif ($array[45] === "Geekbench 4 Benchmark Test:\r") {
|
||||||
} elseif ($array[45] === "Geekbench 5 test failed. Run manually to determine cause.\r") {
|
return array('error_id' => 6, 'error_message' => 'GeekBench 5 only allowed');
|
||||||
return array('error_id' => 7, 'error_message' => 'GeekBench test failed');
|
} elseif ($array[45] === "Geekbench 5 test failed. Run manually to determine cause.\r") {
|
||||||
} elseif ($array[40] === "Geekbench 5 Benchmark Test:\r") {
|
return array('error_id' => 7, 'error_message' => 'GeekBench test failed');
|
||||||
//No ipv6
|
} elseif ($array[46] === "Geekbench 5 Benchmark Test:\r") {
|
||||||
//Has full ipv4 network speed testing
|
//No ipv6
|
||||||
$has_ipv6 = false;
|
//Has full ipv4 network speed testing
|
||||||
$start_st = 36;
|
$has_ipv6 = false;
|
||||||
$end_st = 38;
|
$start_st = 39;
|
||||||
$gb_s = 44;
|
$end_st = 44;
|
||||||
$gb_m = 45;
|
$gb_s = 44;
|
||||||
$gb_url = 46;
|
$gb_m = 45;
|
||||||
} elseif ($array[40] === "iperf3 Network Speed Tests (IPv6):\r") {
|
$gb_url = 46;
|
||||||
//HAS ipv6
|
} elseif ($array[43] === "iperf3 Network Speed Tests (IPv6):\r") {
|
||||||
//Has short ipv4 & ipv6 network speed testing
|
//HAS ipv6
|
||||||
$has_ipv6 = true;
|
//Has short ipv4 & ipv6 network speed testing
|
||||||
$start_st = 36;
|
$has_ipv6 = true;
|
||||||
$end_st = 38;
|
$start_st = 39;
|
||||||
$gb_s = 52;
|
$end_st = 41;
|
||||||
$gb_m = 53;
|
$gb_s = 55;
|
||||||
$gb_url = 54;
|
$gb_m = 56;
|
||||||
} elseif ($array[56] === "Geekbench 5 Benchmark Test:\r") {
|
$gb_url = 57;
|
||||||
//HAS ipv6
|
} elseif ($array[56] === "Geekbench 5 Benchmark Test:\r") {
|
||||||
//Has full ipv4 & ipv6 network speed testing
|
//HAS ipv6
|
||||||
$has_ipv6 = true;
|
//Has full ipv4 & ipv6 network speed testing
|
||||||
$start_st = 36;
|
$has_ipv6 = true;
|
||||||
$end_st = 43;
|
$start_st = 39;
|
||||||
$gb_s = 60;
|
$end_st = 44;
|
||||||
$gb_m = 61;
|
$gb_s = 60;
|
||||||
$gb_url = 62;
|
$gb_m = 61;
|
||||||
|
$gb_url = 62;
|
||||||
|
} else {
|
||||||
|
return array('error_id' => 5, 'error_message' => 'Not correct YABs command output');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return array('error_id' => 5, 'error_message' => 'Not correct YABs command output');
|
if ($array[45] === "Geekbench 5 Benchmark Test:\r") {
|
||||||
|
//No ipv6
|
||||||
|
//Has short ipv4 network speed testing (-r)
|
||||||
|
$has_ipv6 = false;
|
||||||
|
$start_st = 36;
|
||||||
|
$end_st = 43;
|
||||||
|
$gb_s = 49;
|
||||||
|
$gb_m = 50;
|
||||||
|
$gb_url = 51;
|
||||||
|
} elseif ($array[45] === "Geekbench 4 Benchmark Test:\r") {
|
||||||
|
return array('error_id' => 6, 'error_message' => 'GeekBench 5 only allowed');
|
||||||
|
} elseif ($array[45] === "Geekbench 5 test failed. Run manually to determine cause.\r") {
|
||||||
|
return array('error_id' => 7, 'error_message' => 'GeekBench test failed');
|
||||||
|
} elseif ($array[40] === "Geekbench 5 Benchmark Test:\r") {
|
||||||
|
//No ipv6
|
||||||
|
//Has full ipv4 network speed testing
|
||||||
|
$has_ipv6 = false;
|
||||||
|
$start_st = 36;
|
||||||
|
$end_st = 38;
|
||||||
|
$gb_s = 44;
|
||||||
|
$gb_m = 45;
|
||||||
|
$gb_url = 46;
|
||||||
|
} elseif ($array[40] === "iperf3 Network Speed Tests (IPv6):\r") {
|
||||||
|
//HAS ipv6
|
||||||
|
//Has short ipv4 & ipv6 network speed testing
|
||||||
|
$has_ipv6 = true;
|
||||||
|
$start_st = 36;
|
||||||
|
$end_st = 38;
|
||||||
|
$gb_s = 52;
|
||||||
|
$gb_m = 53;
|
||||||
|
$gb_url = 54;
|
||||||
|
} elseif ($array[56] === "Geekbench 5 Benchmark Test:\r") {
|
||||||
|
//HAS ipv6
|
||||||
|
//Has full ipv4 & ipv6 network speed testing
|
||||||
|
$has_ipv6 = true;
|
||||||
|
$start_st = 36;
|
||||||
|
$end_st = 43;
|
||||||
|
$gb_s = 60;
|
||||||
|
$gb_m = 61;
|
||||||
|
$gb_url = 62;
|
||||||
|
} else {
|
||||||
|
return array('error_id' => 5, 'error_message' => 'Not correct YABs command output');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return array('error_id' => 4, 'error_message' => 'Not correct formatting');
|
return array('error_id' => 4, 'error_message' => 'Not correct formatting');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user