Incorrectly excludes tmpfs filesystems
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
monitoring-plugins (Ubuntu) |
Fix Released
|
Medium
|
Miriam España Acebal | ||
Bionic |
Fix Released
|
Medium
|
Hua Zhang | ||
Focal |
Fix Released
|
Medium
|
Miriam España Acebal | ||
Impish |
Fix Released
|
Medium
|
Miriam España Acebal | ||
Jammy |
Fix Released
|
Medium
|
Miriam España Acebal |
Bug Description
[SRU]
[Impact]
False positive reports are generated in monitoring tools when artificial file systems are mounted, as they show 100% disk utilisation, and therefore add an unnecessary (but fatal sounding) "CRITICAL DISK" noise. But, if we exclude them by default as we did in the first place in bug 1827159, we limit the use of command options that are commonly used in scripts and that, because of this exclusion, cannot operate on this kind of filesystems (e.g. the path option or the include filesystem option -as excluding has preference over including).
[Test Plan]
0.Preparing the test environment:
#Preparing the container
lxc launch images:ubuntu/focal checkdisks-focal
lxc shell checkdisks-focal
apt update -y
apt upgrade -y
#Installing necessary tools
apt install monitoring-plugins
apt install snapd
#Mount some synthetic systems and make use of snap space
mkdir /reproduce-tmpfs
mkdir /reproduce-squashfs
mkdir /reproduce-tracefs
mount -t tmpfs -o rw,size=2G tmpfs /reproduce-tmpfs
mount -t tmpfs -o rw,size=2G squashfs /reproduce-squashfs
mount -t tmpfs -o rw,size=2G tracefs /reproduce-tracefs
snap install gnome-calculator
1. Bad cases:
# "CRITICAL DISK" noise
$ /usr/lib/
DISK CRITICAL - free space: /dev 448 MB (100% inode=99%); /run 96 MB (98% inode=99%); / 884 MB (18% inode=80%); /dev/shm 485 MB (100% inode=99%); /run/lock 5 MB (100% inode=99%); /snap/lxd/21835 0 MB (0% inode=0%); /snap/core20/1270 0 MB (0% inode=0%); /snap/snapd/14295 0 MB (0% inode=0%); /boot/efi 99 MB (95% inode=-); /run/snapd/ns 96 MB (98% inode=99%); /snap/snapd/14549 0 MB (0% inode=0%); /run/user/1000 97 MB (99% inode=99%); /snap/bare/5 0 MB (0% inode=0%); /snap/multipass
$ /usr/lib/
DISK CRITICAL - free space: /run/lock 5 MB (100% inode=99%);| /dev=0MB;
$ /usr/lib/
DISK CRITICAL - free space: /run/lock 5 MB (100% inode=99%); /snap/lxd/21835 0 MB (0% inode=0%); /snap/core20/1270 0 MB (0% inode=0%); /snap/snapd/14295 0 MB (0% inode=0%); /snap/snapd/14549 0 MB (0% inode=0%); /snap/bare/5 0 MB (0% inode=0%); /snap/multipass
$ /usr/lib/
DISK CRITICAL - free space: /run/lock 5 MB (100% inode=99%);| /dev=0MB;
$ /usr/lib/
DISK CRITICAL - free space: /snap/lxd/21835 0 MB (0% inode=0%); /snap/core20/1270 0 MB (0% inode=0%); /snap/snapd/14295 0 MB (0% inode=0%); /snap/snapd/14549 0 MB (0% inode=0%); /snap/bare/5 0 MB (0% inode=0%); /snap/multipass
# "DISK UNKNOWN" as synthetic filesystems are excluded
$ /usr/lib/
DISK UNKNOWN - free space:|
$ /usr/lib/
DISK UNKNOWN - free space:|
$ /usr/lib/
DISK UNKNOWN - free space:|
2. Good cases:
# "CRITICAL DISK" noise
$ /usr/lib/
DISK OK - free space: / 6971 MB (85% inode=99%); /dev/fuse 32071 MB (100% inode=99%); /dev/net/tun 32071 MB (100% inode=99%); /dev/full 32071 MB (100% inode=99%); /dev/null 32071 MB (100% inode=99%); /dev/random 32071 MB (100% inode=99%); /dev/tty 32071 MB (100% inode=99%); /dev/urandom 32071 MB (100% inode=99%); /dev/zero 32071 MB (100% inode=99%); /snap 6971 MB (85% inode=99%);| /=1204MB;
# "DISK UNKNOWN" as synthetic filesystems are excluded
$ /usr/lib/
DISK OK - free space: /reproduce-tmpfs 2048 MB (100% inode=99%);| /reproduce-
$ /usr/lib/
DISK OK - free space: /dev 0 MB (99% inode=99%); /dev/lxd 0 MB (100% inode=99%); /dev/.lxd-mounts 0 MB (100% inode=99%); /proc/sys/
$ /usr/lib/
DISK OK - free space: /reproduce-tmpfs 2048 MB (100% inode=99%);| /reproduce-
//This case is fine, as I am explicitly asking for an fs that is being explicitly excluded too.
$ /usr/lib/
DISK UNKNOWN - free space:|
$ /usr/lib/
DISK OK - free space: /reproduce-tmpfs 2048 MB (100% inode=99%);| /reproduce-
$ /usr/lib/
DISK OK - free space: /dev 0 MB (99% inode=99%); /dev/lxd 0 MB (100% inode=99%); /dev/.lxd-mounts 0 MB (100% inode=99%); /proc/sys/
[Where problems could occur]
As this alters the logic of how out-of-space checks are handled, relevant issues to keep an eye out for would relate to filesystem checks reporting improperly. These tools underlay a few different front-ends, so regression bugs may get filed in a few different places, however they will tend to display error messages involving check_disk, nagios, and either tmpfs or tracefs. To minimize it, this changes has been done after all the arguments logic has been done (thanks Richard Laager), therefore excluding filesystems only if not required explicitly by the user (thanks Christian Ehrhardt).
Note that there are likely other synthetic filesystems beyond tmpfs, squashfs and tracefs (e.g. udev, usbfs, devtmpfs, fuse.*, ...) which might also cause similar false positives; these should be handled as separate bugs, although the proposed code here has the intention to be easily used to it.
[Other Info]
The intention is to forward the patch to upstream once is accepted here, as the previous one (https:/
[Original Report]
-------
$ lsb_release -d
Description: Ubuntu 20.04.3 LTS
$ apt-cache policy monitoring-plugins | head -n2
monitoring-plugins:
Installed: 2.2-6ubuntu1.1
check_disk returns UNKNOWN for tmpfs filesystems, even when directed explicitly to check them. This is a regression introduced by the fix for LP: #1827159.
Steps to reproduce:
$ df -h /tmp
Filesystem Size Used Avail Use% Mounted on
tmpfs 16G 64K 16G 1% /tmp
$ /usr/lib/
DISK UNKNOWN - free space:|
Running the check as part of a group, even with just the one member, is a workaround:
$ /usr/lib/
DISK OK - free space: tmp 16058 MB (99% inode=99%);| tmp=0MB;
Related branches
- Bryce Harrington (community): Approve
- Canonical Server: Pending requested
-
Diff: 89 lines (+47/-13)2 files modifieddebian/changelog (+9/-0)
debian/patches/exclude-tmpfs-squashfs-tracefs.patch (+38/-13)
- Bryce Harrington (community): Approve
- Canonical Server: Pending requested
- Canonical Server MOTU reviewers: Pending requested
-
Diff: 89 lines (+47/-13)2 files modifieddebian/changelog (+9/-0)
debian/patches/exclude-tmpfs-squashfs-tracefs.patch (+38/-13)
- Utkarsh Gupta (community): Needs Information
- Bryce Harrington (community): Approve
-
Diff: 89 lines (+47/-13)2 files modifieddebian/changelog (+9/-0)
debian/patches/exclude-tmpfs-squashfs-tracefs.patch (+38/-13)
description: | updated |
tags: | added: server-todo |
Changed in monitoring-plugins (Ubuntu): | |
importance: | Undecided → Medium |
Changed in monitoring-plugins (Ubuntu): | |
assignee: | nobody → Miriam España Acebal (mirespace) |
Changed in monitoring-plugins (Ubuntu): | |
status: | Triaged → In Progress |
description: | updated |
description: | updated |
no longer affects: | percona-monitoring-plugins |
description: | updated |
Changed in monitoring-plugins (Ubuntu Focal): | |
assignee: | nobody → Miriam España Acebal (mirespace) |
status: | Incomplete → In Progress |
importance: | Undecided → Medium |
Changed in monitoring-plugins (Ubuntu Impish): | |
assignee: | nobody → Miriam España Acebal (mirespace) |
importance: | Undecided → Medium |
status: | New → In Progress |
tags: |
added: verification-done-focal removed: verification-needed-focal |
tags: | removed: server-todo |
Changed in monitoring-plugins (Ubuntu Bionic): | |
assignee: | nobody → Hua Zhang (zhhuabj) |
Changed in monitoring-plugins (Ubuntu Bionic): | |
importance: | Undecided → Medium |
tags: | added: sts sts-sponsor-dgadomski |
Status changed to 'Confirmed' because the bug affects multiple users.