check_disk forcibly ignores tmpfs
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/
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_
np_add_
np_add_
}
np_add_
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.
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 5934;5934; 0;5944 /=5993MB; 8807;8807; 0;8817 /srv=1009MB; 18634;18634; 0;18644 /boot/efi= 5MB;494; 494;0;504
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;
$ /usr/lib/ nagios/ plugins/ check_disk -w 10 -c 10 -X devpts 5934;5934; 0;5944 /=5993MB; 8807;8807; 0;8817 /srv=1009MB; 18634;18634; 0;18644 /boot/efi= 5MB;494; 494;0;504
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;
With this version using my alternative patch, they still don't show up by default, but do if I specify something with -X: 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
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;
$ ./check_disk -w 10 -c 10 -X devpts 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
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;