Hi!
I have a problem with remote check_disk command using check_disk.
The remote server (RHEL 7.2) has nrpe installed and when I run check_disk locally, I get correct response:
/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -A -X configfs -X cgroup -X tmpfs -X selinuxfs -X sysfs -X proc -X mqueue -X binfmt_misc -X devtmpfs
DISK OK - free space: / 7231 MB (25% inode=92%); /boot 266 MB (62% inode=99%); /tmp 9387 MB (99% inode=99%); /var/log 95114 MB (99% inode=99%); /dataspace 87398 MB (22% inode=99%); /var/lib/docker/devicemapper 7231 MB (25% inode=92%);
But trying to run it from nagios server via nrpe returns:
/usr/lib64/nagios/plugins/check_nrpe -H server -c check_hda1
DISK CRITICAL - /var/lib/docker/devicemapper/mnt/39f72d56797955d3a4d9c21221b6da1ef3b98d0b165d89dd371cc70e80908009 is not accessible: Permission denied
Ive disabled SELinux on the remote server, Ive added permissions via sudo to allow nrpe and nagios user commands to run:
User_Alias NRPERS = nagios, nrpe
Cmnd_Alias NRPERSCOMMANDS = /usr/lib64/nagios/plugins/eventhandlers/fix_ipsec, /usr/bin/docker inspect *, /usr/lib64/nagios/plugins/check-docker-container.sh *
Defaults:NRPERS !requiretty
NRPERS ALL=(root) NOPASSWD: NRPERSCOMMANDS
Please what could be the problem?
Nagios remote nrpe check_disk returns permission denied
-
- Posts: 14
- Joined: Wed Apr 16, 2014 3:06 am
Re: Nagios remote nrpe check_disk returns permission denied
Try adding the path to the check_disk plugin to your Cmmd_Alias NRPERSCOMMANDS line in your /etc/sudoers like the example below.
Also, in the nrpe command definition put the sudo command in it so when the agent runs it, it will run it as root.
Both of those changes should get the check_disk to run as root and fix the error you are receiving.
Code: Select all
Cmnd_Alias NRPERSCOMMANDS = /usr/lib64/nagios/plugins/eventhandlers/fix_ipsec, /usr/bin/docker inspect *, /usr/lib64/nagios/plugins/check-docker-container.sh *, /usr/lib64/nagios/plugins/check_disk
Code: Select all
command[check_hda1]=/usr/bin/sudo /usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -A -X configfs -X cgroup -X tmpfs -X selinuxfs -X sysfs -X proc -X mqueue -X binfmt_misc -X devtmpfs
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 14
- Joined: Wed Apr 16, 2014 3:06 am
Re: Nagios remote nrpe check_disk returns permission denied
Thanks a lot, that worked!
Re: Nagios remote nrpe check_disk returns permission denied
Your welcome, glad it is working. I'll mark the post as solved and lock it. If you have any questions in the future, feel free to open a new post.
Be sure to check out our Knowledgebase for helpful articles and solutions!