From fc198e9f78ac866e927a5741c89bcb740edd3862 Mon Sep 17 00:00:00 2001 From: Tapio Lehtonen Date: Fri, 13 Nov 2020 13:37:01 +0100 Subject: [PATCH 1/2] Add systemd check for failed services --- htf-common-issues.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htf-common-issues.php b/htf-common-issues.php index aaa46e5..2ebd9ac 100644 --- a/htf-common-issues.php +++ b/htf-common-issues.php @@ -193,6 +193,14 @@ if ($os_version == '') { outlog("[INFO] OS version is $os_version "); } +// 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; -- GitLab From 5286be74cd5970c2e8e28ff77350cccb995a6d7d Mon Sep 17 00:00:00 2001 From: Tapio Lehtonen Date: Sun, 17 Jan 2021 21:39:27 +0100 Subject: [PATCH 2/2] Update htf-common-issues.php --- htf-common-issues.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/htf-common-issues.php b/htf-common-issues.php index aaa46e5..4616925 100644 --- a/htf-common-issues.php +++ b/htf-common-issues.php @@ -193,6 +193,30 @@ 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 for ISPConfig if(@is_dir("/usr/local/ispconfig")) $has_ispconfig = true; -- GitLab