Page 1 of 1

Nagios remote nrpe check_disk returns permission denied

Posted: Thu May 20, 2021 9:50 pm
by yezi
Hi!

I have a problem with remote check_disk command using check_disk.

command[check_disk_space]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -W $ARG3$ -K $ARG4$

but display below code :
DISK CRITICAL - /var/lib/docker/overlay2/dfb45a9a0b2e3e63b2fa5306acccc44ea7e9ea1c8b1b34080f48df08dddec7c5/merged is not accessible: Permission denied

at file /etc/sudoers,i add below:
nagios ALL=(ALL) NOPASSWD:ALL
but also have problem

Please what could be the problem?

Re: Nagios remote nrpe check_disk returns permission denied

Posted: Sun May 23, 2021 6:37 am
by mcapra
Your NRPE user doesn't have permissions to read any of the Docker overlayfs mounts. Which is a good thing usually.

If you don't want to monitor these overlayfs mounts, check_disk offers many arguments to do include/exclude logic:

Code: Select all

 -p, --path=PATH, --partition=PARTITION
    Mount point or block device as emitted by the mount(8) command (may be repeated)
 -x, --exclude_device=PATH <STRING>
    Ignore device (only works if -p unspecified)
 -I, --ignore-eregi-path=PATH, --ignore-eregi-partition=PARTITION
    Regular expression to ignore selected path/partition (case insensitive) (may be repeated)
 -i, --ignore-ereg-path=PATH, --ignore-ereg-partition=PARTITION
    Regular expression to ignore selected path or partition (may be repeated)
 -X, --exclude-type=TYPE
    Ignore all filesystems of indicated type (may be repeated)
You may want to simply use -X to exclude all overlayfs mounts, but I can't say for sure what is correct for your environment.