diff options
author | Simon Rettberg | 2022-03-09 14:42:15 +0100 |
---|---|---|
committer | Simon Rettberg | 2022-03-09 15:08:28 +0100 |
commit | 4849f69fe671ed9e60b513a69847fb7ff3145e10 (patch) | |
tree | db7d24b7268cbf643636afbd65115319283a0149 /modules-available/systemstatus/page.inc.php | |
parent | [rebootcontrol] Adapt do new WakeOnLan task (diff) | |
download | slx-admin-4849f69fe671ed9e60b513a69847fb7ff3145e10.tar.gz slx-admin-4849f69fe671ed9e60b513a69847fb7ff3145e10.tar.xz slx-admin-4849f69fe671ed9e60b513a69847fb7ff3145e10.zip |
[systemstatus] Add distro and kernel version
Diffstat (limited to 'modules-available/systemstatus/page.inc.php')
-rw-r--r-- | modules-available/systemstatus/page.inc.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules-available/systemstatus/page.inc.php b/modules-available/systemstatus/page.inc.php index 238537d8..bf03112f 100644 --- a/modules-available/systemstatus/page.inc.php +++ b/modules-available/systemstatus/page.inc.php @@ -153,14 +153,16 @@ class Page_SystemStatus extends Page $cpuInfo = file_get_contents('/proc/cpuinfo'); $uptime = file_get_contents('/proc/uptime'); $cpuCount = preg_match_all('/\bprocessor\s/', $cpuInfo, $out); - //$cpuCount = count($out); + $out = parse_ini_file('/etc/os-release'); $data = array( 'cpuCount' => $cpuCount, 'memTotal' => '???', 'memFree' => '???', 'swapTotal' => '???', 'swapUsed' => '???', - 'uptime' => '???' + 'uptime' => '???', + 'kernel' => php_uname('r'), + 'distribution' => $out['PRETTY_NAME'] ?? (($out['NAME'] ?? '???') . ' ' . ($out['VERSION'] ?? '???')), ); if (preg_match('/^(\d+)\D/', $uptime, $out)) { $data['uptime'] = floor($out[1] / 86400) . ' ' . Dictionary::translate('lang_days') . ', ' . floor(($out[1] % 86400) / 3600) . ' ' . Dictionary::translate('lang_hours'); |