0

I'm running NRPE on a server with the check_disk command. I have setup sudo and the command works ok as the nagios user on the server.

command[check_disk]=/usr/bin/sudo /usr/local/nagios/libexec/check_disk -w 10% -c 5% -x /dev/cdrom -x /dev/shm -x /nfs01 -x /nfshome -x /mnt/hlmon01/shared -x /mnt/hlmon01/shared -A -i '.gvfs'

/usr/bin/sudo /usr/local/nagios/libexec/check_disk -w 10% -c 5% -x /dev/cdrom -x /dev/shm -x /nfs01 -x /nfshome -x /mnt/hlmon01/shared -x /mnt/hlmon01/shared -A -i '.gv fs' 
DISK OK - free space: / 44730 MB (93% inode=98%); /boot 351 MB (78% inode=99%); /var/lib/xenstored 5593 MB (99% inode=99%); /poolfsmnt/0004fb0000050000577933960ee5846b 102134 MB (99% inode=99%); /OVS/Repositories/0004fb0000030000755a9cd0ee8ac4da 1736686 MB (33% inode=33%);| /=2962MB;45241;47754;0;50268 /boot=95MB;428;452;0;476 /var/lib/xenstored=0MB;5033;5313;0;5593 /poolfsmnt/0004fb0000050000577933960ee5846b=265MB;92160;97280;0;102400 /OVS/Repositories/0004fb0000030000755a9cd0ee8ac4da=3506194MB;4718592;4980736;0;5242880

When I run this command on the nagios server I am getting the following error:

./check_nrpe -H test_server -c check_disk 
NRPE: Unable to read output

Can anyone help me out on how to debug this?

Thanks

Paul Haldane
  • 4,612
John S
  • 3

2 Answers2

0

Hi with which user did your run: /usr/bin/sudo /usr/local/nagios/libexec/check_disk -w 10% -c 5% -x /dev/cdrom -x /dev/shm -x /nfs01 -x /nfshome -x /mnt/hlmon01/shared -x /mnt/hlmon01/shared -A -i '.gv fs' ?

Try to run this command doing "su - [the user your nagios agent runs]" before.

0

This is likely to be selinux stopping sudo access from nrpe. Try disabling selinux temporarily on the server that you're monitoring with

setenforce permissive

If that makes things work then you need to decide if you're happy just making this permanent or if you're prepared to update the selinux policy to make it work. If you look in /var/log/audit/audit.log you should see the denials that are causing the issue.

There's some discussion of related issues here - SELinux prevents Nagios plugins from running on RHEL6 That's talking about Red Hat derived distributions, I'm not sure what version of Linux you're using on these systems.

Paul Haldane
  • 4,612