Manual check works, with NRPE returns error
Posted: Thu Feb 04, 2016 12:13 pm
Hi all, have been banging my head on this one, and was wondering if anyone has any suggestions. I'm working with checking NFS mounts in a RHEL 6 environment, using Nagios Core 4.1 and NRPE 2.15. I'm using two different scripts I got from the exchange, check_nfs.sh and check_mountpoints.sh (https://exchange.nagios.org/directory/P ... sh/details, https://exchange.nagios.org/directory/P ... 2E/details).
So here's the thing, if I run these manually, they work FINE, when run with check_nrpe, they each throw an error, and I have no idea what check_nrpe is doing that would cause this behavior. For example:
[root@blah libexec]# ./check_nfs.sh
OK - NFS mounts are functioning within normal operating parameters
[root@blah libexec]# ./check_nrpe -H localhost -c check_nfs
CRITICAL - NFS mounts may be stale or unavailable
[root@blah libexec]# ./check_mountpoints.sh -a
OK: all mounts were found (/mnt/jomama )
[root@blah libexec]# ./check_nrpe -H localhost -c check_nfs_mounts
CRITICAL: /mnt/jomama doesn't exist on filesystem ;
Command defs from nrpe.cfg:
command[check_nfs_mounts]=/usr/local/nagios/libexec/check_mountpoints.sh -a
command[check_nfs]=/usr/local/nagios/libexec/check_nfs.sh
For the mount that fails I have verified that it is there, mounted, I can cd to it, touch a file, remove, etc, so it appears to be fine, and it appears to be fine in /etc/fstab. I can unmount, and do a mount -a and it mounts fine... So I am pretty sure the mount is ok, and defined ok, there just seems to be something I can't grasp with how the script is getting run by check_nrpe.
TIA,
Jason
So here's the thing, if I run these manually, they work FINE, when run with check_nrpe, they each throw an error, and I have no idea what check_nrpe is doing that would cause this behavior. For example:
[root@blah libexec]# ./check_nfs.sh
OK - NFS mounts are functioning within normal operating parameters
[root@blah libexec]# ./check_nrpe -H localhost -c check_nfs
CRITICAL - NFS mounts may be stale or unavailable
[root@blah libexec]# ./check_mountpoints.sh -a
OK: all mounts were found (/mnt/jomama )
[root@blah libexec]# ./check_nrpe -H localhost -c check_nfs_mounts
CRITICAL: /mnt/jomama doesn't exist on filesystem ;
Command defs from nrpe.cfg:
command[check_nfs_mounts]=/usr/local/nagios/libexec/check_mountpoints.sh -a
command[check_nfs]=/usr/local/nagios/libexec/check_nfs.sh
For the mount that fails I have verified that it is there, mounted, I can cd to it, touch a file, remove, etc, so it appears to be fine, and it appears to be fine in /etc/fstab. I can unmount, and do a mount -a and it mounts fine... So I am pretty sure the mount is ok, and defined ok, there just seems to be something I can't grasp with how the script is getting run by check_nrpe.
TIA,
Jason