diff options
author | Simon Rettberg | 2020-10-20 09:46:25 +0200 |
---|---|---|
committer | Simon Rettberg | 2020-10-20 09:46:25 +0200 |
commit | c3eaacb8ab3dea485d842f89aa055e241b73ce8b (patch) | |
tree | 651c074563246c1ec193de9b33b80cb8556fb6a3 /modules-available/systemstatus/hooks/main-warning.inc.php | |
parent | [locationinfo] real fix of bootstrap switches (diff) | |
download | slx-admin-c3eaacb8ab3dea485d842f89aa055e241b73ce8b.tar.gz slx-admin-c3eaacb8ab3dea485d842f89aa055e241b73ce8b.tar.xz slx-admin-c3eaacb8ab3dea485d842f89aa055e241b73ce8b.zip |
[systemstatus] Add main-warning hook for low disk space
Diffstat (limited to 'modules-available/systemstatus/hooks/main-warning.inc.php')
-rw-r--r-- | modules-available/systemstatus/hooks/main-warning.inc.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules-available/systemstatus/hooks/main-warning.inc.php b/modules-available/systemstatus/hooks/main-warning.inc.php index 406ae73c..5707c7d2 100644 --- a/modules-available/systemstatus/hooks/main-warning.inc.php +++ b/modules-available/systemstatus/hooks/main-warning.inc.php @@ -4,4 +4,13 @@ if (file_exists('/run/reboot-required.pkgs')) { $lines = file('/run/reboot-required.pkgs', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); $lines = array_unique($lines); Message::addInfo('systemstatus.update-reboot-required', true, implode(', ', $lines)); +} + +if (SystemStatus::diskStat($systemUsage, $storeUsage, $current, $wanted)) { + if ($current === $wanted && isset($storeUsage['freeKb']) && $storeUsage['freeKb'] < 60000000) { // 60GB + Message::addWarning('systemstatus.storage-low-vmstore', true, Util::readableFileSize($storeUsage['freeKb'], -1 , 1)); + } + if (isset($systemUsage['freeKb']) && $systemUsage['freeKb'] < 600000) { // 600MB + Message::addWarning('systemstatus.storage-low-system', true, Util::readableFileSize($systemUsage['freeKb'], -1 , 1)); + } }
\ No newline at end of file |