mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Diagnosis: report low total space for rootfs
This commit is contained in:
parent
21a0c65ed6
commit
8b3ec8a137
2 changed files with 22 additions and 0 deletions
|
@ -103,6 +103,26 @@ class SystemResourcesDiagnoser(Diagnoser):
|
|||
|
||||
yield item
|
||||
|
||||
#
|
||||
# Check for minimal space on / + /var
|
||||
# because some stupid VPS provider only configure a stupidly
|
||||
# low amount of disk space for the root partition
|
||||
# which later causes issue when it gets full...
|
||||
#
|
||||
|
||||
main_disk_partitions = [d for d in disk_partitions if d.mountpoint in ['/', '/var']]
|
||||
main_space = sum([psutil.disk_usage(d.mountpoint).total for d in main_disk_partitions])
|
||||
if main_space < 10 * GB:
|
||||
yield dict(meta={"test": "rootfstotalspace"},
|
||||
data={"space": human_size(main_space)},
|
||||
status="ERROR",
|
||||
summary="diagnosis_rootfstotalspace_critical")
|
||||
if main_space < 14 * GB:
|
||||
yield dict(meta={"test": "rootfstotalspace"},
|
||||
data={"space": human_size(main_space)},
|
||||
status="WARNING",
|
||||
summary="diagnosis_rootfstotalspace_warning")
|
||||
|
||||
#
|
||||
# Recent kills by oom_reaper
|
||||
#
|
||||
|
|
|
@ -232,6 +232,8 @@
|
|||
"diagnosis_regenconf_allgood": "All configurations files are in line with the recommended configuration!",
|
||||
"diagnosis_regenconf_manually_modified": "Configuration file <code>{file}</code> appears to have been manually modified.",
|
||||
"diagnosis_regenconf_manually_modified_details": "This is probably OK if you know what you're doing! YunoHost will stop updating this file automatically... But beware that YunoHost upgrades could contain important recommended changes. If you want to, you can inspect the differences with <cmd>yunohost tools regen-conf {category} --dry-run --with-diff</cmd> and force the reset to the recommended configuration with <cmd>yunohost tools regen-conf {category} --force</cmd>",
|
||||
"diagnosis_rootfstotalspace_warning": "The root filesystem only has a total of {space}. This may be okay, but be careful because ultimately you may run out of disk space quickly... It's recommended to have at least 16 GB for the root filesystem.",
|
||||
"diagnosis_rootfstotalspace_critical": "The root filesystem only has a total of {space} which is quite worrisome! You will likely run out of disk space very quickly! It's recommended to have at least 16 GB for the root filesystem.",
|
||||
"diagnosis_security_vulnerable_to_meltdown": "You appear vulnerable to the Meltdown criticial security vulnerability",
|
||||
"diagnosis_security_vulnerable_to_meltdown_details": "To fix this, you should upgrade your system and reboot to load the new linux kernel (or contact your server provider if this doesn't work). See https://meltdownattack.com/ for more infos.",
|
||||
"diagnosis_description_basesystem": "Base system",
|
||||
|
|
Loading…
Add table
Reference in a new issue