format('l, F j, Y H:i:s'); // Get date $formatted_date2 = $date->format('d/m/Y H:i:s'); // Get date2 $formatted_date3 = $date->format('Y/m/d H:i:s'); // Get date3 //System stats // OS-Version $os_version = ''; // Raspbian if ($os_version == '') {$os_version = exec('cat /etc/os-release | grep PRETTY_NAME');} // Dietpi if ($os_version == '') {$os_version = exec('uname -o');} //$os_version_arr = explode("\n", trim($os_version)); $stat['os_version'] = str_replace('"', '', str_replace('PRETTY_NAME=', '', $os_version)); $stat['uptime'] = str_replace('up ', '', shell_exec("uptime -p")); // Get system uptime $system_namekernel = shell_exec("uname"); // Get system name kernel $system_namesystem = shell_exec("uname -o"); // Get name system $system_full = shell_exec("uname -a"); // Get system full $system_architecture = shell_exec("uname -m"); // Get system Architecture $load_average = sys_getloadavg(); // Get load average $system_process_count = shell_exec("ps -e --no-headers | wc -l"); // Count processes //Motherboard stats $motherboard_name = shell_exec('cat /sys/class/dmi/id/board_name'); // Get the Motherboard name $motherboard_manufactured = shell_exec('cat /sys/class/dmi/id/board_vendor'); // Get the Motherboard manufactured $motherboard_revision = shell_exec('cat /sys/class/dmi/id/board_version'); // Get the Motherboard revision $motherboard_bios = shell_exec('cat /sys/class/dmi/id/bios_version'); // Get the Motherboard BIOS $motherboard_biosdate = shell_exec('cat /sys/class/dmi/id/bios_date'); // Get the Motherboard BIOS date $motherboard_biosvendor = shell_exec('cat /sys/class/dmi/id/bios_vendor'); // Get the Motherboard BIOS vendor //CPU stats $prevVal = shell_exec("cat /proc/cpuinfo | grep processor"); $prevArr = explode("\n", trim($prevVal)); $stat['cpu'] = sizeof($prevArr); $cpu_result = shell_exec("cat /proc/cpuinfo | grep Model"); $stat['cpu_model'] = strstr($cpu_result, "\n", true); $stat['cpu_model'] = str_replace(":", "", trim(str_replace("Model", "", $stat['cpu_model']))); if ($stat['cpu_model'] == '') { $cpu_result = shell_exec("cat /proc/cpuinfo | grep model\ name"); $stat['cpu_model'] = strstr($cpu_result, "\n", true); $stat['cpu_model'] = str_replace(":", "", trim(str_replace("model name", "", $stat['cpu_model']))); } if (file_exists('/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq')) { // RaspbianOS $stat['cpu_frequ'] = exec('cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq') / 1000; } elseif (is_numeric(str_replace(',', '.', exec('lscpu | grep "MHz" | awk \'{print $3}\'')))) { // Ubuntu Server, DietPi event. others $stat['cpu_frequ'] = round(exec('lscpu | grep "MHz" | awk \'{print $3}\''), 0); } elseif (is_numeric(str_replace(',', '.', exec('lscpu | grep "max MHz" | awk \'{print $4}\'')))) { // RaspbianOS and event. others $stat['cpu_frequ'] = round(str_replace(',', '.', exec('lscpu | grep "max MHz" | awk \'{print $4}\'')), 0); } else { // Fallback $stat['cpu_frequ'] = "unknown"; } $cpu_temp = shell_exec('cat /sys/class/hwmon/hwmon0/temp1_input'); // Get the CPU temperature $cpu_temp = floatval($cpu_temp) / 1000; // Convert the temperature to degrees Celsius $cpu_vendor = exec('cat /proc/cpuinfo | grep "vendor_id" | cut -d ":" -f 2' ); // Get the CPU vendor //Memory stats $total_memorykb = shell_exec("cat /proc/meminfo | grep MemTotal | awk '{print $2}'"); $total_memorykb = trim($total_memorykb); $total_memorykb = number_format($total_memorykb, 0, '.', '.'); $total_memorymb = shell_exec("cat /proc/meminfo | grep MemTotal | awk '{print $2/1024}'"); $total_memorymb = trim($total_memorymb); $total_memorymb = number_format($total_memorymb, 0, '.', '.'); $mem_used = round(memory_get_usage() / 1048576 * 100, 2); $memory_usage_percent = round(($mem_used / $total_memorymb), 2); // General ---------------------------------------------------------- echo '
| ' . lang('Systeminfo_Services_Name') . ' | ' . lang('Systeminfo_Services_Description') . ' |
|---|---|
| ' . substr($servives_name, 0, -8) . ' | ' . $servives_description . ' |