check_disk forcibly ignores tmpfs

Bug #1958481 reported by Richard Laager
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
monitoring-plugins (Ubuntu)
New
Undecided
Unassigned

Bug Description

check_disk ignores tmpfs filesystems due to an Ubuntu patch (debian/patches/exclude-tmpfs-squashfs-tracefs.patch) added for LP #1827159. This is a bad idea.

On my servers, I have a tmpfs mounted at /tmp. Last night, /tmp filled up on one of them, resulting in significant breakage. My Icinga disk alerting did not notify me, because it's ignoring all tmpfs filesystems. I looked to see why and found that ignoring tmpfs is the Icinga default, so I adjusted that in my configuration. Unfortunately, that still didn't work. I eventually tracked that down to this patch. Because this tmpfs exclusion has been hardcoded in, it is impossible for me to override this decision.

While I think you should simply remove tmpfs from that patch, an alternative approach would be to move the code lower, after the arguments have been parsed, and conditionalize it. Something like this:

if (!fs_exclude_list) {
  np_add_name(&fs_exclude_list, "squashfs");
  np_add_name(&fs_exclude_list, "tmpfs");
  np_add_name(&fs_exclude_list, "tracefs");
}
np_add_name(&fs_exclude_list, "iso9660");

Note that iso9660 is outside the conditional and thus always added as per the upstream behavior. Thus the default behavior would be the same as now with the patch, but if the user customizes the exclude list with -X (e.g. in Icinga, or just via the command line), that would be honored.

Tags: patch
Revision history for this message
Richard Laager (rlaager) wrote :
Revision history for this message
Richard Laager (rlaager) wrote :

On the stock version, tmpfs filesystems do not show up, even if I specify -X:

$ /usr/lib/nagios/plugins/check_disk -w 10 -c 10
DISK OK - free space: /dev 5944 MB (100% inode=99%); / 2357 MB (28% inode=75%); /srv 17618 MB (94% inode=99%); /boot/efi 498 MB (98% inode=-);| /dev=0MB;5934;5934;0;5944 /=5993MB;8807;8807;0;8817 /srv=1009MB;18634;18634;0;18644 /boot/efi=5MB;494;494;0;504

$ /usr/lib/nagios/plugins/check_disk -w 10 -c 10 -X devpts
DISK OK - free space: /dev 5944 MB (100% inode=99%); / 2357 MB (28% inode=75%); /srv 17618 MB (94% inode=99%); /boot/efi 498 MB (98% inode=-);| /dev=0MB;5934;5934;0;5944 /=5993MB;8807;8807;0;8817 /srv=1009MB;18634;18634;0;18644 /boot/efi=5MB;494;494;0;504

With this version using my alternative patch, they still don't show up by default, but do if I specify something with -X:
$ ./check_disk -w 10 -c 10
DISK OK - free space: /dev 5944 MB (100% inode=99%); / 2357 MB (28% inode=75%); /srv 17618 MB (94% inode=99%); /boot/efi 498 MB (98% inode=-);| /dev=0MB;5934;5934;0;5944 /=5992MB;8807;8807;0;8817 /srv=1009MB;18634;18634;0;18644 /boot/efi=5MB;494;494;0;504

$ ./check_disk -w 10 -c 10 -X devpts
DISK CRITICAL - free space: /dev 5944 MB (100% inode=99%); /run 1076 MB (89% inode=99%); / 2357 MB (28% inode=75%); /dev/shm 5987 MB (100% inode=99%); /run/lock 5 MB (100% inode=99%); /sys/fs/cgroup 5987 MB (100% inode=99%); /tmp 5986 MB (99% inode=99%); /srv 17618 MB (94% inode=99%); /boot/efi 498 MB (98% inode=-); /run/user/25045 1197 MB (100% inode=99%);| /dev=0MB;5934;5934;0;5944 /run=120MB;1187;1187;0;1197 /=5992MB;8807;8807;0;8817 /dev/shm=0MB;5977;5977;0;5987 /run/lock=0MB;-5;-5;0;5 /sys/fs/cgroup=0MB;5977;5977;0;5987 /tmp=0MB;5977;5977;0;5987 /srv=1009MB;18634;18634;0;18644 /boot/efi=5MB;494;494;0;504 /run/user/25045=0MB;1187;1187;0;1197

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "An updated version of the patch with my alternative solution" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Hi Richard,

Thanks for filing this bug. This seems to be a duplicate of LP: #1940916, which is being worked on Miriam already. I'll mark this as duplicate, subscribe the bug to Miriam, and let her know about this as well.

Thank you for the patch, though. Miriam will take it from here, I suppose. :D

Revision history for this message
Miriam España Acebal (mirespace) wrote :

Hi Utkarsh,

sure, I'll do :).

Thanks, Richard also for the approach, which is like 1) in comment #7 [1]... so it looks like it's going in a good direction.

[1]https://bugs.launchpad.net/ubuntu/+source/monitoring-plugins/+bug/1940916/comments/7

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.