1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
<?php
$cnt = SystemStatus::getUpgradableSecurityCount();
if ($cnt > 0) {
Message::addWarning('systemstatus.security-updates-available', true, $cnt);
}
$pkgs = SystemStatus::getPackagesRequiringReboot();
if (!empty($pkgs)) {
Message::addInfo('systemstatus.update-reboot-required', true, implode(', ', $pkgs));
}
$aptTs = SystemStatus::getAptLastDbUpdateTime();
if ($aptTs + 864000 < time()) {
// No update for 10 days
Message::addWarning('systemstatus.apt-db-out-of-date', true, Util::prettyTime($aptTs));
}
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));
}
}
|