diff --git a/htf-common-issues.php b/htf-common-issues.php index aaa46e5dad0b9312092a79dafc20dd55834abb8a..d4d1e158248966ed6112e23e48308db8e2efb9cf 100644 --- a/htf-common-issues.php +++ b/htf-common-issues.php @@ -193,6 +193,38 @@ if ($os_version == '') { outlog("[INFO] OS version is $os_version "); } +// Show uptime, also shows average loads +if (file_exists('/bin/uptime')) { + $os_uptime = shell_exec('/bin/uptime'); +} elseif (file_exists('/usr/bin/uptime')) { + $os_uptime = shell_exec('/usr/bin/uptime'); +} +if ($os_uptime == '') { + outlog("Could not detect uptime."); +} else { + outlog("[INFO] uptime: $os_uptime "); +} + +// Show memory use and swap +if (file_exists('/bin/free')) { + $os_free = shell_exec('/bin/free -h'); +} elseif (file_exists('/usr/bin/free')) { + $os_free = shell_exec('/usr/bin/free -h'); +} +if ($os_free == '') { + outlog("Could not detect memory usage."); +} else { + outlog("[INFO] memory:\n$os_free "); +} + +// check all services are running +$systemctl='/usr/bin/systemctl'; +if (file_exists($systemctl)) { + $sctlstatus = shell_exec($systemctl.' --state=failed'); + outlog("[INFO] systemd failed services status:"); + outlog("$sctlstatus"); +} + // check for ISPConfig if(@is_dir("/usr/local/ispconfig")) $has_ispconfig = true;