Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_disk - exclude squashfs, etc. by default #1608

Closed
bryceharrington opened this issue Nov 14, 2019 · 3 comments
Closed

check_disk - exclude squashfs, etc. by default #1608

bryceharrington opened this issue Nov 14, 2019 · 3 comments

Comments

@bryceharrington
Copy link

In Ubuntu, squashfs is routinely used for snap files, but since these are synthetic filesystems they display as 100% utilization and thus trigger check_disk to issue a false positive DISK CRITICAL error.

Similar false positives have been reported to us for tracefs and tmpfs. The commonly discussed workaround is to exclude these when running the tools (e.g. using the '-X ' parameter for check_all_disks). Since wrappers are typically used for running the underlying tools, it is possible to add a string of -X... parameters.

Unfortunately the number of flags needed is getting extensive, and I wonder if this could be solved more uniformly. For filesystems that are always going to show 100% capacity, a cleaner solution is possible. monitoring-plugins' check_disk.c maintains an internal exclusion list, fs_exclude_list, which already excludes iso9660, and can be modified to add other filesystems to exclude by default.

In other words, check_disk.c would be modified thusly:

np_add_name(&fs_exclude_list, "iso9660");
np_add_name(&fs_exclude_list, "squashfs");
np_add_name(&fs_exclude_list, "tmpfs");
np_add_name(&fs_exclude_list, "tracefs");

This code is added prior to the command line parsing logic, and as such simply sets default behavior. It does not preclude further adding or removing filesystems via the -X and -N parameters. Indeed, if someone were to desire checking tmpfs, they are able to manually add it, via "-N tmpfs".

bryceharrington added a commit to bryceharrington/monitoring-plugins that referenced this issue Nov 14, 2019
These synthetic filesystems always report 100% disk usage by design, so
can generate false-positive "disk full" alerts.  While it is possible to
exclude these via command line arguments, it is more convenient to
ignore them directly by the tool.

Fixes: monitoring-plugins#1608
@odenbach
Copy link
Contributor

I personally do not care if I have to add 12 or 16 parameters to check_disk, as that is done once in the Icinga2 command definition. I already exclude

	"none",
	"tmpfs",
	"sysfs",
	"proc",
	"configfs",
	"devtmpfs",
	"devfs",
	"mtmfs",
	"tracefs",
	"cgroup",
	"fuse.gvfsd-fuse",
	"fuse.gvfs-fuse-daemon",
	"fdescfs",
	"overlay",
	"nsfs",
	"squashfs"

But that is of course site-dependant.

@NHellFire
Copy link

I'm voting no on adding tmpfs to the exclude list, as excludes can't be overridden by command line arguments. tmpfs also reports correctly on my Ubuntu systems:

nathan@nagios:~$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS"
nathan@nagios:~$ uname -r
4.15.0-1067-raspi2
nathan@nagios:~$ df -t tmpfs -h
Filesystem      Size  Used Avail Use% Mounted on
tmpfs            93M  4.3M   89M   5% /run
tmpfs           462M     0  462M   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           462M     0  462M   0% /sys/fs/cgroup
tmpfs            93M     0   93M   0% /run/user/10001

@RincewindsHat
Copy link
Member

I think, this is better left over to the monitoring system, not the plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants