nrpe problem on RedHat8 /tmp
Posted: Mon Mar 23, 2020 10:53 am
I am having a problem with NRPE reading /tmp on a Redhat 8 system.
I have a basic bash script that checks for particular files (by name) in /tmp and then warns if too many (done via ls piped to wc).
The permissions on /tmp are : drwxrwxrwt ; I have tried setting them to : drwxrwxrwx
SELinux is disabled and I removed any ACLs on /tmp
The script works locally when running via "sudo -u nrpe <script>" in that it produces the correct number of the target files in /tmp.
When running the script remotely from my Nagios server using CLI check_nrpe (as nagios), it runs but always shows 0 for the # the target files. This is the same result as what the Nagios monitor service shows.
If I move the files to some other directory and modify the script accordingly, the remote check_nrpe command works correctly.
So, I am baffled as to why it won't work on /tmp... which is meant to be world readable. Despite that, I have tried various "sudo" additions for nrpe without any luck and as noted, the script works on other directories (without extra sudo privs). Also, the same /tmp check script works perfectly on RH6 and RH7 systems via check_nrpe.
Additionally, I had another nagios/nrpe check that was dependent on reading the contents of a file (world readable) in /tmp that did not work either (on the same RH8 host). I found a work around for that check but this other /tmp check is not so easy to work around. Regardless, the problem with /tmp seems the same.
Lastly, all other nagios/check_nrpe checks for this host are working correctly.
@nrpe-client:# nrpe -V
NRPE - Nagios Remote Plugin ExecutorVersion: 3.2.1
@nagios-server:# /usr/lib64/nagios/plugins/check_nrpe -V
NRPE Plugin for NagiosVersion: 3.2.1
I have a basic bash script that checks for particular files (by name) in /tmp and then warns if too many (done via ls piped to wc).
The permissions on /tmp are : drwxrwxrwt ; I have tried setting them to : drwxrwxrwx
SELinux is disabled and I removed any ACLs on /tmp
The script works locally when running via "sudo -u nrpe <script>" in that it produces the correct number of the target files in /tmp.
When running the script remotely from my Nagios server using CLI check_nrpe (as nagios), it runs but always shows 0 for the # the target files. This is the same result as what the Nagios monitor service shows.
If I move the files to some other directory and modify the script accordingly, the remote check_nrpe command works correctly.
So, I am baffled as to why it won't work on /tmp... which is meant to be world readable. Despite that, I have tried various "sudo" additions for nrpe without any luck and as noted, the script works on other directories (without extra sudo privs). Also, the same /tmp check script works perfectly on RH6 and RH7 systems via check_nrpe.
Additionally, I had another nagios/nrpe check that was dependent on reading the contents of a file (world readable) in /tmp that did not work either (on the same RH8 host). I found a work around for that check but this other /tmp check is not so easy to work around. Regardless, the problem with /tmp seems the same.
Lastly, all other nagios/check_nrpe checks for this host are working correctly.
@nrpe-client:# nrpe -V
NRPE - Nagios Remote Plugin ExecutorVersion: 3.2.1
@nagios-server:# /usr/lib64/nagios/plugins/check_nrpe -V
NRPE Plugin for NagiosVersion: 3.2.1