Nagios remote nrpe check_disk returns permission denied

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
yezi
Posts: 1
Joined: Thu May 20, 2021 9:43 pm

Nagios remote nrpe check_disk returns permission denied

Post 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?
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios remote nrpe check_disk returns permission denied

Post 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.
Former Nagios employee
https://www.mcapra.com/
Locked